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 a sample editor application built by us. 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 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.

Start Page

Select Professional and press the Create Project 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.

2. 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 “Product Information” 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 Tab.

3. Set install parameters

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

Install ParametersGo 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.

4. 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 FoldersSelect “Files and Folders” from the “Resources” menu on the left pane.

Add filesClick on the [ Add Files ] toolbar button and select the files of your application, use our Sample Application. 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 Sample.exe file you just added. Right click on this file and choose “New Shortcut To -> Installed File”. 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.

5. 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 "36".

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 when creating the new key select "Binary" and type in the "Data" field the number "36".

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.

6. Set launch conditions

Launch ConditionsGo to the "Launch Conditions" tab of the "Launch Conditions" page. If you wish that your application should be installed only on a particular set of operating systems make sure that the rest of the operating systems are not ticked in our view.

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 "Launch Conditions" 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.

7. Add 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.

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, you only have to specify the source for the setup file.

Select "New Package Prerequisite" from the context menu. If you have the "My Application.exe" installation package on your computer you can use the "Use files from disk" 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, let's say, 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.

8. 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 “Resources” options group.

New ExtensionUse the [ New Extension ] toolbar button to create a new extension: "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.

9. 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 Sample.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.

10. Organize 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 "Sample.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" field 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.

11. Set 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.

12. Set package name and some more media options

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

Media Select the “Media” page from the left-side pane and navigate to the Configuration Settings Tab. Set "MyPackageName" in the "MSI name" 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.

13. 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 - "SAMPLE_PATH" - that will contain the path to the folder in which your application will be deployed.

EnvironmentSelect “Environment” from the “System Changes” 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.

14. 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 "Custom Behavior" group in order to add a Custom Action. Select the "Install Execution Stage" -> "Add Resources" action group in the left-side pane. Choose from the toolbar “Launch installed file”. Select from the FilePicker dialog the "Sample.exe" file (you included this earlier in your project).

Custom Actions

In the command line field pass the string "foofile". The effect is that Sample will try to open this file; if "foofile" doesn't exist on the target machine, Sample 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.

15. 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 “Resources” option group.

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

Services

You can control your service or any other service installed on the target machine during installation. The above operations installed both the service and the service control. 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.

16. 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 “Requirements” 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.

17. Set the UI appearance of your installation package

In this step we will change the UI appearance of the package.
Go to the "Themes" page in the "User Interface" group.
In the "Preview" tab you can change the banner showed 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 expanding “More options” and double-clicking “DialogBitmap” or “BannerBitmap”.

NoteFor more information please see the Themes page.

The End

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