Read registry error

Got a problem you cannot solve? Try here.
Post Reply
Ton_B
Posts: 115
Joined: Wed Nov 16, 2005 8:34 am
Location: Netherlands
Contact:

Read registry error

Post by Ton_B »

We are getting a strange error on a server while running our setup.

Looking on this forum, it seems "anchal.chitlangia" encountered the same problem on Wed Jul 28, 2010
see topic: http://www.installaware.com/forum/viewt ... f=2&t=5834

My code is like this:

Code: Select all

   Read Registry Key HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$TITLE$\DisplayVersion into CURRENTVERSION
Note: This key may- or may not be available and should return $NO$KEY if not available.
When I create the key manually, before running the setup, the error remains.


We've tested this on a virtual server, with windows 2008 server R2 64 bit and encountered no problems.
But today, on a server from one of our customers this problem accord.
This server is also a 2008 server (standard edition)

One thing that also got my attention on this particular machine is, the UAC-Administrator shield overlay was visible on the setup.exe
On no other machine over the past years this overlay was visible.
So, we've tried to toggle all of the available UAC properties, but with no success.
The error remains.

Please advice.
Ton Blokhuizen
Tooling Engineer
BMA BV - Netherlands
[i]BMA: leading the way in obstetrical data management
http://www.bma-mosos.nl[/i]
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Read registry error

Post by FrancescoT »

Dear Ton,

for what you say, your possible error doesn't have nothing to do with that post.
If I haven't missed your question, you are refering to a problem with Read Registry and not with Write Registry.

By the way it is very strange and I suppose that exist something else causing your issue.
The UAC elevation doesn't have any effect when reading from the registry and It could be the cause only if you are writing to.

Just with the information you supplied, it is not very easy to find out what could be the real cause.
Do you use any call to "Set x64 - Native 64 bit Windows" in your code?

Regards.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Ton_B
Posts: 115
Joined: Wed Nov 16, 2005 8:34 am
Location: Netherlands
Contact:

Re: Read registry error

Post by Ton_B »

Hello Francesco,

This is what I do:
(some irrelevant code left out)

Get System Setting Windows in 64 bit Mode into CHECKSYSTEM
if Variable CHECKSYSTEM Equals TRUE
Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
end

[some other code, such as prerequisits and uninstall here]

if Variable TARGETDIR Equals
Comment: === get previous installation location
Read Registry Key HKLM\$RegSubKey$\Microsoft\Windows\CurrentVersion\Uninstall\$PRODUCTCODE$\InstallPath into TARGETDIR
end

Read Registry Key HKLM\$RegSubKey$\Microsoft\Windows\CurrentVersion\Uninstall\$TITLE$\DisplayVersion into CURRENTVERSION
if Variable CURRENTVERSION Equals
Read Registry Key HKLM\$RegSubKey$\Microsoft\Windows\CurrentVersion\Uninstall\$PRODUCTCODE$\DisplayVersion into CURRENTVERSION
end


On the first attempt of reading the "CURRENTVERSION" (where the $TITLE$ is part of the key) is where it does go wrong.
Ton Blokhuizen
Tooling Engineer
BMA BV - Netherlands
[i]BMA: leading the way in obstetrical data management
http://www.bma-mosos.nl[/i]
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Read registry error

Post by FrancescoT »

Dear Ton,

I don't understand the sense of "Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64)" in your code.

Are you installing a native win 32 application on a x64 OS platform (if the case)?
If true, the above code is not necessary, due the fact that the installer package runs as win 32 by dafault ... even on x64 platform.

then, why you are not using the product code with your first attempt to read the reg key?

Let me know.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Ton_B
Posts: 115
Joined: Wed Nov 16, 2005 8:34 am
Location: Netherlands
Contact:

Re: Read registry error

Post by Ton_B »

Let me think,

Setting the WOW64 installation mode is something I've build in a long time ago.
Don't know exactly why. I believe it has something to do with making the setup 32 as well 64 bits compatible, something I've probably read on the forum :)
but you probably can tell me more about it.

And yes, we are installing 32 bits software, on a 32 or 64 bit's machine, using one setup.

The answer to your second question ..... and again you are asking me to dig in to my memory ha ha.
That has to do with old software from our company.
The setup creating this key was made with another kind of setup-tool and did not create a GUID as refrence.
But we want to be able to get the properties of that version from the registry.

Does this make any sense to you?

I'm really curious why I should't use the WOW64 installation mode ?
Ton Blokhuizen
Tooling Engineer
BMA BV - Netherlands
[i]BMA: leading the way in obstetrical data management
http://www.bma-mosos.nl[/i]
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Read registry error

Post by FrancescoT »

Dear Ton,
Setting the WOW64 installation mode is something I've build in a long time ago.
Don't know exactly why. I believe it has something to do with making the setup 32 as well 64 bits compatible, something I've probably read on the forum
but you probably can tell me more about it.

And yes, we are installing 32 bits software, on a 32 or 64 bit's machine, using one setup.
There is no need to set it if you are installing native 32 bit components ... it is already in 32 bit mode by default.
It can be used for example, when you install a native 64 bit component and then you need to switch back to 32 bit for the components that are not.
As example, I suggest you to have a look at any x64 runtime script available with InstallAware.
The answer to your second question ..... and again you are asking me to dig in to my memory ha ha.
That has to do with old software from our company.
The setup creating this key was made with another kind of setup-tool and did not create a GUID as refrence.
But we want to be able to get the properties of that version from the registry.

Does this make any sense to you?
Yes, it makes sense.
But if the key exist and you are not able to find it ... I suggest you to verify if the key you are using is not erroneously misspelled.
It must work!

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Ton_B
Posts: 115
Joined: Wed Nov 16, 2005 8:34 am
Location: Netherlands
Contact:

Re: Read registry error

Post by Ton_B »

There is no need to set it if you are installing native 32 bit components ... it is already in 32 bit mode by default.
Ok, that's clear.
But does it have nothing to do with the error I'm getting?
But if the key exist and you are not able to find it ... I suggest you to verify if the key you are using is not erroneously misspelled.
It must work!
unfortunately the name and full path are spelled correctly.
I've been using this line of code for some time now, and suddenly this error comes up on a server at our customer.
I've even made the key manually so I was sure the key existed.

I'm wondering what is going wrong.
Ton Blokhuizen
Tooling Engineer
BMA BV - Netherlands
[i]BMA: leading the way in obstetrical data management
http://www.bma-mosos.nl[/i]
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Read registry error

Post by FrancescoT »

Dera Ton,

honestly, I use the Read Registry command very often with my projects and I never found any problem.

By the way, if I have not missed anything, seems that your issue happens with a particular machine only.
Because of this, are you sure that doesn't exist something that is blocking occasionally your package ( ... as for example an Antivirus)?

Regards
Francesco Toscano
InstallAware Software

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