Check registry fails on Windows 7 x64

Got a problem you cannot solve? Try here.
Alex1971
Posts: 10
Joined: Tue Nov 23, 2010 2:19 am

Check registry fails on Windows 7 x64

Postby Alex1971 » Tue Nov 23, 2010 2:31 am

I try to locate an old installshield installation of my application by checking a registry entry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName

This works fine on Windows 7 32 bit, but it returns NO$KEY in x64.
When I open regedit on the x64 windows 7 I see the entry exists.

I set my installation to x64 installation mode.

How can I access the key correctly in x64?

Alexander

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Check registry fails on Windows 7 x64

Postby mills » Fri Nov 26, 2010 2:20 pm

What version of InstallAware are you using?
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

Alex1971
Posts: 10
Joined: Tue Nov 23, 2010 2:19 am

Re: Check registry fails on Windows 7 x64

Postby Alex1971 » Mon Nov 29, 2010 12:38 am

I'm using version InstallAware Studio 10.

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Check registry fails on Windows 7 x64

Postby mills » Tue Nov 30, 2010 1:39 pm

If your product is 32-bit software, you should keep your installer in 32-bit mode.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName

should appear as:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName

in Win7 x64...

This redirection is automatically made for you if you leave your installer in 32-bit mode.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

Alex1971
Posts: 10
Joined: Tue Nov 23, 2010 2:19 am

Re: Check registry fails on Windows 7 x64

Postby Alex1971 » Wed Dec 01, 2010 12:27 am

I tried this registry path also, with the installer in 32 bit mode.
It is not working. Check registry returns NO$KEY.
What puzzles me is the fact that the path exists when I look at it with regedit.exe ...

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Check registry fails on Windows 7 x64

Postby mills » Wed Dec 01, 2010 2:06 pm

So, in x64, the actual key appears at:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName

And not in the Wow6432Node?

If that's the case, then it should be read in 64-bit mode.

Perhaps, could you try to write a test value to that location and try to read it back or see where it appears in regedit?
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

Alex1971
Posts: 10
Joined: Tue Nov 23, 2010 2:19 am

Re: Check registry fails on Windows 7 x64

Postby Alex1971 » Thu Dec 02, 2010 1:46 am

Yes, that's right.

The registry-entry I want to check comes from an installshield installation which was made in x64 mode. But the origin of the entry should not be of any importance.

