We need to do these: 1. Detect the "HKCU\Software\CompanyX\ProductY" key(this key includes 5 entries) in registry, if the key exists, then copy it to be "HKCU\Software\CompanyX\ProductY_Fix". 2. For 32 bit machine, detect if "HKLM\Software\CompanyX\ProductY" exists. If it exists, then copy the key to be "HKLM\Software\CompanyX\ProductY_Fix". 3. For 64 bit machine, detect if "HKLM\Software\Wow6432Node\CompanyX\ProductY" exists. If it exists, then copy the key to be "HKLM\Software\Wow6432Node\CompanyX\ProductY_Fix".
I have a couple of questions: 1. How to detect if the target machine is 32 bit or 64 bit? 2. The "ProductY" key includes 5 entries, is there any easy way to copy the whole key instead of doing it one by one entry? I know a way to it for one entry: - detect the new key - if it doesn't exist, then query the old key, and then create the new key <Property Id='QUERY_PRODUCTY_LIB'> <RegistrySearch Id='QueryProductYKey' Root='HKCU' Key='Software\CompanyX\ProductY' Name='lib' Type='raw' /> </Property> <Property Id='DETECT_PRODUCTY_FIX'> <RegistrySearch Id='DetectProductYFix' Root='HKCU' Key='Software\CompanyX\ProductY_Fix' Type='raw' /> </Property> <Component Id="WriteRegKey" Guid="*"> <Condition>NOT DETECT_PRODUCTY_FIX and QUERY_PRODUCTY_LIB <> ''</Condition> <RegistryKey Root="HKCU" Key="Software\CompanyX\ProductY_Fix" Action="create" > <RegistryValue Type="string" Name='lib' Value='[QUERY_PRODUCTY_LIB]' KeyPath="yes" /> </RegistryKey> </Component> <ComponentRef Id="WriteRegKey" /> So is there an "easy way" that I can do it for the whole key once? Otherwise, I'll have to repeat these 25 lines of code multiple times. That is really error-prone. Based on the requirements we have, I'd think we'll have to end with 375 lines of coce((5+5+5) x 25 = 375) to deal with HKCU, HKLM, and HKLM\Software\Wow6432Node. But really, they are really identical code except the key entries are different such as 'lib', 'network', or 'key' etc. If there is a way to do it easily, please let me know. Also I'm stuck on how to detect if the machine is 32 bit or 64 bit. Many thanks. ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users