I'm trying to read some data out of the registry using <Property Id="MACHINEKEY"> <RegistrySearch Id="RMK" Root="HKLM" Type="raw" Key="SOFTWARE\MyKeyPath" Name="LicenseKey" ></RegistrySearch> </Property>
<Property Id="USERKEY"> <RegistrySearch Id="RUMK" Root="HKCU" Type="raw" Key="SOFTWARE\MyKeyPath" Name="LicenseKey" ></RegistrySearch> </Property> That works fine, and both items are correctly set to the values in the registry. Then, I'd like to set PIDKEY (if it isn't already set) to MACHINEKEY if that's set, or USERKEY if it's not. Unfortunately, I've spent the last 5 hours trying unsuccessfully to figure this one out. It seems I'm stuck even at the first hurdle. Ideally, I'd like to do this: <CustomAction Id="setMachineProductID" Property="PIDKEY" Value="[MACHINEKEY]" /> <CustomAction Id="setUserProductID" Property="PIDKEY" Value="[USERKEY]" /> and then add this in the sequence table: <InstallExecuteSequence> <Custom Action="setUserProductID" After="AppSearch">PIDKEY = ""< /Custom> <Custom Action="setMachineProductID" After="setUserProductID">PIDKEY = ""< /Custom> </InstallExecuteSequence> I expected that this would set PIDKEY to one of the values if it wasn't already set. I then add this line to one of my dialogs: <Control Id="CDKeyEdit" Type="Edit" X="45" Y="159" Width="250" Height="16" Property="PIDKEY" Text="{12}"> to try to display the value. Well, examining the logs, I get this: Action start 15:42:10: AppSearch. MSI (c) (20:B8) [15:42:10:257]: Note: 1: 2262 2: Signature 3: -2147287038 MSI (c) (20:B8) [15:42:10:257]: PROPERTY CHANGE: Adding MACHINEKEY property. Its value is 'bogusmachine'. MSI (c) (20:B8) [15:42:10:259]: Note: 1: 2262 2: Signature 3: -2147287038 MSI (c) (20:B8) [15:42:10:259]: PROPERTY CHANGE: Adding USERKEY property. Its value is 'bogususer'. Action ended 15:42:10: AppSearch. Return value 1. MSI (c) (20:B8) [15:42:10:260]: Doing action: ValidateProductID Action start 15:42:10: ValidateProductID. Action ended 15:42:10: ValidateProductID. Return value 1. MSI (c) (20:B8) [15:42:10:262]: Doing action: CostInitialize Action start 15:42:10: CostInitialize. As you can see my custom action isn't scheduled. so, I remove the conditions, and rewrite as: <InstallExecuteSequence> <Custom Action="setUserProductID" After="AppSearch" /> <Custom Action="setMachineProductID" After="setUserProductID" /> </InstallExecuteSequence> which gives the same results. Strangely, even if I try to set the PIDKEY on the command line of msiexec, I still don't get anything in the dialog. When I replace PIDKEY with a WORKINGKEY and make the following changes I get the same results: <Property Id="WORKINGKEY" Value="1234" /> <CustomAction Id="setMachineProductID" Property="WORKINGKEY" Value="[MACHINEKEY]" /> <CustomAction Id="setUserProductID" Property="WORKINGKEY" Value="[USERKEY]" /> only now 1234 shows up on my UI as the key in the dialog, but there's still no evidence of running the custom actions in the log. Any ideas where I've screwed up this time? Anthony Wieser Wieser Software Ltd I've tried to set up a custom action to just copy one of the properties to another, but it's not being run. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users