Many of InstallShield developers has a doubt of how to add registry to 64 bit area using IstallScript function in InstallShield.
If our installer is 32bit EXE, and if we are installing this installer on 64 bit machine, then all RegDB functions points to Wow6432Node registry area. But many of times we have to add registry to 64 bit area using 32 bit installer. So how we can achieve this ?
For e.g. If I'm executing following code in InstallScript.
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegDBCreateKeyEx("SOFTWARE\\XYZ", "");
I want to add this registry entry under HKLM\SOFTWARE\XYZ
. But this entry gets added under HKLM\SOFTWARE\Wow6432Node\XYZ
.
Then what is the solution to add this registry under 64 bit area?
There are two solutions to achieve this scenario.
First solution is,
We can create component, make it 64 bit and we will add registry entry under it in InstallShield.
Second solution is,
If we want to add registry which is independent of any component then we can use REGDB_OPTIONS
.
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
REGDB_OPTIONS = REGDB_OPTION_WOW64_64KEY;
RegDBCreateKeyEx("SOFTWARE\\XYZ", "");
This will add registry to 64 bit area.