Alter the "My Account" link in installation profile Well i've tried the following code to insert an attribute to the user-account link on installation profile.It works for all other menu items (Home[]), except the user-account link, probably due to the reason it is rebuilt again.

&lt;?php
   $path = 'user';
   // Check for user (My account) menu item.
   $existing_item = db_select('menu_links')
    -&gt;fields('menu_links')
    -&gt;condition('link_path', $path)
    //-&gt;condition('module', 'system')
    -&gt;execute()-&gt;fetchAssoc();

  $item = array(
   'mlid' =&gt; $existing['mlid'],
   'link_path' =&gt; $existing['link_path'],
   'link_title' =&gt; $existing['link_title'],
 //'menu_name' =&gt; $existing['menu_name'],
   'router_path' =&gt; $existing['router_path'],
 //'module' =&gt; $existing['module'],
 //'plid' =&gt; $existing['plid'],
   'options' =&gt; array(
    'attributes' =&gt; array(
    'target' =&gt; '_blank',
    ),
   ),
 );
 // $item['options'] = serialize($item['options']);
 // $item = _menu_link_build($item);

 // $link['options'] = serialize($link['options']);
 if (menu_link_save($item, $existing) == $existing['mlid']) {

   drupal_set_message(t('User menu target attribute updated'));
 }


The above code :


selects form the database the {menu_links} record for 'user' menu item.
Alter the options in the $item['options'] array
Performs menu_link_save() on the existing item since we have given an existing $mlid


Well, i've tried menu_cache_clear, rebuilds, straight altering the database values.. everything! but the "My account" link is rebuilded after my profile installation routines, even though is the last one.

How this will work?
How can i achieve this kind of alteration in installation profile?

In general, is it possible to override module-defined menu items options/properties in profile, or hook_menu() will run always after my code and revoke all my changes?
Perhaps you could use:

hook_menu_alter

Not sure if it'll work with option attributes, but worth a try.

e.g

/**
 * Implements hook_menu_alter
 */
PROFILE_menu_alter(&amp;$items){
  $items['user']['options'] = array('attributes' =&gt; array('target' =&gt; '_blank'));
}


Alternatively, it would be easy enough to add the _blank attr with jQuery.

e.g:

$('body.some-class #user-menu-link a').attr('target', '_blank');


Update: added example PROFILE_ option for menu_alter hook