Windows Installer, Java Installer, Freeware Installer
Home|Contact|Site Map|TOC|Search
Download  Features   Java  Licensing  Purchase  Testimonials  Support  Forums

Creating a Professional Package

This tutorial will guide you step by step into the creation and customization of a Advanced Installer Professional project. It is addressed to those who have completed the Simple Installation tutorial.

Let's suppose you want to create a package for a text editor you have created. We will use for this role Microsoft's Notepad. This editor has some characteristics:

  • For the editor to function properly some registry keys must be present on the target system.
  • Suppose this editor is developed using Visual Basic. In order to work, it needs Visual Basic 6 Runtime to be installed on the target machine.
  • It has a type of file that it associated to, called, say, EDI file.
  1. Create the project
  2. Enter product details
  3. Set the install parameters
  4. Add files and folders to your project
  5. Add registry keys and values to your package
  6. Set the launch conditions
  7. Installing Prerequisites
  8. Create new file extensions and make file associations
  9. Organizing your application into features
  10. Set the dialogs to guide the user during install
  11. Set the name of your package and some more media options
  12. Add environment variables to your project
  13. Add custom actions to your installation package
  14. Install and control services
  15. Add merge modules to your project
  16. Set the UI appearance of your installation package

Create the project

If Advanced Installer is not currently running, launch it by double-clicking a desktop icon or selecting it from the "Start" menu. When the application starts, you will see a dialog where you can choose the type of the project you want to create.

New Project

Select Professional and press the OK button. The new project has been created and from now on you will edit it.

SaveSave the project and give it an appropriate name - let's say "Tutorial" for this example.

English is the default project language, but you can change it to any of the languages known by Advanced Installer.

Enter product details

Now you can see the main view split in two panes. In the left pane, you can see all the options you have to edit in your current project, grouped in four categories.

Project DetailsClick on "Project Details" option from the "Project Settings" group to set the information seen by the user for your installation package. Fill the fields in the right pane with the corresponding data. Here is an example of how this can be done:

Product Details

For further information about this page please see Product Details.

Set the install parameters

You now have the general information on the Product Details page filled in.

Install ParameteresGo to the Install Parameters page (click the Install Parameters option).

Set the default installation paths for the "Application Folder" and "Application Shortcut Folder" by using the combo boxes or the [ Edit... ] button. You can edit these fields, but the values from the combo boxes are the most common ones.

Install Parameters

NoteFor more information about these paths please see the Install Parameters page.

Add files and folders to your project

The next step is to add to the project the files and/or folders that compose your application. You will need an EDI file to test the editor's file associations. Since it is a custom type of file, you will have to create it. Use any text editor to create a "foo.txt". Then rename it "foo.edi".

Files and FoldersClick on the "Files and Folders" option and select the "Application Folder" (in the tree from the left pane of the view).

Add filesClick on the [ Add Files ] toolbar button and select the files of your application. For this example choose Notepad.exe from your Windows directory. Repeat this step to include the Foo.edi file you have created. You can add in this way as many files as you want.

Files, Folders and Shortcuts

Once the files are added, their name will appear in a list in the right-side pane of the view. Now let's make a shortcut to the Notepad.exe file you just added. Right click on this file and choose "New Shortcut..."". In the newly appeared dialog choose a name for your shortcut and a location - like in the following screen-shot. Press the OK button and the shortcut will appear listed in the application shortcut folder.

New Shortcut

NoteFor more information please see the Files and Folders page.

Add registry keys and values to your package

Let's suppose that your application needs two registry entries. These are located in the "Software\[Manufacturer]\[ProductName]\Settings" key.

  • One registry value is named "AppPath" and stores the path where your application is installed.
  • The other one is named "AppSettings" and contains a value that shows the current settings of the application. On install it has the value "Default".

Registry PageSelect the "Registry" page.

In the tree, select the "Software\[Manufacturer]\[ProductName]" key.

New KeyClick on the [ New Key ] toolbar button to create a key. Edit the key name to "Settings".

New ValueAdd a value for it using the [ New Value ] toolbar button.

In the "Name" text field enter the name of your first key: "AppPath". Use the [ Folder... ] button and select "Application Folder". Since "Data" is a Formatted Type text field the value that it contains will be expanded at install time into the full path to your application's location.

Use the same steps to create the "AppSettings" value. This time just type in the "Data" field the text "Default".

Edit Registry Entry

Once the registry keys and values are added, you can see them in the right-side pane of the view.

Registry

NoteFor more information please see the Registry page.

