32 and 64 bit Runtime Requirements

Got a problem you cannot solve? Try here.
garyhalb
Posts: 29
Joined: Fri Apr 30, 2010 12:55 am

32 and 64 bit Runtime Requirements

Postby garyhalb » Fri Oct 01, 2010 4:33 am

Hi,

Please could you assist with my understanding of how to create a setup that works fine on both 32 and 64 bit operating systems.

My only requirement is that when a user attempts to install on a 64 bit platform, the required 64 bit runtimes must be included in the installer. My actual application will run in Wow64 mode, but things like SQL Express 2008 R2 need 64 bit specific setups. Am I meant to tick both the x86 and x64 runtimes in the Runtimes section to support this? If I do this, will IA automatically determine which of the runtimes to use?

Thanks,
Gary

Obliterator
Posts: 53
Joined: Fri May 01, 2009 11:54 am

Re: 32 and 64 bit Runtime Requirements

Postby Obliterator » Fri Oct 01, 2010 5:19 am

It would be nice if the inbuilt runtime scripts supported this out of the box.
But actually its pretty straightforward to workaround - you just have to do a little manual tweaking.

You need to add code to check the system type and enable 64bit mode when appropriate.
You then tick both the 32 and 64 bit runtimes for the components you need.
Then edit the script that gets created and reorder the runtimes into 3 blocks (common, 64bit only and 32bit only).
Then simlpy conditionally check the system type and run the scripts that are required.
Finally re-apply the 64bit mode again as some scripts revert back to 32bit mode.

Also pay attention to some components (like sql) - on a 64bit sytem they require both 32bit and 64bit parts to be installed.
Here's an example bit of code below which might help:

Determine if running on a 64-bit system (add to begining of your script):
Set Variable ISWINDOWS64BIT to FALSE
Get System Setting Windows in 64 bit Mode into ISWINDOWS64BIT
Set Variable PROCESSORARCH to UNKNOWN
Get System Setting Processor Architecture into PROCESSORARCH


Group you runtime checks accordingly (add to Check required runtimes block):
Comment: Universal pre-requisites
Include Script: checkmsi31
Comment: SQL Compact x86 must be installed on all systems (even x64 - prior to the x64 install!)
Include Script: checksqlcompactsp2

if Variable ISWINDOWS64BIT Equals TRUE
Comment: x64 pre-requisites
Include Script: checksqlcompactsp2_x64
Include Script: checknet4client_x64
else
Comment: x86 pre-requisites
Include Script: checknet4client_x86
end


Set 64 bit mode if appropriate (add after your check runtime section above):
if Variable ISWINDOWS64BIT Equals TRUE
if Variable PROCESSORARCH Equals AMD64
Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
end
if Variable PROCESSORARCH Equals IA64
Set Itanium ia64 - Native 64 bit Windows, Intel Itanium Architecture - installation mode
end
end

Edit which requisites are setup according to system type:
Comment: Universal runtimes
[DEFINE WEB MEDIA Microsoft Windows Installer 3.1]
Include Script: setupmsi31
Comment: SQL Compact x86 must be installed on all systems (even x64 - prior to the x64 install!)
[DEFINE WEB MEDIA Microsoft SQL Server Compact Edition 3.5 Service Pack 2]
Include Script: setupsqlcompactsp2

if Variable ISWINDOWS64BIT Equals TRUE
Comment: 64-bit runtimes
[DEFINE WEB MEDIA Microsoft SQL Server Compact Edition 3.5 Service Pack 2 (x64)]
Include Script: setupsqlcompactsp2_x64
[DEFINE WEB MEDIA Microsoft .NET Framework Client 4 (x64)]
Include Script: setupnet4client_x64
else
Comment: 32-bit runtimes
[DEFINE WEB MEDIA Microsoft .NET Framework Client 4]
Include Script: setupnet4client_x86
end

Finally after prerequsities re-apply 64-bit mode if appropriate (before setup globals section):
Comment: Set 64 bit mode if appropriate - needs to be done after runtime installs as they reset this setting to 32-bit regardless
if Variable ISWINDOWS64BIT Equals TRUE
if Variable PROCESSORARCH Equals AMD64
Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
end
if Variable PROCESSORARCH Equals IA64
Set Itanium ia64 - Native 64 bit Windows, Intel Itanium Architecture - installation mode
end
end

Thats it your done! Proceed with the rest of your setup as normal.

Hope it helps!
Regards

Obliterator

garyhalb
Posts: 29
Joined: Fri Apr 30, 2010 12:55 am

Re: 32 and 64 bit Runtime Requirements

Postby garyhalb » Fri Oct 01, 2010 5:31 am

Hi,

Thanks for the prompt reply.

