views:

29

answers:

1

Hello,

I want to add a shortcut in my program menu. i tried:

<Component Id='myId' Guid='E4DED108-0129-4a5b-83FE-C9D1E3025B00'> <File Id='MyFileID' Name='Prog.exe' DiskId='1' Source='.\Prog.exe' KeyPath='yes'> <Shortcut Id='myShortcut' Name='Prog' Icon='MyIcon.exe' IconIndex='0' Directory='ProgramMenuDir' Advertise='yes' /> </File> </Component> but the installer add the shortcut in a subfolder in the program menu! Why and what can i do to avoid this?

Thanks Micha

+1  A: 

You can try to change Directory='ProgramMenuDir' into Directory='ProgramMenuFolder', otherwise make a seperate shortcuts component;

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramMenuFolder">
    <Component Id="Shortcuts"  Guid="{}">
      <Shortcut Id='myShortcut' Name='Prog' Icon='MyIcon.exe' IconIndex='0' Directory='ProgramMenuFolder' WorkingDirectory='INSTALLDIR' Target="[INSTALLDIR]Prog.exe" />
      <RegistryValue Root='HKCU' Key='SOFTWARE\prog\prog' Type='string' Value='1' KeyPath='yes' />
    </Component>
  </Directory>

  <!-- other files -->
</Directory>
Wimmel