2

I have a WIX file which i'm using to to install an app and create two short cuts. One in all users start menu and one in the desktop. Since it creates it's stuff in all users I thought that you didn't need to have a reg key.

But without it it complains. with

error LGHT0204: ICE38: Component ProgramMenuAppFolder installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file.

With HKLM however it also complains that the

LGHT0204: ICE38: Component ProgramMenuAppFolder installs to user profile. It's KeyPath registry key must fall under HKCU.

Even though it's installing to the all users and so shouldn't be installing to the user profile.

Any suggestions?

  <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
    <Product Id="*" Name="$(var.PublisherSimple) $(var.AppName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="$(var.Publisher)" UpgradeCode="$(var.ProductUpgradeCode)">
      <Package
        Description="$(var.PublisherSimple) $(var.AppName) $(var.ProductVersion)"
        InstallerVersion="200" Compressed="yes"
        InstallScope="perMachine"
        />
      <Property Id="DISABLEADVTSHORTCUTS" Value="1" />

      <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
      <MediaTemplate CompressionLevel="none" />

      <Feature Id="ProductFeature" Title="$(var.PublisherSimple) $(var.AppName) $(var.ProductVersion)" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
        <ComponentRef Id="ProgramMenuDir"/>
        <ComponentRef Id="ProgramMenuAppFolder"/>
      </Feature>
      <UI>
        <UIRef Id="WixUI_InstallDir" /> <!-- actually uses but that just skips the licence page <UIRef Id="WixUI_InstallDir_Custom" />-->

        <Publish Dialog="ExitDialog"
            Control="Finish"
            Event="DoAction"
            Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
      </UI>

      <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
      <!--<Property Id="WixAppFolder" Value="WixPerMachineFolder" />-->

      <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.AppName)" />
      <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />

      <Property Id="WixShellExecTarget" Value="[#MVTestApp.exe]" />
      <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
    </Product>

    <Fragment>
      <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
          <Directory Id="PublisherDirectory" Name="MV">
            <Directory Id="INSTALLFOLDER" Name="MV Test App"/>
          </Directory>
        </Directory>
            <Directory Id="ProgramMenuFolder" Name="Programs">
                <Directory Id="ProgramMenuDir" Name="MV" >
                  <Directory Id="ProgramMenuAppFolder" Name="MV Test App Folder">
                    <Component Id="ProgramMenuAppFolder" Guid="3ebfd81d-08b2-4bcf-8c90-e84241a58976">
                      <RemoveFolder Id="ProgramMenuAppFolder" On="uninstall" />
                      <!--<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value="" KeyPath="yes" />-->
                    </Component>
                  </Directory>
                  <Component Id="ProgramMenuDir" Guid="f1cf94bf-5e5a-4c60-8729-65bdf1cb9244">
                    <RemoveFolder Id="ProgramMenuDir" On="uninstall" />
                    <!--<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]Start" Type="string" Value="" KeyPath="yes" />-->
                  </Component>
                </Directory>
            </Directory>
            <Directory Id="DesktopFolder" Name="Desktop" />    
      </Directory>
    </Fragment>

    <Fragment>
      <ComponentGroup Id="ProductComponents">
        <Component Id="MVTestApp.Exe" Directory="INSTALLFOLDER" Guid="*" Win64="no">
          <File Id="MVTestApp.Exe" KeyPath="yes" Source="MVTestApp.Exe" />
          <Shortcut Id="startmenuShortCut" Directory="ProgramMenuAppFolder" Name="MV Test App Short Start" WorkingDirectory="INSTALLFOLDER" Advertise="yes" />
          <Shortcut Id="desktopShortCut" Directory="DesktopFolder" Name="MV Test App Short Desk" WorkingDirectory="INSTALLFOLDER" Advertise="yes" />
        </Component>
      </ComponentGroup>
    </Fragment>
  </Wix>

This is a similar problem as Install optional desktop shortcut for all users

Community
  • 1
  • 1
Matt Vukomanovic
  • 1,392
  • 1
  • 15
  • 23

0 Answers0