I have an app that I've currently authored the setup to always install unelevated per user. When I created my components to deploy files I had to include a registry value in each one and make it the KeyPath of the component to make the validation happy. Now I need to support a per machine option and I'm trying to figure out what the best way to do this is.
I don't give users the option of changing the install location right now - it's always based on a location under LocalAppDataFolder. If I support the per machine install I'll go to ProgramFilesFolder. Now my typical file component looks like this: <Component Id="MyApp.dll" Guid="{02309649-E4AD-4D20-9B88-13103D000000}"> <File Source="$(var.MyAppSrcDir)MyApp.dll" /> <RegistryValue Root="HKCU" Key="Software\MyApp\Setup\Files" Name="MyApp.dll" Value="1" Type="integer" Action="write" KeyPath="yes" /> </Component> So if I'm going to a per-machine location, I want the file to be the KeyPath and I don't want to write the registry value at all. I'm currently producing 2 setups, 1 for "XP" that can deal with old versions of Windows Installer and one for more modern operating systems with UAC. Depending on which config is built, I define the Package element slightly differently: <?if $(var.TargetOS) = XP ?> <Package InstallerVersion="200" Compressed="yes" /> <?else ?> <Package InstallerVersion="400" Compressed="yes" InstallScope="perUser" InstallPrivileges="limited" /> <?endif ?> My initial thought is just to conditionalize the definition of the InstallDir to be in ProgramFilesFolder and all of the KeyPath RegistryValues in each component to only write if TargetOS is XP. And to give people that need to do per-machine installs the "XP" setup. Does anybody have any advice on the best way to do this? -J ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users