How to test for 64bit OS in MSI Code

Got a problem you cannot solve? Try here.
Post Reply
iainmac1000
Posts: 15
Joined: Sat Jul 09, 2011 2:43 am

How to test for 64bit OS in MSI Code

Post by iainmac1000 »

Hello,

I'm trying to build an installer that checks for 64bit Win 7 OS and installs the appropriate VC++ 9.0 redistributable. I've found the following on the forum but it doesn't describe how to define WIN64BIT. Any help greatly received. Using Installaware 9.0

Regards,
Iain....

How to test for 64bit OS in MSI Code

if Variable WIN64BIT Equals TRUE
Include Script: checknet20sp2_x64
Include Script: checkmsxml60_x64
Include Script: checknet30_x64
Include Script: checknet30sp2_x64
Include Script: checknet35sp1_x64
Include Script: checkvc91_x64
else
Include Script: checkmdac281
Include Script: checkmsi31
Include Script: checknet2sp2
Include Script: checkmsxml60
Include Script: checknet30
Include Script: checknet3sp2
Include Script: checknet351
end
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: How to test for 64bit OS in MSI Code

Post by giaviv »

Hi,

What you are missing is calling the Is Windows in 64 Bit Mode check before this script.
Call the Get System with the Is Windows in 64 Bit Mode option and out the result in WIN64BIT.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
iainmac1000
Posts: 15
Joined: Sat Jul 09, 2011 2:43 am

Re: How to test for 64bit OS in MSI Code

Post by iainmac1000 »

Thanks Aviv,

Getting there, but now receive following error:-

"Label Statements cannot be nested inside Loops/Conditionals"
in line Label: ScanVC91_x64 within checkvc91_x64 script

My code is as follows:-

Comment: Check that the OS is Windows 7 - 64bit
Set Variable WIN64BIT to FALSE
Get System Setting Windows in 64 bit Mode into WIN64BIT
If Variable WIN64BIT Equals TRUE
Include Script: checkmsxml60_x64
Include Script: checkmsi45_x64
Include Script: checkvc91_x64
Include Script: setupvc9_x64
Else
Include Script: checkvc91
Include Script: checkmsi31
Include Script: checkmsxml60
Include Script: checkvc9
End
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: How to test for 64bit OS in MSI Code

Post by giaviv »

Do you have a label defined anywhere? Try copying and pasting the code over.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
iainmac1000
Posts: 15
Joined: Sat Jul 09, 2011 2:43 am

Re: How to test for 64bit OS in MSI Code

Post by iainmac1000 »

Hello Aviv,

I've attached 2 screenshots of the code.
The error is actually in checkvc91_x64 on line 17. The system created this script file automatically.

Also included is the main script that I have edited to do a check fo 64 bit system.

The error appears when you try and run it on a 32bit PC??

Regards,
Iain...
Attachments
Label Error.jpg
Label Error.jpg (166.62 KiB) Viewed 9180 times
Main Script.jpg
Main Script.jpg (141.5 KiB) Viewed 9180 times
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: How to test for 64bit OS in MSI Code

Post by giaviv »

Hi,

I see - try using labels and goto to manipulate the flow of the installer instead - see this code:

Code: Select all

Comment: lines 1-5 are equivalent to lines 7-14
if Variable A Equals TRUE
 MessageBox: TRUE, TRUE
else
 MessageBox: FALSE, FALSE
end
 
if Variable A Equals TRUE
 GoTo Label: true_label
end
MessageBox: FALSE, FALSE
GoTo Label: finish
label: true_label
MessageBox: TRUE, TRUE
label: finish
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply