How to differentiate between Windows 32 bits and 64 bits?

asked 13 Sep '11, 05:16

Jake's gravatar image

Jake ♦♦
796222226235
accept rate: 98%


The BitRock InstallBuilder executable and the generated installers are 32 bits applications. When a 32 bits application runs on a 64 bits version of Windows, a number of settings are enabled for backward compatibility reasons, as described in:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win64/win64/wow64_implementation_details.asp

It is possible to check whether the installer is being run in a 64 bits of versions by testing to see if the environment variable PROGRAMW6432 exists. For example, you can place the following in the <initializationActionList> section of your project file. It will show a warning if running on win32 or do nothing if running on Windows64:

<showWarning text="Running on Windows 32">
<ruleList>
 <compareText text="${env(PROGRAMW6432)}" value="" logic="equals" />
</ruleList>
</showWarning>

You may also want change the default value in the installdir parameter of your 64bit installer to the 64bit one, you can do it with:

<setInstallerVariable name="installdir" value="${env(PROGRAMW6432)}/My Program Name">
<ruleList>
 <compareText text="${env(PROGRAMW6432)}" value="" logic="does_not_equal" />
</ruleList>
</setInstallerVariable>
link

answered 13 Sep '11, 05:18

Jake's gravatar image

Jake ♦♦
796222226235
accept rate: 98%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5
×4
×3
×1
×1
×1

Asked: 13 Sep '11, 05:16

Seen: 2,555 times

Last updated: 04 Aug '12, 22:18