Tutorials


Tutorial 1

The goal of this tutorial is to create a simple installer for a fictional product named "Advantage". The "Advantage" product consists of an application, a system extension, and several other associated files. It is to be installed inside of a folder named "Advantage 1.0" on the user's drive.

The first step in building any installer is to identity the files that will be part of the installer. For this tutorial, this step has already been done. There is a folder named "Advantage 1.0" inside the "Tutorial Files" folder which contains all files needed for this first tutorial.

The next step in building an installer is to create a script using the DragInstall Builder application. This tutorial takes advantage of the DragInstall "QuickScript" feature to create a complete script document in a matter of minutes.

The "New QuickScript" option takes a folder on your drive and creates a new script document based on this folder. All files inside the folder are added to the script and assigned to an installation that is named the same as the folder. If there are any files inside your folder that are normally installed into the System Folder, then these files are moved into the appropriate folders. If there is a Read Me file within your folder, this file's text is used as the Read Me text for your installer. The decisions made by the QuickScript option in assembling a script document are not final. Once the script document is created, you can further customize it before you build your final installer. Click OK to dismiss the Quick Script Results window. You should see a newly created script window.

The left side of the script window shows the items that are part of your installer. These include folders and files as well as other special items that will be covered in the next tutorial. Notice that the items from the "Advantage 1.0" folder have been placed into the script, except for the "Advantage Startup" file, a system extension which has been moved into the Active Extensions folder.

The right side of the script window lists the installation options that are part of your installer. The script you just created contains only one installation option named "Advantage 1.0". DragInstall can have any number of installation options and each can be classified as either a Recommended or Custom option. In this script, the "Advantage 1.0" installation is a Recommended option.

The checkboxes along the left side of the item view indicate whether an item belongs to the selected installation on the right. Notice that all of the items from the folder that you selected have been automatically assigned to the "Advantage 1.0" installation.

You are now ready to build your first installer. This installer will be a basic one right now, but it will become more sophisticated in the next tutorial.

If the build was successful, you will see a final dialog indicating how many files were compressed and how much space was saved. If you encountered any problems building, refer to the Troubleshooting section.

That's it. You can now try your first installer out.

The folder "Advantage 1.0" should be installed at the root level of your hard disk, and the file "Advantage Startup" should be installed into the Extensions folder on your startup disk. (Don't worry, this extension doesn't do anything, and it will be deleted in Tutorial 2.)

Tutorial 2

The goal of this tutorial is to extend the simple installer created in the first tutorial. The following enhancements will be made to the installer during the course of this tutorial:

- The graphics files in the installer will be installed based on system rules.
- Additional custom installation options will be created.
- An "uninstall" option will be added.
- The installer will be "spruced" up with a new splash screen and some other customizations.

If you worked through the first tutorial, you should have a script document named "Advantage Script" on your hard disk. You will need to open this script to begin this tutorial. If you didn't go through the first tutorial, you can open the file "Advatange Script" found inside the "Tutorial Files" folder.

Setting Item Rules
The installer created in the first tutorial was a simple one. The items in the "Advantage Script" were not changed from their default attributes. In this tutorial, we will assign a System Rule to two of the items in the script.

In the "Advantage 1.0" folder there is a "Graphics" folder containing two files "Black & White" and "Color". Suppose that we only want the file "Black & White" to be installed on systems with black & white monitors and the file "Color" to be installed only on color systems. We can accomplish this easily.

If you were to build and run an installer at this point, you would see only one of the "Graphics" files get installed based on whether or not your machine had color. The installer would check the file rules against the machine's configuration and install the appropriate file.

Adding Custom Installations
The installer created in the first tutorial contained a single recommended installation with all files from the "Advantage 1.0" folder. In this tutorial, we will create additional installation options for installing portions of the "Advantage 1.0" folder. First, we will create separate installation options for the Advantage extension and the Advantage application. This can be done in a couple of steps. You should see two new options in the installation view on the right side of the script window named "Advantage Startup" and "Advantage". If you click on either option, you will see the check marks change in the item view indicating which items are assigned to each installation.

The user will see the "Advantage Startup" and "Advantage" icons in the Custom "page" of your installer window. These options will allow them to install the Advantage application and extension separately.

Next, we will create a separate installation for the "Graphics" folder inside the Advantage folder.

This creates a new installation option named "Graphics" (the name of the selected folder) and automatically assigns all selected items to this installation. This option would also be presented to the end user on the Custom "page" of the installer window. This can be changed in the Installation Editor window if desired.
Creating an Uninstall Option
So far in this tutorial, we've added some additional installation options for the user. Now we're going to add an "uninstall" option. This requires three steps. The first is to create a new installation, the second is to add some items to our script, and the third is to assign those items to the new installation. To create the new "uninstall" installation, do the following: Since we set this new installation as "Recommended", the user will see this option on the first "page" of the installer window, along with the "Advantage 1.0" installation.

Now we have to add the script items to peform the uninstall. We need to delete the "Advantage Startup" extension and also the "Advantage 1.0" folder. We will assume that the extension will be in the Extensions folder, but we will allow for the possibility that the "Advantage 1.0" folder has been moved from the root of the user's drive. To take care of deleting the extension, do the following: Click once to select the "Extensions" folder inside the "Active System Folder". From the Script menu, choose "New Item:Delete". This creates a new Delete script item and opens its Info window. Enter the name "Advantage Startup" as the name of the file to delete. Click Create to add the Delete item to the script. To take care of deleting the Advantage 1.0 folder", do the following:

The two items that were added to the script will operate as follows. The Find item searches the user's drive for a folder named "Advantage 1.0". If the search is successful, the current install location is set to the folder containing the Advantage 1.0 folder. The Delete item then looks for a folder named "Advantage 1.0" within the current install location and deletes the folder and its contents if it is found. If the Find is not successful, the Delete doesn't find a folder to delete and nothing happens.

If we wanted to tell the user that the "Advantage 1.0" folder could not be found, we could use a Message item to accomplish this. To add this Message item, do the following:

This message should only appear when the Find item could not locate the "Advantage 1.0" folder. To do this, we will need to test the results of the previous Find using a Result Test. The info area at the bottom of the script window should show the settings for the new Message item, including the "Last Find Was Not Successful" test. This means that this message will only be displayed if the "Advantage 1.0" folder could not be found.

The only thing left to do to complete the Uninstall option is to assign these new items to the Uninstall installation. To do this, make sure that the installation named "Uninstall" is selected in the installation view. Then click the checkboxes for all of the items just entered: the Delete item in the Extensions folder and the Find, Delete, and Message items at the end of the script.

Additional Customizations
Our new installer is almost ready. We just want to make a couple of quick enhancements, and then we'll be ready to build. We are going to customize the startup screen and make some changes to the appearance of the installer window before we build. You are now ready to build your second installer. If the build was successful, you will see a final dialog indicating how many files were compressed and how much space was saved. If you encountered any problems building, refer to the Troubleshooting section.

That's it. Now you can try your second installer out.


A script is a document created by the DragInstall Builder.

It is not a script in the programming sense, rather it is a collection of the items, installations, and other attributes which define an installer.


[Contents | Contact Information]

Last modified 26-MAR-96
Copyright © 1996 Ray Sauers Associates, Inc.