I did your proposed test and wrote a reg value.
When I write a registry value with installaware in x64 mode to the same path, it is redirected to the Wow6432Node. (Why? I'm in x64 mode ...)

So it seems that installaware has a problem with reading the registry values on a 64 bit machine. Where else should the entry be if not in the given two paths("normal" and Wow6432Node) ?

I do my tests on a VMware virtual machine.

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Check registry fails on Windows 7 x64

Postby mills » Thu Dec 02, 2010 3:51 pm

It seems to work fine for me.

How are you creating the project?

I'm attaching a test project I created. This was created in IA 10 and it uses the Native Setup template.

I added this to line 2:

Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode

Then, during install, I made changes to write to registry, then read it and display:

Comment: Install/Re-Install product
Write Registry Key HKLM\SOFTWARE\test\test, testData
Create Shortcut $SHORTCUTFOLDER$\Uninstall #TITLE# to $UNINSTALLLINK$
[OFFLINE CONTENT]
[DEFINE WEB MEDIA regTest]
Get Component regTest Selection State into Variable SELECTED
if Variable SELECTED Equals TRUE
end
Comment: TO-DO: Insert any additional install commands here
[compiler if Variable BUILDMODE Equals PATCH]
Apply Patch (get result into variable SUCCESS)
[compiler else]
if Variable ADVERTISE Equals TRUE
Apply Advertised (get result into variable SUCCESS)
else
Apply Install (get result into variable SUCCESS)
Read Registry Key HKLM\SOFTWARE\test\test into regTest
MessageBox: regTest, Read Registry Key HKLM\SOFTWARE\test\test$NEWLINE$$NEWLINE$Result:$NEWLINE$$regTest$
end


The project is attached for you to test/examine...
Attachments
regTest.7z
(196.53 KiB) Downloaded 954 times
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

Alex1971
Posts: 10
Joined: Tue Nov 23, 2010 2:19 am

Re: Check registry fails on Windows 7 x64

Postby Alex1971 » Fri Dec 03, 2010 1:57 am

I created my project by using the installshield converter, and then making the necessary changes by hand.

I tried your test and it works fine for me also.
What you did in your test installation is the same I did in my installation. But it is not working within mine.
When checking my registry key path from your test project, this also works. So, in general check/read registry works.
I suppose it is something within the logic of the installation engine which causes the check/read registry to fail within my installation, which does some other things also.

I had a similar problem with USB drivers I want to install in 32 bit or 64 bit version (my installation is intended as a hybrid installation for 32 and 64 bit), which I install conditionally depending on the platform (32 or 64 bit)
The drivers did not install for both platforms, so I had to create separate installations for the drivers only, which I call silently from within my main installation...

Alex1971
Posts: 10
Joined: Tue Nov 23, 2010 2:19 am

Re: Check registry fails on Windows 7 x64

Postby Alex1971 » Mon Dec 13, 2010 12:01 am

So, any more ideas or am I stuck with this problem here?

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Check registry fails on Windows 7 x64

Postby mills » Mon Dec 13, 2010 2:51 pm

We need more info to determine what the problem could be.

In the problem project, are you seeing multiple registry checks fail or only one?

Some insight into how your are separating the 32 and 64 bit portions of your installer could be helpful.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

Alex1971
Posts: 10
Joined: Tue Nov 23, 2010 2:19 am

Re: Check registry fails on Windows 7 x64

Postby Alex1971 » Tue Dec 14, 2010 1:35 am

I'm posting my script code so you can take a look at it.
Attachments
ExPresso.mia.zip
(27.59 KiB) Downloaded 898 times

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Check registry fails on Windows 7 x64

Postby mills » Tue Dec 14, 2010 3:29 pm

Code: Select all

Read Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION
Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION
Read Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION

Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName, Test (permanent)
Check Registry Key HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION
MessageBox: , $OLDINSTALLATION$
if Variable OLDINSTALLATION Contains ExPresso
Display Dialog: OldInstallationDetected, wait for dialog to return (modal)
  Terminate Installation
end


A couple things worth pointing out... The purple commands (write registry) will not be applied until Apply Install (although the write/reads above don't match, I just wanted to make sure that's known).

You would probably want to put the above code ahead of the pre-requisite section or what you could happen is, if one of the pre-requisites was not installed for whatever reason and then it was attempted to install this version (and the old one still existed), it would force you to install the pre-requisite(s) before being told the old version already exists.

Otherwise, it looks like you're trying to check for:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName

If I manually set that key in the registry (not in Wow6432Node) and modified your script to look like (same section):

Code: Select all

Read Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION
Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION
MessageBox: , $OLDINSTALLATION$
Read Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION
Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName, Test (permanent)
Check Registry Key HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION
MessageBox: , $OLDINSTALLATION$


The first messagebox displays the correct DisplayName, the second displays No$key.

I'm not sure if this helps you at all, but if not, it could help to clarify the problem definition; what you're trying to do (code), what is the expected behavior and what is actual.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

Alex1971
Posts: 10
Joined: Tue Nov 23, 2010 2:19 am

Re: Check registry fails on Windows 7 x64

Postby Alex1971 » Wed Dec 15, 2010 7:36 am

Actually, my code looks like this (in your post the out-commented lines were displayed as active lines):

Code: Select all

Comment: Read Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION
Comment: Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION
Read Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION

Comment: Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName, Test (permanent)
Comment: Check Registry Key HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName into OLDINSTALLATION
MessageBox: , $OLDINSTALLATION$
if Variable OLDINSTALLATION Contains ExPresso
Display Dialog: OldInstallationDetected, wait for dialog to return (modal)
  Terminate Installation
end


So right, what I'm trying to do is checking for the existance of this registry key:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7548C7BF-0B5E-4E3D-BE0F-DA08DE023EF9}\DisplayName

But it is not working on my side, even if i create the registry entry manually, like you did.

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Check registry fails on Windows 7 x64

Postby mills » Fri Dec 17, 2010 7:10 pm

Is your setup in 32 or 64 bit mode at the time of that check you run?
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 33 guests