1

Installer creates 2 shortcuts on Desktop: file (FS) and internet shortcuts(IS). On uninstall FS is removed ok, but IS still exists. Then I commented FS and tested. Now it is created and removed successfully.

What is wrong?

    <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>

1 Answer 1

4

I tried this code for your problem and it works

<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>

Give it a try... Also it always helps to log the Install Use this in the command line:
msiexec /i [msiname] /l*v [filename]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.