Set the launch conditions

Launch ConditionsGo to the "Launch Conditions" tab of the "Prerequisites" page. If you wish that your application should be installed only on Windows NT 4.0 or higher and not on Windows 9x/ME, then you should do the following:

  • uncheck the "Windows 9X from" check box
  • check the "Windows NT From" check box
  • select "Windows NT 4.0" from the associated combo box

Launch Conditions

You can also create a custom launch condition which will make sure that the package will not be installed if the file "example.txt" does not exist on the partition on which Windows is installed. For this you can follow these steps:

  • create a File search in the Search page
  • set the file name to example.txt
  • rename the search to FILE
  • use the context menu to add a folder as the location of the search
  • set this folder to [WindowsVolume] (this is resolved to the partition on which Windows was installed)
  • use the "Test Search" button on the toolbar to test the search
  • go to the Custom Launch Conditions tab in the Prerequisites page
  • use the [ New... ] button to add this launch condition:

Condition: FILE
Description: This application cannot be installed because the file "C:\example.txt" does not exist.

Installing Prerequisites

Let's suppose that your application requires the "My Application.exe" installation package to be installed. This package will install an application and it will create the registry entry HKEY_LOCAL_MACHINE\Software\My Application\Version with the value 1.0. If this application is not already present on the target machine, your package will have to install it before deploying your application. For this you can use the "Prerequisite" feature.

PrerequisitesGo to the "Prerequisites" page.

PrerequisitesSelect the "Software Prerequisites" tab.

You can add any software that you need. Advanced Installer also comes with a list of common used prerequisites, for which all the settings are already defined. After creating them by using the [ Add ] button, you only have to specify the source for the setup file.

If you have the "My Application.exe" installation package on your computer you can use the "File in package" option and select it when prompted.

NoteYou can also set the location of the prerequisite as an URL from where the file can be downloaded.

New Prerequisite

After the properties of the prerequisite have been set you need to set the detection criteria by using the Install Conditions tab.

Install Conditions

Since the prerequisite application creates a registry entry, we can use it as a detection criteria in the Searches section.

Install Conditions Search

NoteFor more information please see the Prerequisites page.

Create new file extensions and make file associations

Your application uses files with a particular extension (in our example that is "edi"). You may want to associate that type of files to be opened or edited with your application. Advanced Installer helps you do this in a very simple way.

File AssociationChoose "File Association" from the "Project Details" options group.

New ExtensionUse the [ New Extension ] toolbar button to create a new extension. That is "edi". Enter a description of this extension in the appropriate field in the right-side pane. You may choose an icon to be displayed for all the files with the extension you created.

File Associations

For every extension contained in your application, you need to add at least one verb. The name of the verb will be seen in the context menu that appears when you right click on a file of "edi" type in Windows Explorer. For this example, you should leave the defaults settings. The effect is that when you double click a file or you choose the "Open" action from a context menu of an "edi" file, the application is automatically launched with the command line argument specifying the absolute path of the chosen file.

Extensions and Verbs

You can add as many verbs as you want for an extension.

NoteFor more information please see the File Associations page.

Build and Install

You are now ready to test your program. Build and install your program as described in the Simple Installation tutorial.

You can test if the file associations are working properly. Look in the folder where you have installed the program and double-click the EDI file. This should open using the Notepad.exe file that you have installed.

Also you can verify the value written in the registry (using Regedit.exe). You will see the value of AppPath containing the full path to your application.

Organizing your application into features

You may want to give the user the possibility to install only some parts of your application. To do this you must organize you application into several features.

OrganizationTo see the structure of your application select the Organization page on the left pane.

At this moment, all your files are included into a single feature, called "MainFeature". You will create a new feature that contains the "foo.edi" example file. In the "MainFeature" only the "Notepad.exe" component will be present.

New FeatureSelect "Product" in the tree and click the "New Feature" toolbar button.

Drag and drop the "foo.edi" component in the newly created feature. To make this feature optional (i.e. to be installed only on Custom or Full types of installation) select in the "Install Level" filed the "4 (Complete)" option.

Your organization page should look like this.

Organization Page

NoteFor more details about features and components please see the Organization page.

Set the dialogs to guide the user during install

The Dialogs PageGo to the Dialogs page.

Here you can select the dialogs that appear during install. In our example, you will add two more dialogs:

  • A dialog in which the user to choose the type of installation (Typical, Complete, Custom).
  • A dialog for displaying a license agreement text. You also will allow the user to choose to view the ReadMe file or to launch the application at the end of the installation.

