PDA

View Full Version : Recommended way of installing 32 and 64 bit versions of the same application.



Martin
11-14-2012, 10:17 AM
I am new to SetupBuilder and have the Developer Edition V7.7

The help page for the General Information/Generator/Installer Type states that I can use the 32/64-bit (Hybrid) installer to install the 64 bit version of my software on 64 bit systems and the 32 bit version of the same software on 32 bit systems. The help page does however give no clue on how to archive this.


I do not want to copy files from the script directly but I could not find a setup dialog where I could define such a condition for any file.


My current solution is:
I have three features defined :
Always Install => 32 and 64 bit
64bit => Install 64 bit version of the application
32bit => Install 32 bit version of the application

I have two Setup Types defined:
32bitSetup => Add the 32bit feature
64bitSetup => Add the 64bit feature

I do not want to ask the user to choose between 32bit and 64bit but I was not able to find "a GUI" way to select the proper setup based on the platform.


I found the function "Get System Info" somewhere on this forum and integrated the following code snipped:

----schnipp---

Set Variable %IS_64BIT% to FUNCTION:Get System Info(WOW64 Status)

If %IS_64BIT% Equals "1" Then
Set Active Setup Type to "64bitSetup"
Else
Set Active Setup Type to "32bitSetup"
End

---schnapp----

This seems to work so far.


Is there a better way, e.g. without script, to do this ?
Are there any drawbacks with this solution ?


Any help is appreciated.

Thanks
Martin

linder
11-15-2012, 01:29 AM
Martin,

Perfect! The code snippet is 100% correct. If you have set the installer type to "Hybrid", it will execute in x64 mode on 64-bit operating systems and your code will install the 64-bit files to the correct 64-bit location(s). On 32-bit operating systems it will install your 32-bit files.

Very well done!

Friedrich