This will only work on Windows Installer 5.0+. You need to set ALLUSERS=2 and MSIINSTALLPERUSER=1
Dave On 2/18/2014 1:37 AM, Thomas Brodersen wrote: > I am trying to create a perUser installation package for an application that > will install to the "ProgramFilesFolder" (which should be something like > %LocalAppData%\Programs for a perUser installation). This works fine when > everything is defined in the installer project, but when I make an installer > based on a WiX library project containing that directory structure > referencing "ProgramFilesFolder", the perUser setting (defined in the > installer project) doesn't seem to take effect - the installer warns that it > could not access the "Program Files" directory. Is this a bug or am I doing > something wrong? > > Here are the files: > > Library.wxs (in ProductInstallerLibrary project): > > <?xml version="1.0" encoding="UTF-8"?> > <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> > <Fragment> > <Directory Id="TARGETDIR" Name="SourceDir"> > <Directory Id="ProgramFilesFolder"> > <Directory Id="INSTALLFOLDER" Name="My Sample Application" /> > </Directory> > </Directory> > </Fragment> > > <Fragment> > <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> > <Component Id="ProductComponent" > Guid="699A9167-3AA0-49FF-919B-F1CE4DBBB2C3"> > <RegistryValue KeyPath="yes" Root="HKCU" > Key="SOFTWARE\SHARECON\MySampleApplication" Name="InstallFolder" > Type="string" Value="[INSTALLFOLDER]" Action="write" /> > <File Source="$(var.MySampleApplication.TargetPath)" /> > <RemoveFolder Id="INSTALLFOLDER" On="uninstall" /> > </Component> > </ComponentGroup> > </Fragment> > </Wix> > > Product.wxs (in ProductInstaller project, referencing the > ProductInstallerLibrary project): > > <?xml version="1.0" encoding="UTF-8"?> > <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> > <Product Id="*" Name="ProductInstaller" Language="1033" Version="1.0.0.0" > Manufacturer="Sharecon A/S" > UpgradeCode="105d31b7-6d08-44de-9b77-55588b58de87"> > <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" > /> > > <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is > already installed." /> > <MediaTemplate EmbedCab="yes" /> > > <Feature Id="ProductFeature" Title="ProductInstaller" Level="1"> > <ComponentGroupRef Id="ProductComponents" /> > </Feature> > </Product> > > </Wix> > > > Development environment: Visual Studio 2010, WiX 3.7. > > > Thomas Magle Brodersen > SHARECON A/S > > E-mail: t...@sharecon.com > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users