Support
10-23-2002, 02:16 PM
<HTML><HEAD><TITLE>HOWTO: Download and Install Files from the Web</TITLE></HEAD><BODY><h3>HOWTO: Download and Install Files from the Web</h3><b>Document ID: IR02034</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 download and install files from the web using Setup Factory 6.0.</p><h3>DISCUSSION</h3><p>Downloading and installing files from the Internet was made possible in Setup Factory 6.0 with the addition of three features:</p><ul><li>The <b>Download file HTTP</b> action</li><li>The <b>Install File</b> action</li><li>The %AdditionalDiskSpace% built-in variable</li></ul><p>The <b>Download file HTTP</b> action allows you to download files from the Internet. The <b>Install File</b> action allows you to install files manually onto the end user's computer. It automatically performs the same checks that Setup Factory does when installing any of the files located on the <b>Archive</b> or <b>CD-ROM</b> tab in the Setup Factory design environment. The %AdditionalDiskSpace% built-in variable allows you to add extra disk space to the <b>Space required on drive</b> calculation that is displayed on the <b>Select Install Folder Screen</b>.</p><p>The first step when downloading and installing files from the web is to set up your <b>download file HTTP</b> action. In this example we will download the file: "AdditionalData.DAT" from: "HTTP:\\www.MyWebArea.com\files\". We will download the file to the user's temporary directory, using the built-in variable %TempDir%. The action would look something like this:</p><pre><code><b>URL:</b> HTTP:\\www.MyWebArea.com\files\AdditionalData.DAT
<br><b>Local download folder:</b> %TempDir%
<br><b>Connection timeout:</b> 40
<br><b>Port:</b> 80
<br><b>Verify file size:</b> Unchecked
<br><b>Verify file CRC:</b> Unchecked</code></pre><p>This action can occur on any event during the installation but must occur before the <b>Install File</b> action.</p><p><b>Tip:</b> It is a good idea to allow the user to decide if they want to download the file or not. You can never be sure of the speed, reliability of your user's Internet Connection, or if they are even connected to the Internet. So your best bet is to let them decide if they want to download the file or not.</p><p>Once the file has been downloaded from the Internet the next step is to install the file. This will be done using the <b>Install File</b> action. In this example we will install the file "AdditionalData.DAT" that we just downloaded from the Internet and saved in %TempDir%. We will install the file to our application directory: %AppDir%.</p><pre><code><b>Source:</b> %TempDir%\AdditionalData.DAT
<br><b>Destination:</b> %AppDir%
<br><b>If file already exists:</b> Overwrite if existing file is same or older
<br><b>Create Backup:</b> Unchecked
<br><b>Shared/System file:</b> Checked</code></pre><p>Usually the <b>Install File</b> action should occur right after the <b>Download File HTTP</b> action.</p><p>The last step is to account for the additional disk space that "AdditionalData.DAT" will take on the user's system. The built-in variable %AdditionalDiskSpace% will be used to accomplish this. %AdditionalDiskSpace% represents additional disk space (in bytes) that will be added to the required disk space calculation displayed on the <b>Select Install Folder</b> screen. "AdditionalData.DAT" is 524 Kilobytes.</p><p>Since %AdditionalDiskSpace% requires the disk space to be represented in bytes we will have to convert the size of "AdditionalData.DAT" (524 KB) into bytes. 1 Kilobyte is 1024 Bytes, so to convert from Kilobytes to Bytes, simply multiply the Kilobyte number by 1024. Therefore "AdditionalData.DAT" is 536576 Bytes. This means that we will have to set %AdditionalDiskSpace% to 536576 since we need 536576 Bytes of additional Space. We will set %AdditionalDiskSpace% using an <b>Assign Value</b> action:</p><pre><code><b>Variable name:</b> %AdditionalDiskSpace%
<br><b>Value:</b> 536576</code></pre><p>Setting the value of %AdditionalDiskSpace% must occur before the <b>Select Install Folder</b> screen is displayed.</p><p><b>Note: </b>The %AdditionalDiskSpace% variable was introduced in version 6.0.1.1 of Setup Factory.</p><p><b>Note: </b>%AdditionalDiskSpace% only effects the disk space calculation on the <b>Select Install Folder</b> screen. If this screen is not displayed during the installation process, %AdditionalDiskSpace% will have no effect.</p><h3>MORE INFORMATION</h3><p>For more information please see the following links in the Setup Factory 6.0 help file:</p><li><b>Command Reference | Actions | Individual Actions | Download file HTTP</b></li><li><b>Command Reference | Actions | Individual Actions | Install File</b></li><li><b>Command Reference | Actions | Individual Actions | Assign Value</b></li><p>KEYWORDS: Setup Factory 6.0, Download, Install, Web, Internet</p><hr><FONT SIZE=1>Last reviewed: February 20, 2003
<br>Copyright © 2003 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.
<br></FONT></BODY></HTML>
<br><b>Local download folder:</b> %TempDir%
<br><b>Connection timeout:</b> 40
<br><b>Port:</b> 80
<br><b>Verify file size:</b> Unchecked
<br><b>Verify file CRC:</b> Unchecked</code></pre><p>This action can occur on any event during the installation but must occur before the <b>Install File</b> action.</p><p><b>Tip:</b> It is a good idea to allow the user to decide if they want to download the file or not. You can never be sure of the speed, reliability of your user's Internet Connection, or if they are even connected to the Internet. So your best bet is to let them decide if they want to download the file or not.</p><p>Once the file has been downloaded from the Internet the next step is to install the file. This will be done using the <b>Install File</b> action. In this example we will install the file "AdditionalData.DAT" that we just downloaded from the Internet and saved in %TempDir%. We will install the file to our application directory: %AppDir%.</p><pre><code><b>Source:</b> %TempDir%\AdditionalData.DAT
<br><b>Destination:</b> %AppDir%
<br><b>If file already exists:</b> Overwrite if existing file is same or older
<br><b>Create Backup:</b> Unchecked
<br><b>Shared/System file:</b> Checked</code></pre><p>Usually the <b>Install File</b> action should occur right after the <b>Download File HTTP</b> action.</p><p>The last step is to account for the additional disk space that "AdditionalData.DAT" will take on the user's system. The built-in variable %AdditionalDiskSpace% will be used to accomplish this. %AdditionalDiskSpace% represents additional disk space (in bytes) that will be added to the required disk space calculation displayed on the <b>Select Install Folder</b> screen. "AdditionalData.DAT" is 524 Kilobytes.</p><p>Since %AdditionalDiskSpace% requires the disk space to be represented in bytes we will have to convert the size of "AdditionalData.DAT" (524 KB) into bytes. 1 Kilobyte is 1024 Bytes, so to convert from Kilobytes to Bytes, simply multiply the Kilobyte number by 1024. Therefore "AdditionalData.DAT" is 536576 Bytes. This means that we will have to set %AdditionalDiskSpace% to 536576 since we need 536576 Bytes of additional Space. We will set %AdditionalDiskSpace% using an <b>Assign Value</b> action:</p><pre><code><b>Variable name:</b> %AdditionalDiskSpace%
<br><b>Value:</b> 536576</code></pre><p>Setting the value of %AdditionalDiskSpace% must occur before the <b>Select Install Folder</b> screen is displayed.</p><p><b>Note: </b>The %AdditionalDiskSpace% variable was introduced in version 6.0.1.1 of Setup Factory.</p><p><b>Note: </b>%AdditionalDiskSpace% only effects the disk space calculation on the <b>Select Install Folder</b> screen. If this screen is not displayed during the installation process, %AdditionalDiskSpace% will have no effect.</p><h3>MORE INFORMATION</h3><p>For more information please see the following links in the Setup Factory 6.0 help file:</p><li><b>Command Reference | Actions | Individual Actions | Download file HTTP</b></li><li><b>Command Reference | Actions | Individual Actions | Install File</b></li><li><b>Command Reference | Actions | Individual Actions | Assign Value</b></li><p>KEYWORDS: Setup Factory 6.0, Download, Install, Web, Internet</p><hr><FONT SIZE=1>Last reviewed: February 20, 2003
<br>Copyright © 2003 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.
<br></FONT></BODY></HTML>