Page 1 of 1

Target OS - Different file installation

Posted: Thu Aug 30, 2007 5:12 pm
by logicbox
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

Posted: Thu Aug 30, 2007 5:55 pm
by Alex_Ronquillo
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.

OS handling?

Posted: Fri Aug 31, 2007 1:38 pm
by jgoemaat
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)

Posted: Fri Aug 31, 2007 2:11 pm
by Alex_Ronquillo
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.

That will work ...

Posted: Sat Sep 01, 2007 9:32 pm
by jgoemaat
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

Posted: Sun Sep 02, 2007 1:14 pm
by jimo
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.

Posted: Mon Sep 03, 2007 10:54 am
by Alex_Ronquillo
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.