More details on \"Set 64 Bit Mode\" command

Got a problem you cannot solve? Try here.
wolbrink
Posts: 76
Joined: Wed Nov 17, 2004 3:00 pm

More details on \"Set 64 Bit Mode\" command

Post by wolbrink »

Is "Set 64 Bit Mode" a special MSI command? Or does this command immediately turn off WOW64 file/registry redirection?

For example, if in one portion of the script, I'd like to read from the 64-bit (non-redirected) portion of the registry, would the "Set 64 Bit Mode" command enable me to do this?

Would I just:

Set 64 Bit Mode (x64) // turn off redirection
Read Registry...
Set 64 Bit Mode (x86) // back to normal

Thanks,
Troy
rasmusw
Posts: 44
Joined: Tue May 19, 2009 3:06 am

Post by rasmusw »

Yes, it works as you describe in your sample.

Note that the IA default scripts for e.g. .net framework x64 will stop the installation when the installer is run on x86.
If you want to make a single installer which includes both x64 and x86 versions of those runtimes, you need to make changes in both versions.
wolbrink
Posts: 76
Joined: Wed Nov 17, 2004 3:00 pm

Post by wolbrink »

rasmusw wrote:Yes, it works as you describe in your sample.
Thanks. Just to confirm: It's NOT a special MSI command? It immediately turns off WOW64 file/registry redirection?

--Troy
rasmusw
Posts: 44
Joined: Tue May 19, 2009 3:06 am

Post by rasmusw »

wolbrink wrote:Just to confirm: It's NOT a special MSI command? It immediately turns off WOW64 file/registry redirection?
That I don't know. Maybe somebody from IA can explain?
neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK

Post by neillans »

Correct -- it is not a special MSI command, and actually is a dll inserted that calls the redirection APIs
Andy Neillans
martinb
Posts: 3
Joined: Tue Feb 02, 2010 4:52 am

Re: More details on \"Set 64 Bit Mode\" command

Post by martinb »

We have encountered a problem with the Set 64 Bit Mode:

On a virtualized Windows 2008 x64 Enterprise, the follwing script does not work:

Code: Select all

Set 64 Bit Mode (x64) // turn off 
Write Registry...
Set 64 Bit Mode (x86) // back to normal 
The Registry value does not get written to the 64-bit branch of the registry. More exactly, it does not get written at all.

Info: The installer is a 32-bit installer and we try to switch to 64-bit mode to write to the 64-bit branch of the registry. Setup is started with admistrator rights.

Is this a bug ?

Any help is greatly appreciated.
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: More details on \"Set 64 Bit Mode\" command

Post by mills »

Write registry (and all pinkish commands) will not be run until Apply Install (Apply Changes). In fact, it's the Apply Install that you want to set the 64 bit mode on.

The following should do the trick:

Code: Select all

Write Registry Key HKLM\SOFTWARE\test\test, test
Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
Apply Install
Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation 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.
martinb
Posts: 3
Joined: Tue Feb 02, 2010 4:52 am

Re: More details on \"Set 64 Bit Mode\" command

Post by martinb »

mills wrote:Write registry (and all pinkish commands) will not be run until Apply Install (Apply Changes). In fact, it's the Apply Install that you want to set the 64 bit mode on.
The following should do the trick:

Code: Select all

Write Registry Key HKLM\SOFTWARE\test\test, test
Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
Apply Install
Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
Thank you.

One more question: I'v read in other posts, that calling apply install twice could mess up the uninstall process. Do you see any problems here ?
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: More details on \"Set 64 Bit Mode\" command

Post by mills »

Generally, you should only need to call Apply Install once. The pinkish commands do stack to the windows installer. So, the second Apply Install call will apply any pinkish MSI commands that were called in the first Apply Install, because a list is basically generated in the MSI table. There's no sense in duplicating that work...

In my example, I added a second Apply Install after the switch back to 32-bit mode. That effectively created another entry under the wow6432Node tree. However, that was the entry that was removed during Uninstall (not the initial, 64-bit entry; it still remained).

If you realize a need to run multiple Apply Installs, what seems to be the most common approach is to create unique installers for each set of commands you want to run under a give Apply Install, treating them as individual "products" (i.e. make sure product codes don't match). From your main installer, you can call the other installers with Run Program and run them silently.
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.
martinb
Posts: 3
Joined: Tue Feb 02, 2010 4:52 am

Re: More details on \"Set 64 Bit Mode\" command

Post by martinb »

Now I think I do understand the approach. Thanks for explaining ! :D
KevinTX
Posts: 23
Joined: Thu Aug 05, 2010 10:47 am

Re: More details on \"Set 64 Bit Mode\" command

Post by KevinTX »

mills wrote: If you realize a need to run multiple Apply Installs, what seems to be the most common approach is to create unique installers for each set of commands you want to run under a give Apply Install, treating them as individual "products" (i.e. make sure product codes don't match). From your main installer, you can call the other installers with Run Program and run them silently.
What if my 64-bit app installer needs to write some registry key/value in WOW6432NODE (and also in the normal one)? In this case, I would still need to call APPLY INSTALL twice, right?

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

Re: More details on \"Set 64 Bit Mode\" command

Post by mills »

Yes, you will need to make 2 calls.

I ran a test, to see if two calls to Apply Uninstall would clear up the distinct bit-mode calls. It didn't work.

For the cleanest installation (and uninstall) of the 64bit and 32bit work, you'll need 2 installers.

I created one called 64bitWork. The first line I set to

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

The only work it does is:

Write Registry Key HKLM\SOFTWARE\test\test, test64

Nothing else was changed.

I created a second installer called 32bitWork and added 64bitWork.exe as an installable file.

It writes an entry to registry (in wow6432Node) and also calls the 64bitWork installer.

Its code looks like this:
code.jpg
code.jpg (151.73 KiB) Viewed 32802 times
It's important to call the other installer after the apply install and before the apply uninstall

I verified both registry entries were properly installed and uninstalled when the 32bitWork (parent) installer was installed/uninstalled.
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.
KevinTX
Posts: 23
Joined: Thu Aug 05, 2010 10:47 am

Re: More details on \"Set 64 Bit Mode\" command

Post by KevinTX »

Thank you for the detailed explanation and the code example. This is very helpful.

Have a nice weekend.
KevinTX
Posts: 23
Joined: Thu Aug 05, 2010 10:47 am

Re: More details on \"Set 64 Bit Mode\" command

Post by KevinTX »

Hello Andy,

I have one more question on the example you provided. How do I prevent both program from appearing in the Windows Add and Remove Program list. I only want one of them (the one that installs the real product) to appear in the Windows Add and Remove Program list.

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

Re: More details on \"Set 64 Bit Mode\" command

Post by mills »

I haven't tested it, but you may be able to remove a key from the registry. See:
http://www.annoyances.org/exec/show/article05-009

I'm not sure if that will prevent you from properly uninstalling the product that you don't want to appear in add/remove programs. You may have to resort to "manual" deletions.
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.
Post Reply