How to differentiate between Windows 32 bits and 64 bits?

Answered

Comments

1 comment

  • Avatar
    Jake

    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>
    

Please sign in to leave a comment.