PDA

View Full Version : HOWTO: Conditionally Install Files Based on OS



Support
10-10-2002, 03:03 PM
<HTML><HEAD><TITLE>HOWTO: Conditionally Install Files Based on OS</TITLE></HEAD><BODY><h3>HOWTO: Conditionally Install Files Based on OS</h3><b>Document ID: IR02022</b><hr>The information in this article applies to:<ul><li>Setup Factory 6.0</li></ul><hr><h3>SUMMARY</h3><p>This article explains how to conditionally install any file based on what operating system the user is running.</p><h3>DISCUSSION</h3><p>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.</p><p>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.</p>Assuming that you already have the file added to your project, right click the file in the project window and select <b>File Properties</b> to view that file's <i>Properties</i> dialog. Next click the Conditions tab.There you will see a window labelled <b>Run-time install condition</b>. 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.<p>There are two methods you can use to create a condition:</p><p>The first is by clicking the <b>Build</b> button. Doing so will display the <i>Build Expression</i> 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.</p><p>The second method that can be used is directly entering your expression into the <b>Run-time install condition</b> field. For this example, we'll simply provide the text that would be used to build this condition. </p><p>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.</p><p>These two variables can be used in an expression to produce the following code:</p><pre><code>(%IsWin98% = TRUE) OR (%IsWin95% = TRUE) </code></pre><p>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.</p><h3>MORE INFORMATION</h3><p>For more information, please see the following topics in the Command Reference located under <b>Help | Setup Factory Help</b>:<br><ul><li><b>Command Reference | Expressions</b> (all subtopics)</li><li><b>Command Reference | Reference | Run-time Conditions</b></li><li><b>Command Reference | Design Environment | Dialogs | Build Expression | Build Expression Dialog</b></li><li><b>Command Reference | Design Environment | Dialogs | File Properties | File Properties Tabs | Conditions Tab</b></li></ul></p><p>KEYWORDS: conditionally install, condition, runtime condition</p><hr><FONT SIZE=1>Last reviewed: October 10, 2002<br>Copyright 2002 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br></FONT></BODY></HTML>