Target OS - Different file installation

Got a problem you cannot solve? Try here.
logicbox
Posts: 1
Joined: Thu Aug 30, 2007 5:08 pm

Target OS - Different file installation

Postby logicbox » Thu Aug 30, 2007 5:12 pm

I have a scenario where i have 2 versions of a program and depending on the OS the installation targeting, Vista versus XP for example, I want it to install a different set of files and maybe perform some different steps...

I'm guessing there is some type of scripting for this but I haven't come across it. Or maybe there is a better solution? I am new to installation software, so I thought I would start here.

Chris

Alex_Ronquillo
Site Admin
Posts: 364
Joined: Mon Jul 30, 2007 11:51 am
Location: USA
Contact:

Postby Alex_Ronquillo » Thu Aug 30, 2007 5:55 pm

With IA you can accomplish this by defining two different features, and filter installation files by features. Let me try to give you the steps to do it, Note: I am using the Windows XP and Vista you mentioned to explain it.

In the design tab:

1.- Create two different features (Windows XP and Windows Vista) in "Setup Architecture"-->"Features"
2.- Select the files for each feature by checking the "Filter Files by Features" checkbox in "Setup Architecture"-->"Files"

In the MSICode tab:

3.- Find the following code region: "Perform First Time or Maintenance Installation [...]"
4.-In that code region, you will find kind something like the following code:

Code: Select all

  [DEFINE WEB MEDIA Windows Vista]
  1 Get Component Windows Vista Selection State into Variable SELECTED
  2 if Variable SELECTED Equals TRUE
  3  Install Files C:\\Documents and Settings\\Alejandro Ronquillo\\My Documents\\My Pictures\\dialog.JPG to $TARGETDIR$
  4 end
  [DEFINE WEB MEDIA Windows XP]
  5 Get Component Windows XP Selection State into Variable SELECTED
  6 if Variable SELECTED Equals TRUE
  7 Install Files C:\\Documents and Settings\\Alejandro Ronquillo\\My Documents\\My Pictures\\error.JPG to $TARGETDIR$
  8 end

5.- Replace line 1 for the following:

Code: Select all

Get Exact OS Level into SELECTED

6.- Replace line 2 for the following:

Code: Select all

if Variable SELECTED Equals XP

7.- Remove line 5
8.- Replace Line 6 for the following

Code: Select all

if Variable SELECTED Equals VISTA


In the design tab:

9.- Uncheck the checkboxes for dialogs "setuptype" and "componentstree" in "User Interface"-->"Dialogs"

And now you have accomplished an installation based on OS.

This is just an example, you can play with it according to your needs. I hope this was helpful.
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

jgoemaat
Posts: 3
Joined: Fri Jul 15, 2005 12:56 am

OS handling?

Postby jgoemaat » Fri Aug 31, 2007 1:38 pm

Alex, is there no way to change which actions are taken depending on OS rather than treating the OS like a feature as you propose above? What do other companies do in our situation to make a single install - or to they actually create a separate install for each OS? (I guess I do see that done a lot)

Alex_Ronquillo
Site Admin
Posts: 364
Joined: Mon Jul 30, 2007 11:51 am
Location: USA
Contact:

Postby Alex_Ronquillo » Fri Aug 31, 2007 2:11 pm

The other way is as you said making one different installer for each OS and run the corresponding installer from within one main installer that detects the OS. I don't think it is hard to do it the way I described you before.
Alejandro Ronquillo

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

jgoemaat
Posts: 3
Joined: Fri Jul 15, 2005 12:56 am

That will work ...

Postby jgoemaat » Sat Sep 01, 2007 9:32 pm

Yes, it's not that hard, it would just look more professional if the scripting engine could branch depending on OS without user intervention - seems weird the user having to select the OS as that is a pretty basic discovery capability of the installer ... anyway, THANKS for the quick replies - do we have a working solution.

Jeremy

jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Postby jimo » Sun Sep 02, 2007 1:14 pm

The example provided was just that an example, you do not need to have the user select the OS, test for the OS in the MSICode and put if statements inside the webmedia blocks.

Like:
Get System Setting Windows Vista into ISVISTA
If Variable ISVISTA = TRUE
else
endif


You can even do it inside one web media block.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com

Alex_Ronquillo
Site Admin
Posts: 364
Joined: Mon Jul 30, 2007 11:51 am
Location: USA
Contact:

Postby Alex_Ronquillo » Mon Sep 03, 2007 10:54 am

jgoemaat,

Actually in the example I gave you, the user doesn't select the OS. The OS is detected by the installer. The line I made you add:

Code: Select all

Get Exact OS Level into SELECTED, detects the OS
detects the OS and based on that the installer decides what to install. There was no user intervention in that process.
Alejandro Ronquillo

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 152 guests