I'm still rather struggling with this.... My own MSIs I can fix if needs be by not using an MSM however I still need an MSM to supply to customers to include our redistributable component in their own installers. I want to allow the MSM to be used in per-user and per-machine installers.
In order to support per-user installer, I have made the component KeyPath a registry value under HKCU. This works but I am still getting warnings in MSI projects using the MSM: For a per-user MSI, I get a warning that "the file will installed in a per-user directory that doesn't vary based on ALLUSERS". This I assume could be fixed using Conditions testing ALLUSERS but I don't know how to do that: how do I install components from an MSM in different directories depending on ALLUSERS? For a per-machine MSI, I get a warning that the component has both per-user and per-machine data with an HKCU reg KeyPath. In case it helps, what I have at the moment in a simplified test solution goes essentially like so: MSM.wxs <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="MergeRedirectFolder"> <Component Id="MsmComponent" Guid="..."> <File Id="MsmComponent.File" KeyPath="no" Source="somefile.txt"/> <RegistryValue KeyPath="yes" Root="HKCU" ..../> <RemoveFolder Id="DelMergeRedirectFolder" On="uninstall"/> </Component> </Directory> </Directory> UserMSI.wxs <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="LocalAppDataFolder"> <Directory Id="INSTALL_FOLDER" Name="Company"> <Directory Id="INSTALL_FOLDER" Name="Components" > <Merge Id="MSM" SourceFile="$(var.MSM.TargetPath)" ... /> </Directory> </Directory> </Directory> </Directory> MachineMSI.wxs <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="CommonFilesFolder"> <Directory Id="INSTALL_FOLDER" Name="Company"> <Merge Id="MSM" SourceFile="$(var.MSM.TargetPath)" ... /> </Directory> </Directory> </Directory> Thanks Kevin -----Original Message----- From: Parkes, Kevin Sent: 27 June 2013 17:02 To: 'wix-users@lists.sourceforge.net' Subject: Re: per-user/per-machine in MSM, MSI and bundle >Are the components that are flagged by those two ICE warnings coming from the >MSM or from the MSI consuming it? The components are in the MSM but the warnings appear when building the MSI >What resources are in the components producing the ICE 57 warnings? It is just one component (generated by Heat). I use an XSLT to set KeyPath="no" on <File> and add a <RegistryValue> with KeyPath=yes" and Root="HKCU" (If I don't add <RegistryValue> - or if I use "HKMU" - the ICE75 becomes an error rather than a warning) The component contains an <AppId>, my added <RegistryValue>, the <File> (with <TypeLib> child) and a <RegistryValue Root="HKCR" Key="AppID\...> I have no idea what in the component is per-user and what per-machine. >What are the "default" paths of the directories producing the ICE 91 warnings? The MSI currently defaults to folders under LocalAppDataFolder. I figured I probably needed to do something with ALLUSERS but wasn't sure what. Unfortunately, we still have to support XP so I may have to put up with warnings or separate MSIs Thanks Kevin ------------------------------ From: Blair Murri <os...@live.com> Subject: Re: [WiX-users] per-user/per-machine in MSM, MSI and bundle To: General discussion for Windows Installer XML toolset. <wix-users@lists.sourceforge.net> Message-ID: <blu168-w426f63a03a33e6bd549345cd...@phx.gbl> Content-Type: text/plain; charset="iso-8859-1" 1.Are the components that are flagged by those two ICE warnings coming from the MSM or from the MSI consuming it? What resources are in the components producing the ICE 57 warnings? What are the "default" paths of the directories producing the ICE 91 warnings? HKCU is per-user registry data and shouldn't normally share a component with any resource going into a per-machine location (whether registry or filesystem).If an MSI (or even an MSM) will support both per-machine and per-user scenarios, use HKMU and/or HKCR and never HKLM or HKCU. Directories are harder, most defined directories are either per-machine or per-user, so you generally must place all files in directories that have different values based on the value of ALLUSERS (check each property to see if the documented filesystem location is changed by the value of ALLUSERS). Basically, see the following page: http://msdn.microsoft.com/library/windows/desktop/dd408068.aspx. If you follow those guidelines, you wil! l be restricted to Win7/Server 2008R2 or above, and you will need to set Package\@InstallerVersion to "500". If you must support Vista or anything even more downlevel, you will have ICE errors/warnings unless you build per-machine and per-user MSIs separately. 2. Add MsiPackage\@ForcePerMachine and set it to "yes" in your per-machine bundle. Blair > From: kevin.par...@wacom.eu > To: wix-users@lists.sourceforge.net > Date: Thu, 27 Jun 2013 10:29:39 +0000 > Subject: [WiX-users] per-user/per-machine in MSM, MSI and bundle > > Question 1. > I am creating an MSM for a COM DLL. I am using the MSM in my own per-user MSI > and I am getting ICE warnings 57 ("per-user and per-machine data with an HKCU > Registry KeyPath") and 91 ("file will be installed to the per user directory > that doesn't vary based on ALLUSERS "). How do I fix the warnings and enable > the MSM to be used in both per-user and per-machine MSIs? > > Question 2. > I am including the above MSI in 2 bundles, one per-user the other > per-machine. It would be nice (though not essential) to have the MSI install > per-machine when installed from the per-machine bundle. Is that possible? If > so, what do I have to do in the MSI and/or bundle to achieve that? ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users