Something like this:

<Property Id="PROP1">
  <RegistrySearch ... />
</Property>
<Property Id="PROP2">
  <RegistrySearch ... />
</Property>

<CustomAction Id="SetINSTALLDIR1" Property="INSTALLDIR" Value="[PROP1]" />
<CustomAction Id="SetINSTALLDIR2" Property="INSTALLDIR" Value="[PROP2]" />
<CustomAction Id="PathNotFound" Error="No path was found in the registry." />

<InstallExecuteSequence>
  <Custom Action="SetINSTALLDIR1" After="Appsearch">PROP1</Custom>
  <Custom Action="SetINSTALLDIR2" After="SetINSTALLDIR1">NOT PROP1 AND 
PROP2</Custom>
  <Custom Action="PathNotFound" After="SetINSTALLDIR2">NOT PROP1 AND NOT 
PROP2</Custom>
</InstallExecuteSequence>

Because AppSearch does not guarantee the order of search execution you need to 
search for both regkeys.  If you think you absolutely must look for an 
alternative key only if first regkey does not exist, you have to do the lookup 
for alternative key in the custom action scheduled after AppSearch.

Regards,
Alex Shevchuk



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kiran 
Nallabothula
Sent: Wednesday, July 30, 2008 5:13 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Registry question.


Hello, In my installer i want to check if a regkey exists if so assign the 
value to a property and if the first regkey doesnt exist i need to verify an 
alternate second regkey and assign the value to the property. I currently i use 
the following snippet to search the registry to get the value from my first 
regkey
<Property Id="INSTALLDIR" Value="0"><RegistrySearch 
Id="SERVER_INSTALLDIR_REGSEARCH" Root="HKLM" 
Key="SOFTWARE\Microsoft\commsvr\v1\Setup" Name="MsiInstallPath" Type="raw" 
Win64="$(env.TARGET_WIN64)" /></Property> How do i check if the above regkey is 
not present and look in the alternate regkey 
"HKLM\SOFTWARE\Microsoft\commsvr\Setup\MsiInstallPath" and assign the value to 
property "INSTALLDIR"  would be really thankful if somebody could tell me how i 
can accomplish this. thank youKiran Nallabothula.




Keep your kids safer online with Windows Live Family Safety. Help protect your 
kids.
_________________________________________________________________
Use video conversation to talk face-to-face with Windows Live Messenger.
http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_072008
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to