The issue to beware of is about per user/per machine. Your search is for a per machine install, which is fine if you know that the previous was per machine and this one is not per user, and cross context would not upgrade anyway. Maybe ideally there would be a registry search option that behaves somewhat like the Registry table, searching HKCU (for the CU) on a per user install and HKLM on a per machine install then you'd get the location appropriate for the context if there was a mixture or multiple per user installs. --------------- Phil Wilson
On Fri, Apr 18, 2014 at 4:45 PM, Jeremy Farrell <jeremy.farr...@oracle.com> wrote: > Perhaps I'm missing something, or this just works by luck, but it seems to > work for me in WiX v2: > > <Upgrade Id='$(var.GuidUpgrade)'> > <UpgradeVersion MigrateFeatures='no' Property='UPGRADING' /> > </Upgrade> > <Property Id="OLDINSTALLDIR"> > <RegistrySearch Id="GetOldInstallDir" Type="raw" > Win64='$(var.Comp64)' > Root="HKLM" > > Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[UPGRADING]" > Name="InstallLocation" /> > </Property> > > If I'm living on borrowed time, I'd value an explanation. > > >> From: Phil Wilson [mailto:phildgwil...@gmail.com] >> Sent: Friday, April 18, 2014 6:56 PM >> >> There is a kind of built-in way, and that's to set the >> ARPINSTALLLOCATION property (with a type 51 set property CA) after you >> know the folder location. The good part about this is that it exposes >> the location to the standard APIs such as using MsiGetProductInfo >> (....INSTALLPROPERTY_INSTALLLOCATION... ) and the equivalents in >> script etc. The bad part about it is that retrieving it requires code >> because the registry search to find it is awkward. >> --------------- >> Phil Wilson >> >> >> On Fri, Apr 18, 2014 at 9:45 AM, Neil Sleightholm <n...@x2systems.com> >> wrote: >> > Does that persist across an upgrade? (Last time I checked, admittedly >> in v3.6, it didn't.) >> > >> > Neil >> > >> > -----Original Message----- >> > From: Phill Hogland [mailto:phogl...@rimage.com] >> > Sent: 18 April 2014 17:16 >> > To: wix-users@lists.sourceforge.net >> > Subject: Re: [WiX-users] Preserving install directory on upgrade >> > >> > If your msi package will always be launched by a burn bundle, then >> you could initialize and set Persisted=yes" on the burn string >> variable, which is then passed as a MsiProperty to the package. But if >> the msi package will be launched by on-demand msiexec install due to >> advertising or a repair issue, or if the user would ever launch the msi >> directly, then the value of properties used in the initial install >> should be saved and initialized the next time the package is launched, >> as indicated previously. > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/NeoTech > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users