I must admit I've a bit confused. When I originally used SQL Express 2008 Express SP1 a runtime for my installer the installer worked on both 32 bit and 64 bit systems without me coding in any of your attached response. It was only after I changed to R2 that I noticed installs on 64-bit windows were failing.

Am I missing something here? Is the R2 runtime different in some way to the SP1 runtime?

Thanks,
Gary

Obliterator
Posts: 53
Joined: Fri May 01, 2009 11:54 am

Re: 32 and 64 bit Runtime Requirements

Postby Obliterator » Fri Oct 01, 2010 5:43 am

Not that I'm aware, but I haven't looked that closely.
I just found during my testing (on vanilla boxes) that the SQL compact edition failed on x64 if I didn't first install the x86 runtime (it gave a very specific message).
The other runtimes are more straightforward.

CFConner
Posts: 85
Joined: Wed Jan 21, 2009 4:14 pm
Location: Syracuse, NY

Re: 32 and 64 bit Runtime Requirements

Postby CFConner » Fri Oct 01, 2010 12:37 pm

I find it fascintaing how people do different things for the same problem. I have a combined installation routine that supports both x86 and x64 platforms.

For me, I wanted to keep my code readable and reuseable, so in my main MPR file just before the region for checking application pre-requsites:

Code: Select all

Comment: Get the Processor Architecture
Set Variable ISWINDOWS64BIT to FALSE
Get System Setting Windows in 64 bit Mode into ISWINDOWS64BIT


Then, for example the following in my pre-requisites section:


Code: Select all

Include Script: checkmsi31
Include Script: checkmsxml42
Include Script: checkmsi45_x64
Include Script: checkmsxml60_x64
Include Script: checkvc10_x64
Include Script: CheckSQLNCLI2008x64
Include Script: checkmsxml60
Include Script: checkmsi45
Include Script: checkvc10_x86
Include Script: checksqlncli2008x86
Include Script: checknet4_x64


Now finally, in each of the script files, I made simple changes - as you stated some are common - such as the VC 10 Runtime 32 bit - it can be installed on 64 bit without worry of the type of platform. for those that matter, I do some tweaking. Here's a good example - the VC Runtime 64 bit cannot be run on 32 bit - so taking the existing stock script I added to the top:

Code: Select all

Set Variable VC10_X64 to TRUE
if Variable ISWINDOWS64BIT not Equals TRUE
 GoTo Label: Exit VC 10 x64 Gracefully
end


then at the very bottom I just stuck a label to exit. Other stock scripts do not need this kind of "exit gracefully". Most of them just needed a check for ISWINDOWS64BIT flag.

I wanted the scripts to stand on their own - so that I wouldn't have to modify in the future my runtimes when I check the boxes to include them later on in another project. I literally overwite the original stock scripts in the InstallAware\runtimes directory so that I can just focus on what components I need and the let the script figure out if I need it or not for that platform.

My way of coding isn't necessarily the "right" way to do it - or the "wrong" way - it is just a preference. :) In the end, it just boils down to how resuable is my code? If yours is a one off - I suggest doing it Obliterator's way. If you plan to do more installation projects with these runtimes, you should think about reuse so you don't have to change your main MPR file much if at all.

=-Chris

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: 32 and 64 bit Runtime Requirements

Postby mills » Fri Oct 01, 2010 2:49 pm

There is a currently known bug with the SQL Express 2008 R2 64-bit.

We've uploaded a fixed version of the runtime:
http://www.installaware.com/santacruz/s ... n_x64.7zip

Copy that to your InstallAware/runtimes folder.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

Obliterator
Posts: 53
Joined: Fri May 01, 2009 11:54 am

Re: 32 and 64 bit Runtime Requirements

Postby Obliterator » Fri Oct 01, 2010 4:01 pm

Agree with CFConner that modifying the supplied scripts is a good way forward- much more reuasable.
Originally, I avoided doing that as I expected them to get overwritten with the next IA update or the next time I changed the selected runtimes in the editor.
But I'm more familiar with IA now and it behaves quite nicely in this regard!
I have had to copy those blocks of code a few times now so it would have been beneficial.

Hopefully, in a future update IA will make the necessary changes to their own runtime scripts to better support this behaviour out of the box.
It seems a logical way forward given so many people are looking to do this kind of thing now.

garyhalb
Posts: 29
Joined: Fri Apr 30, 2010 12:55 am

Re: 32 and 64 bit Runtime Requirements

Postby garyhalb » Mon Oct 04, 2010 6:17 am

Hi guys,

Thanks for the detailed replies. I think I will take the route suggested by Conner as it appears to be the simplest solution.

