Creating a single package for x64 & x86

Got a problem you cannot solve? Try here.
Post Reply
shanep
Posts: 14
Joined: Thu Feb 03, 2011 2:26 am

Creating a single package for x64 & x86

Post by shanep »

Hi there,

One of the selling points I liked with InstallAware was the ability to create a single package for both x64 & x86. Yet I dont have a clue how to do it.

I have a .net 4 wpf application that requires sql ce4.

How do I create an install package that automatically checks what type of OS the user has and installs the correct version of the requirements?

If I click on the x86 & 64 .net requirements and SQL CE 4 and build the package. Deploying fails due to trying to install the other version.

Does this have to be scripted?
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Creating a single package for x64 & x86

Post by giaviv »

Hi shanep,

This is actually extremely simple. You can get whether the user is running a 64Bit machine using the Get System Settings command on the Is Windows in 64 Bit Mode capability. Insert the result into the variable ISWINDOWS64BIT.

Then, add both the x86 and x64 versions of your runtimes. Scroll down your MSIcode and find where InstallAware emitted the Include Script command for the runtime scripts. There will be 4 such scripts - 2 check scripts, x86 and x64, and 2 setup scripts, x86 and x64.
Wrap each set of scripts with an if / else block like so:

If Variable ISWINDOWS64BIT Equals TRUE
Include Script check.....x64
Else
Include Script check.....x86
End

.....and then later

If Variable ISWINDOWS64BIT Equals TRUE
Include Script setup.....x64
Else
Include Script setup.....x86
End
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
shanep
Posts: 14
Joined: Thu Feb 03, 2011 2:26 am

Re: Creating a single package for x64 & x86

Post by shanep »

Thanks Giaviv,

That points me in the right direction. But i am having problems trying to add the if else statements

I have found the area in the script that has

[DEFINE WEB MEDIA Microsoft SQL Server Compact Edition 4.0 (x64)]
Include Script: setupsqlcompact4_x64

I have created the variable for the 64bit enviroment ok

How am I meant to add the
If Variable ISWINDOWS64BIT Equals TRUE
Include Script check.....x64
Else
Include Script check.....x86
End

I try to type the if statement however if I click to a new line or press enter the statement is been lost.

No matter what I try to do I cant seem to get it to work.
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Creating a single package for x64 & x86

Post by giaviv »

To insert a new command, select the desired line (even if it is not empty - the old line will be moved down) and start typing the name of the command (El...).
When InstallAware autocompletes your input, press enter and that should do it. Your code should look like this:

If Variable ISWINDOWS64BIT Equals TRUE
Include Script: setupsqlcompact4_x64
Else
Include Script: setupsqlcompact4_x86
End
........
If Variable ISWINDOWS64BIT Equals TRUE
[DEFINE WEB MEDIA Microsoft SQL Server Compact Edition 4.0 (x64)]
Include Script: setupsqlcompact4_x64
Else
[DEFINE WEB MEDIA Microsoft SQL Server Compact Edition 4.0 (x86)]
Include Script: setupsqlcompact4_x86
End
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
shanep
Posts: 14
Joined: Thu Feb 03, 2011 2:26 am

Re: Creating a single package for x64 & x86

Post by shanep »

Ignore that.
I was trying to write the script by hand. turns out you have to use the drag and drop feature on the right.
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Creating a single package for x64 & x86

Post by giaviv »

You can actually do both :)
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