1

安装程序在桌面上创建 2 个快捷方式:文件 (FS) 和 Internet 快捷方式 (IS)。卸载时FS删除正常,但IS仍然存在。然后我评论FS和测试。现在它已成功创建和删除。

怎么了?

    <Directory Id='TARGETDIR' Name='SourceDir'>
        <Directory Id="DesktopFolder" Name="Desktop"/>
        <Directory Id="ProgramMenuFolder" Name="PMenu">
            <Directory Id="ProgramMenuDir" Name="Advertised Shortcut" />
        </Directory>
    </Directory>

    <DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationShortcutConf" Guid="{9FF60FF5-F1A2-413F-98FB-CF7B3101F10F}">
  <Shortcut Id="CompanyUtilConfigurator1"
              Directory="DesktopFolder"
              Advertise="no"
              Name="Company Util Configurator"
              WorkingDirectory="INSTALLDIR"
              Icon="CompanyUtilConfiguratorIcon.exe">
  </Shortcut>
  <RegistryValue Root="HKCU" Key="Software\Company LLC\Company\Util" Name="installed_conf" Type="integer" Value="1" KeyPath="yes"/>

  <RemoveFolder Id="DeleteShortcutFolder1"
              Directory="DesktopFolder"
              On="uninstall" />
</Component>

        <Component Id="ApplicationShortcut" Guid="{77C005A8-63DC-43F1-9081-84157EDED0B3}">
            <Condition><![CDATA[WS_SHORTCUT_NAME<>""]]></Condition>
  <util:InternetShortcut
            Id="Home" 
            Directory="DesktopFolder"
            Name="Company Util" Type="url"
            Target="[WS_SHORTCUT_NAME]"/>
            <RemoveFolder Id="DesktopFolder2"  Directory="DesktopFolder" On="uninstall"/>
            <RegistryValue Root="HKCU" Key="Software\Company LLC\Company\Util" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
        </Component>
    </DirectoryRef>
4

1 回答 1

4

我为您的问题尝试了此代码,并且可以正常工作

<RegistryKey Root="HKCU" Key="!(wix.Manufacturer)\!(wix.Product)" Action="createAndRemoveOnUninstall">
  <RegistryValue Name="FirstShortCut" Type="integer" Value="1" KeyPath="yes"  />
</RegistryKey>

<Shortcut Id="FirstShortCut" Directory="DeskTopFolder" WorkingDirectory="INSTALLDIR" Advertise="no" Name="ShortCutA" Icon="chk_on.ico"/>

  <Component Id="ShortCutB" Guid="{435CE3D7-047F-4bdb-9CDB-6A2AED1A1303}">
    <RegistryKey Root="HKCU" Key="!(wix.Manufacturer)\!(wix.Product)" Action="createAndRemoveOnUninstall">
      <RegistryValue Name="SecondShortCut" Type="integer" Value="1" KeyPath="yes"  />
    </RegistryKey>

    <util:InternetShortcut Id="SecondShortCut" Name="Second" Target="http://www.stackoverflow.com"/>

  </Component>
</DirectoryRef>

试一试...而且它总是有助于记录安装在命令行中使用它:
msiexec /i [msiname] /l*v [filename]

于 2012-03-05T23:19:08.317 回答