views:

111

answers:

1

I would like to add a shortcut on the desktop which points to a virtual drive mounted under "Computer". This drive doesn't have a letter associated with it. I've successfully added a link to an executable, but all tries with Explorer has failed. When I add this shortcut manually it gets the following shortcut (in properties): Computer\MyProduct

I've tried the following:

<Component Id="DesktopShortcut" Guid="8EF63340-10D5-4583-9E28-F2EFFA666761">
    <CreateFolder />
    <RegistryKey Root="HKCU" Key="Software\MyProduct\Install" Action="createAndRemoveOnUninstall">
        <RegistryValue Name="DTSC" Value="1" Type="integer" KeyPath="yes" />
    </RegistryKey>
    <Shortcut Id="DesktopShortcut" Directory="DesktopFolder" Name="My Product" Icon="yoobitsIcon" Target="Computer\MyProduct" />
</Component>

Any ideas?

A: 

One possible solution is to add the shortcut in as a .lnk file and include as a regular file into the Desktop folder during install.

<Directory Id="DesktopFolder" Name="Desktop">
  <Component Id="MyProductDesktopShortcut" Guid="A47E6BEB-C7D6-4725-A94F-C6C52A55F31C">
    <RegistryKey Root="HKCU" Key="Software\MyProduct\DesktopShortcut" Action="createAndRemoveOnUninstall">
      <RegistryValue Name="DTSC" Value="1" Type="integer" KeyPath="yes" />
    </RegistryKey>
    <File Id="MyProductDesktopShortcutFile" Name="MyProduct.lnk" Source="MyProduct.lnk" DiskId="1" />
  </Component>
</Directory>

Drawback: The icon registered in the .lnk file will not be correct if the application gets installed in a different directory than what is expected. In this scenario this will result in a default folder icon and the adjust to the correct icon once you navigate to that virtual drive.

tronda