开发者

Wix: How to create a desktop shortcut pointing to a virtual drive under Computer

开发者 https://www.devze.com 2022-12-18 13:34 出处:网络
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 t开发者_

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 t开发者_StackOverflow社区o 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消