Reading Reg_Multi_Sz values in 64 bit registry

Got a problem you cannot solve? Try here.
Post Reply
Chris_DMG
Posts: 30
Joined: Tue Nov 02, 2010 8:09 am

Reading Reg_Multi_Sz values in 64 bit registry

Post by Chris_DMG »

I have encountered an interesting problem with reading a registry key with a type of REG_MULTI_SZ inside InstallAware 9 R2.
When I read that type from the 32 bit hive (Wow6432Node) the Check Registry function returns the information as a $NEWLINE$ delimited string value, but if I try reading from the 64 bit registry the Check Registry function returns UNKNOWN$TYPE.

To add to the confusion if there is a node inside the Wow6432Node with the same path and value name as the 64 bit node I am trying to check the function returns the value from that 32 bit entry instead. This is rather irritating as I need the entries in the 64 bit node and will then check the data from the 32 bit node afterwards as a client's system may have both 64 bit and 32 bit instances of SQL Server installed.

I tested this both using HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\InstalledInstances
and I also created my own Test key under HKLM\Software with a value type REG_MULTI_SZ and receive the same UNKNOWN$TYPE result.

If I try using the Read Registry function instead the return value is an empty string, or in the case of matching 32 bit node the value from there instead.

I am using Windows Server 2008 64 bit system.
InstallAware 9 R2 (Build Moya.sp2.052710)

Some test script code I have put together in which the error occurs:

Code: Select all

~InstallAware Clipboard Data~
~MessageBox~
~{497864F8-C3CC-427D-8788-5C2321B44A65}~
~Check~
~$SQL_Check$~
~0~
~1~
~~
~Check Registry~
~{B8FB1091-EBB2-483E-BB18-26342C51554A}~
~SQL_Check~
~2~
~SOFTWARE\Microsoft\Microsoft SQL Server~
~InstalledInstances~
~Set 64 Bit Mode~
~{41F0B948-52D9-4BDF-B46C-6883A2DD9498}~
~FALSE~
~FALSE~
~TRUE~
If anyone could shed some light on why InstallAware can't read these entries from the 64 bit registry it would be great.

Thank you,
Chris
Chris_DMG
Posts: 30
Joined: Tue Nov 02, 2010 8:09 am

Re: Reading Reg_Multi_Sz values in 64 bit registry

Post by Chris_DMG »

Has no one else encountered this behavior before? This is holding me up as I cannot write my own DLL implementation as InstallAware is unable to call 64 bit DLL's. I checked out the RegistryEx plug-in, but it also fails as a solution because it only reads the 32 bit node of the 64 bit system's registry.

Thank you,
Chris
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Reading Reg_Multi_Sz values in 64 bit registry

Post by giaviv »

Dear Chris,

When I read the value from:
SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\InstalledInstances
I can read the correct value.
When I read:
SOFTWARE\Microsoft\Microsoft SQL Server\InstalledInstances
I get an error, because this doesn't exist (I can't see it in regedit either).
Is this different from what you are experiencing?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Chris_DMG
Posts: 30
Joined: Tue Nov 02, 2010 8:09 am

Re: Reading Reg_Multi_Sz values in 64 bit registry

Post by Chris_DMG »

You must have a 64 bit version of SQL server installed I think for the correct 64 bit registry node to exist. If you are using a 64 bit OS, but a 32 bit SQL server I think the Wow6432Node is the only on that gets populated.

This is the behavior I am seeing on our lab systems here. My 64 bit SQL server is the only one listed in the
SOFTWARE\Microsoft\Microsoft SQL Server\InstalledInstances
path, while the 2 32 bit instances I have installed are stored in the
SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\InstalledInstances

Note you can reproduce the error by just creating some random test node i.e.

HKLM\Software\Test64 then in the test key create a new multi-string value.
Then in InstallAware try using the Check Registry for that path. I get the UNKNOWN$TYPE error returned that way. This isn't just the SQL Server node I am having issue with, it seems to be every multi-size value that only exists in the 64 bit section.

Thank you for your response, I hope this makes it a litle more clear so you can hopefully reproduce this issue.
Chris
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Reading Reg_Multi_Sz values in 64 bit registry

Post by giaviv »

Dear Chris,

Please run the attached .reg file (inside the zip).
Then, run the following script from InstallAware:

~InstallAware Clipboard Data~
~MessageBox~
~{479BD449-3971-4643-B00B-43D7DCA03B9F}~
~Result~
~$REG$~
~0~
~1~
~~
~Check Registry~
~{B1854FE4-8D0B-4F4A-9069-046B62BE95E1}~
~REG~
~2~
~Software\InstallAwareTest~
~Key1~
~Set 64 Bit Mode~
~{6003BB57-EC45-4991-A00E-7F445732C754}~
~FALSE~
~FALSE~
~TRUE~

Let me know what the message box shows please.
Attachments
test.zip
(228 Bytes) Downloaded 397 times
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Chris_DMG
Posts: 30
Joined: Tue Nov 02, 2010 8:09 am

Re: Reading Reg_Multi_Sz values in 64 bit registry

Post by Chris_DMG »

The result is still displayed as UNKNOWN$TYPE
Attachments
InstallAwareTest.png
InstallAwareTest.png (28.69 KiB) Viewed 11223 times
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Reading Reg_Multi_Sz values in 64 bit registry

Post by giaviv »

Dear Chris,

Thank you. I am looking into this and will keep you posted.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Reading Reg_Multi_Sz values in 64 bit registry

Post by giaviv »

Dear Chris,

Please download IA 10's trial and install it on your machine - try to read the registry the way I advised earlier and let me know what happens.
If it fails, there's a problem with your machine. If not, let me know please as this might be a bug specific to IA 9 R2 alone - thank you for your cooperation!
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Chris_DMG
Posts: 30
Joined: Tue Nov 02, 2010 8:09 am

Re: Reading Reg_Multi_Sz values in 64 bit registry

Post by Chris_DMG »

Will I be able to install InstallAware 10 without affecting my existing IA9 installation? Thank you
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Reading Reg_Multi_Sz values in 64 bit registry

Post by giaviv »

Dear Chris,

You will be forced to uninstall IA9. I am sorry, but I am unable to reproduce this on either 10 or 10.10. I am curious as to whether this is a bug with IA 9 R2 or a problem with your machine. As a work-around, consider using the reg.exe application through the Run Program command.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Chris_DMG
Posts: 30
Joined: Tue Nov 02, 2010 8:09 am

Re: Reading Reg_Multi_Sz values in 64 bit registry

Post by Chris_DMG »

I was able to reproduce the problem installing IA9 on the lab system to ensure it was not specific to my development system.

Next I did download and install IA 10 on that lab system and that does work for reading the value from the registry, both the test location and the original SQL Server data I was working on.

So this is apparently a defect in version 9.
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Reading Reg_Multi_Sz values in 64 bit registry

Post by giaviv »

Dear Chris,

This indeed sounds like a problem with version 9 R2. I strongly advise you to upgrade to 10.10!
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply