How to test for 64bit OS in MSI Code

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

How to test for 64bit OS in MSI Code

Postby iainmac1000 » Sat Jan 28, 2012 4:25 am

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

Postby giaviv » Sat Jan 28, 2012 10:41 am

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

Postby iainmac1000 » Thu Feb 02, 2012 5:19 am

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

Postby giaviv » Thu Feb 02, 2012 11:58 pm

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

Postby iainmac1000 » Fri Feb 03, 2012 2:57 am

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 7138 times
Main Script.jpg
Main Script.jpg (141.5 KiB) Viewed 7138 times

giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

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

Postby giaviv » Sun Feb 05, 2012 3:27 pm

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


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 69 guests