Thanks Blair.

I never used foreach.. I'll try that.



________________________________
From: Blair <os...@live.com>
To: General discussion for Windows Installer XML toolset. 
<wix-users@lists.sourceforge.net>
Sent: Wed, August 4, 2010 7:54:22 AM
Subject: Re: [WiX-users] How to copy registry subkey which includes someentries

As to the "long way", you may find using the <?for?> preprocessor construct
helpful to ease the code maintenance required.

-----Original Message-----
From: David Watson [mailto:dwat...@sdl.com] 
Sent: Wednesday, August 04, 2010 3:56 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] How to copy registry subkey which includes
someentries

Hi,
    It looks like you will only need to do the HKLM code once, if
you write it for the 32 bit version and your msi is 32 bit it will
automatically be redirected by windows to the Wow6432Node on 64 bit
operating systems.

As for the easy way sadly there is none if you don't want to write a
custom action.

Dave

-----Original Message-----
From: Pally Sandher [mailto:pally.sand...@iesve.com] 
Sent: 04 August 2010 11:40
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] How to copy registry subkey which includes
someentries

1 - http://msdn.microsoft.com/en-us/library/aa372497.aspx
2 - Nope you'll have to do it the long way.

You'll need 2 MSI's if you want to access the 64-bit areas of the
registry on x64 platforms. MSI's are platform architecture specific.

Palbinder Sandher
Software Deployment & IT Administrator
T: +44 (0) 141 945 8500
F: +44 (0) 141 945 8501 

http://www.iesve.com
**Design, Simulate + Innovate with the <Virtual Environment>**
Integrated Environmental Solutions Limited. Registered in Scotland No.
SC151456
Registered Office - Helix Building, West Of Scotland Science Park,
Glasgow G20 0SP Email Disclaimer

-----Original Message-----
From: little.forest [mailto:little.for...@ymail.com]
Sent: 04 August 2010 01:28
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] How to copy registry subkey which includes some
entries

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



------------------------------------------------------------------------
------
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
</pre>
<BR style="font-size:4px;">
<a href = "http://www.sdl.com";><img src="http://www.sdl.com/images/email
logo_150dpi-01.png" alt="www.sdl.com" border="0"/>
<BR>
<font face="arial"  size="2" "><a href = "http://www.sdl.com";
style="color:005740; font-weight: bold">www.sdl.com
<BR>
<BR>
<font face="arial"  size="1" color="#736F6E">
<b>SDL PLC confidential, all rights reserved.</b>
If you are not the intended recipient of this mail SDL requests and requires
that you delete it without acting upon or copying any of its contents, and
we further request that you advise us.<BR>
SDL PLC is a public limited company registered in England and Wales.
Registered number: 02675207.<BR>
Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire SL6
7DY, UK.
</font>



----------------------------------------------------------------------------
--
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


------------------------------------------------------------------------------
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


------------------------------------------------------------------------------
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

Reply via email to