Here is the minimal sample (commented out portion is using custom action type 35 to do the same thing, perhaps for situations where resulting path must be constructed from multiple variables):
<?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="847ba1e2-b424-4ca4-acf0-93d369d0d79c" Name="CA35" Language="1033" Version="1.0.0.0" Manufacturer="CA35" UpgradeCode="f668e1b5-0ef2-4754-b45b-e30855f620bf"> <Package InstallerVersion="200" Compressed="yes" /> <Media Id="1" Cabinet="CA35.cab" EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLLOCATION" Name="CA35"> <Component Id="Component1" Guid="{2FDBC22C-B4AE-4CD9-AAB2-747C1388ED29}"> <File Id="ReadMe" DiskId="1" Name="Readme.txt" Source="Readme.txt" Vital="yes" KeyPath="yes" /> </Component> </Directory> </Directory> </Directory> <Property Id="INSTALLLOCATION"> <RegistrySearch Id="FindCommonFilesDir" Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion" Name="CommonFilesDir" Type="raw" /> </Property> <!-- <Property Id="COMMONFILESDIR"> <RegistrySearch Id="FindCommonFilesDir" Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion" Name="CommonFilesDir" Type="raw" /> </Property> <CustomAction Id="SetAppPath" Directory="INSTALLLOCATION" Value="[COMMONFILESDIR]" /> <InstallExecuteSequence> <Custom Action="SetAppPath" After="CostFinalize">Not Installed</Custom> </InstallExecuteSequence> --> <Feature Id="ProductFeature" Title="CA35" Level="1"> <ComponentRef Id="Component1" /> </Feature> </Product> </Wix> Regards, Alex Shevchuk -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Koloszar Jozsef Sent: Friday, June 20, 2008 11:39 AM To: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] reading install path from registry for add-on i did try that at first but it didn't work. it works if PRODUCTDIR is a simple string like "OtherFooDirName". but a full path like "D:\BlahDir\FooProg" does not get resolved correctly - just couldn't get it to work - i suspect this is because it can not be created under the specific parent (in case of your example it would typically be resolved to "C:\Program Files\D:\BlahDir\FooProg", which does not make sense - of course an install path from the UI does work, so my reasoning is probably wrong, now that i think about it...) i based my code a deak gabor jan's tutorial (there is a subsection dedicated to this), but that is for wix2, could this functioanlity have changed in w3? any thoughts (has anybody gotten something like this to work in w3, a working minimal sample, perhaps? :-) any ideas? > You can use a Directory Id like a property. > E.g. You can have > <Directory Id="TARGETDIR" Name="SourceDir"> > <Directory Id="ProgramFilesFolder" Name="PFiles"> > <Directory Id="PRODUCTDIR" Name="MyProduct"> > ... Components ... > </Directory> > </Directory> > </Directory> > > You can then use a Custom Action (or I guess the RegSearch action directly) > to set PRODUCTDIR like > you would a normal property. All the child directories below it will also > get resolved as expected. > > Rob > > > Koloszar Jozsef wrote: >> hi, >> i'm trying to write an installer for an addon. the dumb way, but i have to. >> >> i'm reading the main install path of the main/parent app from registry. it >> is stored there as a full path string like "D:\Not Program >> Files\InstalledHereInstead\Foo App\" >> >> i read it using >> <Property Id="INSTALLDIR"> >> <RegistrySearch Id='mainprogdirsearch' Type='raw' >> Root='HKLM' Key='Software\Foo App\Setup Info' Name='locprogdir' /> >> </Property> >> and i'm guessing it gets read because a condition on INSTALLDIR is not >> triggered. >> >> but here's my problem: >> how do i then use this nice string path to actually specify the install >> location, that is otherwise and normally done by neatly nesting >> <Directory>-s one depth at the time ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users