I must admit, for all the advertising IA does with regard to supporting 32 and 64 bit in single installs it would make sense if they actually supported it out of the box. Seems a bit strange, cause even their Express version states that you can have hybrid setups for 32 and 64 bit, but you cannot edit scripts in that version so how on earth do they support it?

Regards,
Gary

garyhalb
Posts: 29
Joined: Fri Apr 30, 2010 12:55 am

Re: 32 and 64 bit Runtime Requirements

Postby garyhalb » Mon Oct 04, 2010 6:23 am

Hi mills,

The link you posted for the updated runtime files does not appear to be working.

Regards,
Gary

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: 32 and 64 bit Runtime Requirements

Postby mills » Mon Oct 04, 2010 9:58 pm

What do you mean it's not working? It properly links for me and other customers have downloaded it... Do you get an error or timeout?
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

garyhalb
Posts: 29
Joined: Fri Apr 30, 2010 12:55 am

Re: 32 and 64 bit Runtime Requirements

Postby garyhalb » Tue Oct 05, 2010 12:41 am

Hi mills,

In IE8 I get the following error:

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
-------------------------------------------------------------------------------

An invalid character was found in text content. Error processing resource 'http://www.installaware.com/santacruz/sqlexpress...
7z

However I pasted the link into my download manager and it seems to be working, thanks!

CFConner
Posts: 85
Joined: Wed Jan 21, 2009 4:14 pm
Location: Syracuse, NY

Re: 32 and 64 bit Runtime Requirements

Postby CFConner » Tue Oct 05, 2010 8:35 am

Gary, they aren't lying - in regards to separate setups. (Notice the italics).

Now this is my THEORY (as I have never used the Express edition): I am guessing that you create two main setups - one targets only 32 bit and the other 64 bit. Then you create a third that is actually your bootstrapper and which it will call the appropriate setup that targets your platform. Bang, now you have your hybrid. :)

I know I'll probably get shot down for that one - but hey its a good guess. :)

=-Chris

Obliterator
Posts: 53
Joined: Fri May 01, 2009 11:54 am

Re: 32 and 64 bit Runtime Requirements

Postby Obliterator » Tue Oct 05, 2010 11:17 am

Interestingly I just got a marketting email from the makers of the previous installer we used to use before IA (a market leader but I wont name them).
I don't follow their activities very closely anymore but it seems they have only just got round to adding 64-bit support!!
They do now list hybrid 32/64-bit support but I've been doing this with IA for over a year now!!! (granted with the minor workaround).

I suspect the hybrid problem in IA is just a trivial oversight for some of the runtime scripts.
The functionality is so nearly there out of the box I'm sure its only a matter of time before the problem gets addressed and doesn't need manual tweaking.

BTW the download link supplied worked fine for me. Maybe something is screwed with your filetypes in IE.

garyhalb
Posts: 29
Joined: Fri Apr 30, 2010 12:55 am

Re: 32 and 64 bit Runtime Requirements

Postby garyhalb » Wed Oct 06, 2010 1:56 am

Hi guys,

Ok, it seems I have gotten my 'hybrid' installer correctly setup and working. For the benefit of anyone else trying this I thought I'd just post a final comment on how I achieved it. Using bits from both the previous posts I came up with a middle way.

// This is the first block of my MSICode:

Comment: Get the Processor Architecture
Set Variable ISWINDOWS64BIT to FALSE
Get System Setting Windows in 64 bit Mode into ISWINDOWS64BIT

// Then I simply ticked all the 32 and 64 bit runtimes that I needed and then added the following logic to change the installation:

Comment: Check global pre-requisites
Include Script: checkie6
Include Script: checkmdac28
Include Script: checkmsi31

if Variable ISWINDOWS64BIT Equals TRUE
Include Script: checkmsi45_x64
Include Script: checknet20sp2_x64
Include Script: checkmsxml60_x64
Include Script: checknet30_x64
Include Script: checknet30sp2_x64
Include Script: checknet35sp1_x64
else
Include Script: checkmsi45
Include Script: checknet2sp2
Include Script: checkmsxml60
Include Script: checknet30
Include Script: checknet3sp2
Include Script: checknet351
end

I also had to do this at the Install section of the MSICode and the same logic around the Web Media Block portions. All works perfectly. I prefer this solution as I do not need to touch any of the included script files, I simply perform different checks and installs based on the ISWINDOWS64BIT variable.

Regards,
Gary

CFConner
Posts: 85
Joined: Wed Jan 21, 2009 4:14 pm
Location: Syracuse, NY

Re: 32 and 64 bit Runtime Requirements

Postby CFConner » Wed Oct 06, 2010 6:14 am

Gary, good job. Like I said, its all about preference. :)

=-Chris


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 102 guests