HOWTO: Conditionally Install Files Based on OSDocument ID: IR02022
The information in this article applies to:
- Setup Factory 6.0
This article explains how to conditionally install any file based on what operating system the user is running.
As more operating systems are being released year after year, developers are wanting to maximize the platform support for their products. However as technology develops, dependency files are not necessarily compatible on every operating system. Some controls distributed with an application may be suitable for a Windows XP system, however they may not be compatible with an older operating system such as Windows 95 or 98. As a result it's becoming common place to conditionally install some files for your application based on what operating system your customer is running. Using Setup Factory 6.0, this task is very easy to accomplish.
Let's say that you have the file "myfile.txt" that you only want installed if the user is running Windows 95 or Windows 98.Assuming that you already have the file added to your project, right click the file in the project window and select File Properties to view that file's Properties dialog. Next click the Conditions tab.There you will see a window labelled Run-time install condition. In this location you want to define what sort of condition(s) you would like to place on this file in order for the install to determine whether or not to install it during the install process.
There are two methods you can use to create a condition:
The first is by clicking the Build button. Doing so will display the Build Expression dialog. This dialog is very helpful because it will display all of the custom and built-in variables that you currently have available so you can simply double click them to add them to an expression. You will also see all of the available operators you can use to build your expression.
The second method that can be used is directly entering your expression into the Run-time install condition field. For this example, we'll simply provide the text that would be used to build this condition.
There are a few built-in variables that are very helpful for determining what operating system the user is running. There are variables for each operating system, however we will only use two of these, %IsWin95% and %IsWin98%. These variables have a value of "TRUE" or "FALSE" depending on whether the setup is running on the respective operating system.
These two variables can be used in an expression to produce the following code:
(%IsWin98% = TRUE) OR (%IsWin95% = TRUE)
This expression can be read like an English statement. What it means is that the file will be installed if the variable %IsWin98% evaluated to TRUE or the variable %IsWin95% evaluated to TRUE, or in more simple terms, if they are running Windows 95 or Windows 98.
For more information, please see the following topics in the Command Reference located under Help | Setup Factory Help:
- Command Reference | Expressions (all subtopics)
- Command Reference | Reference | Run-time Conditions
- Command Reference | Design Environment | Dialogs | Build Expression | Build Expression Dialog
- Command Reference | Design Environment | Dialogs | File Properties | File Properties Tabs | Conditions Tab
KEYWORDS: conditionally install, condition, runtime condition
Last reviewed: October 10, 2002
Copyright © 2002 Indigo Rose Corporation. All rights reserved.