0
votes

I am trying to make a perMachine Installer that is able to create files and folders in the PersonalFolder and LocalAppDataFolder of each user. I am getting always the warning message "warning LGHT1076: ICE91: ..." as listed below. When I install as an Administrator the file and folder is created despite the warning, but when I try the installer as standard user no file and no folder is created on the user profile. What could be the solution?


    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="PFInstallDir" Name="Example">
                <Component Id="ApplicationFiles" Guid="12345678-1234-1234-1234-222222222222">
                    <File Id="ApplicationFile1" Source="notepad.exe"/>
                </Component>
            </Directory>
        </Directory>

        <Directory Id="CommonFilesFolder">
            <Directory Id="CFInstallDir" Name="Example">
                <Component Id="CommonApplicationFiles" Guid="12345678-1234-1234-1234-222222222223">
                    <File Id="ApplicationFile2" Source="notepad.exe"/>
                </Component>
            </Directory>
        </Directory>

        <Directory Id="CommonAppDataFolder">
            <Directory Id="CAInstallDir" Name="Example">
                <Component Id="CommonAppDataApplicationFiles" Guid="12345678-1234-1234-1234-222222222224">
                    <File Id="ApplicationFile3" Source="notepad.exe"/>
                </Component>
            </Directory>
        </Directory>

        <Directory Id="PersonalFolder">
            <Directory Id="InstallDirPersonal" Name="ExampleDocs">
                <Component Id="ApplicationPersonalFiles" Guid="12345678-1234-1234-1234-222222222225">
                    <CreateFolder />
                    <RemoveFolder Id="RemoveMyExampleDir1" On="uninstall" Directory="InstallDirPersonal"/>
                    <RegistryKey Root="HKCU" Key="Software\MyCompany\Documents">
                        <RegistryValue Name="MainExe" Value="1" KeyPath="yes" Type="integer" />
                    </RegistryKey>
                    <File Id="Notepad.MyExe"
                        Source="notepad.exe" DiskId="1" Checksum="yes">
                    </File>
                </Component>
            </Directory>
        </Directory>            

        <Directory Id="LocalAppDataFolder" Name="AppData">
            <Directory Id="InstallDirAppDataPersonal" Name="ExampleLocals">
                <Component Id="ApplicationPersonalDataFiles" Guid="12345678-1234-1234-1234-222222222226">
                    <CreateFolder />
                    <RemoveFolder Id="RemoveMyExampleDir" On="uninstall" Directory="InstallDirAppDataPersonal"/>
                    <RegistryKey Root="HKCU" Key="Software\MyCompany\Example">
                        <RegistryValue Name="MainExe" Value="1" KeyPath="yes" Type="integer" />
                    </RegistryKey>
                    <File Id="Notepad.MyExe1"
                        Source="notepad.exe" DiskId="1" Checksum="yes">
                    </File>
                </Component>
            </Directory>
        </Directory>
    </Directory>

    <Feature Id="DefaultFeature" Level="1">
        <ComponentRef Id="ApplicationFiles"/>
        <ComponentRef Id="CommonApplicationFiles"/>
        <ComponentRef Id="CommonAppDataApplicationFiles"/>
        <ComponentRef Id="ApplicationPersonalDataFiles"/>
        <ComponentRef Id="ApplicationPersonalFiles"/>
    </Feature>

</Product>

-- Build started: Project: SetupProjectPerUsrMachine, Configuration: Debug x86 --

warning LGHT1076: ICE91: The file 'Notepad.MyExe' will be installed to the per user directory 'InstallDirPersonal' that doesn't vary based on ALLUSERS value. This file won't be copied to each user's profile even if a per machine installation is desired.

warning LGHT1076: ICE91: The file 'Notepad.MyExe1' will be installed to the per user directory 'InstallDirAppDataPersonal' that doesn't vary based on ALLUSERS value. This file won't be copied to each user's profile even if a per machine installation is desired.

1

1 Answers

0
votes

Problem solved! http://www.installworld.com/index.php?option=com_content&do_pdf=1&id=146

"If the resource must be copied to each user’s profile, then add functionality to your package to do this. To achieve this, add a current user registry key (i.e., just a dummy registry key) and make this registry key the key path of the component which contains the resource. This means that the resource will be copied to the next user’s profile as part of the MSI self healing mechanism, provided that advertised entry points exist for the product."

http://blog.bittercoder.com/2007/02/28/wix-shortcuts/

<Component Id="StandAloneApplication" Guid="C8D5DB05-2D68-40e8-88D1-EF5BEA18DBE1">
  <File Id="SomeCompanySomeProductHostApp" 
        Name="SomeCompany.SomeProduct.HostApp.exe" 
        DiskId="1" 
        Source="....buildSomeCompany.SomeProduct.HostApp.exe" 
        Vital="yes">

    <Shortcut Advertise="yes" 
              Id="SomeCompanySomeProductHostAppShortcut" 
              Directory="ProgramMenuDir" 
              Name="My Product" 
              WorkingDirectory="INSTALLDIR" 
              Description="SomeProduct Application" 
              Icon="HostAppShortcutIcon.exe">

      <Icon Id="HostAppShortcutIcon.exe" 
            SourceFile="....buildSomeCompany.SomeProduct.HostApp.exe" />

    </Shortcut>
  </File>
</Component>