For the first goal, right click the Welcome dialog from the left-side pane and choose "Add Dialog" from the context menu. Select the "SetupTypeDlg" dialog.

For the second goal, repeat this procedure but select the "LicenseAgreementDlg" dialog from the "Add Dialog" window. Click on the [ Browse ] button from the right-side pane to select from your machine the Rich Text Format file containing the license agreement. Finally, you must add to your package the Readme file for your application (use the "Files and Folders" option page). Select the "ExitDialog" dialog from left-side pane. In the right-side pane, check the "Show "View Readme" option" checkbox; you will be prompted to choose the Readme file of your application. Choose the file you just added to your package. Next, check the "Launch Application at the end of installation" checkbox and select from your package the application that will be launched at the end of the installation.

Note that the user can choose not to see the Readme file or to launch this application.

Dialogs

NoteFor more information please see the Dialog Editor page.

Build and test the package again.

NoteThe Advanced Installer project file only contains a description of how to build your MSI installer, and does not actually include any files.

Set the name of your package and some more media options

In this step you set the name of the package that will be generated.

Media Select the "Media" option from the left-side pane and enter the name "TutorialPackageName" in the text field. If you let this field empty, the name of the package will be the same as the name of your project.

Media

NoteFor more details about the available options please see the Media page.

Add environment variables to your project

Let's suppose your application needs some information stored in an environment variable. In this step you will add to your project this type of variable. In our example, we will add a variable - "NOTEPAD_PATH" - that will contain the path to the folder in which your application will be deployed.

EnvironmentSelect "Environment" from the "Project Details" options group.

New VariableClick on the [ New Variable ] toolbar button and fill the fields of the newly appeared dialog as in the next screenshot.

Edit Environment Variable

NoteFor more information please see the Environment Variables page.

Add custom actions to your installation package

Custom actions are useful when you need to perform a specific action during installation and there is no other way to do it. The custom action is entirely defined by you; in Advanced Installer you only specify the file that contains it and some parameters for its execution. You can add custom actions contained in EXE files, DLL files, VBScript files or a JavaScript files.

Custom ActionsSelect "Custom Actions" option from the Project Details group in order to add a Custom Action. Right-click on the "InstallExecuteSequence" -> "Install" standard action in the left-side pane. Choose from the context menu "New Installed Custom Action". Select from the FilePicker dialog the "Notepad.exe" file (you included this earlier in your project).

Custom Actions

In the command line field pass the string "foofile". The effect is that Notepad will try to open this file; if "foofile" doesn't exist on the target machine, Notepad will ask the user whether it should create a new one. This shows the way the command line arguments behave.

NoteFor more information please see the Custom Actions page.

Install and control services

In this step, we will define the services to be installed with your application. You can only install services that are part of your package.

Files and Folders First, use the "Files and Folders" option to add the service file (a native Windows service) to your project.

Services Go to the "Services" page from the "Project Details" option group.

Add a ServiceClick on the [ Add a service ] toolbar button. Select the service file from the dialog that appears and fill the service properties fields as in the screenshot below.

Services

That operation completed only the service installation. You can control your service or any other service installed on the target machine during installation. For that you need to define a service control operation. In our example we will start our service during install and stop and delete it during uninstall. The following screenshot shows you exactly the control service operation parameters.

Control Service Parameters

NoteFor more information about this please see the Services page and the Java Service Installation tutorial.

Add merge modules to your project

Let's suppose you install an application that requires Microsoft C Runtime Library. The logic and files that compose this library already exist in the merge module. You can include this module in your package and it will be installed with your application. This way, you are sure your application will work on every machine. With Advanced Installer it is very easy to add a merge module to your package.

Merge Modules Choose "Merge Modules" from the "Project Details" options group

New Merge moduleClick on the [ New merge module ] toolbar button and browse to your msm file. That's all!

Merge Modules

NoteFor more information please see the Merge Modules page.

Set the UI appearance of your installation package

In this step we will change the UI appearance of the package.
Go to the "Global Properties" page in the "User Interface" group.
In the "Theme" tab you can change the banner shown on the dialogs and the background from the first and the last dialog. You can choose one of the Advanced Installer predefined images or you can use one of your own by clicking the "Browse" option from the appropriate combo box.

NoteFor more information please see the Global Properties page.

The End

This concludes our tutorial. To learn more, please read the Other Languages tutorial.

Privacy Policy | Windows Installer | Search Engine Ranking | Link Analyzer