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
Target OS - Different file installation
-
- Site Admin
- Posts: 364
- Joined: Mon Jul 30, 2007 11:51 am
- Location: USA
- Contact:
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:
5.- Replace line 1 for the following:
6.- Replace line 2 for the following:
7.- Remove line 5
8.- Replace Line 6 for the following
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.
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/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
OS handling?
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)
-
- Site Admin
- Posts: 364
- Joined: Mon Jul 30, 2007 11:51 am
- Location: USA
- Contact:
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/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
That will work ...
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
Jeremy
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.
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
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
-
- Site Admin
- Posts: 364
- Joined: Mon Jul 30, 2007 11:51 am
- Location: USA
- Contact:
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:
detects the OS and based on that the installer decides what to install. There was no user intervention in that process.
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
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Who is online
Users browsing this forum: No registered users and 152 guests