Creating a Professional PackageThis 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:
Create the projectIf 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.
Select Professional and press the OK button. The new project has been created and from now on you will edit it.
English is the default project language, but you can change it to any of the languages known by Advanced Installer. Enter product detailsNow 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.
For further information about this page please see Product Details. Set the install parametersYou now have the general information on the Product Details page filled in.
Set the default installation paths for the "Application Folder" and "Application Shortcut Folder" by using the combo boxes or the button. You can edit these fields, but the values from the combo boxes are the most common ones.
Add files and folders to your projectThe 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".
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.
Add registry keys and values to your packageLet's suppose that your application needs two registry entries. These are located in the "Software\[Manufacturer]\[ProductName]\Settings" key.
In the tree, select the "Software\[Manufacturer]\[ProductName]" key.
In the "Name" text field enter the name of your first key: "AppPath". Use the 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".
Once the registry keys and values are added, you can see them in the right-side pane of the view.
Set the 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:
Condition: FILE Installing PrerequisitesLet'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.
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 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.
After the properties of the prerequisite have been set you need to set the detection criteria by using the Install Conditions tab.
Since the prerequisite application creates a registry entry, we can use it as a detection criteria in the Searches section.
Create new file extensions and make file associationsYour 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.
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.
You can add as many verbs as you want for an extension.
Build and InstallYou 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 featuresYou 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.
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.
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.
Set the dialogs to guide the user during install
Here you can select the dialogs that appear during install. In our example, you will add two more dialogs:
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 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.
Build and test the package again.
Set the name of your package and some more media optionsIn this step you set the name of the package that will be generated.
Add environment variables to your projectLet'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.
Add custom actions to your installation packageCustom 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.
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.
Install and control servicesIn this step, we will define the services to be installed with your application. You can only install services that are part of your package.
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.
Add merge modules to your projectLet'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.
Set the UI appearance of your installation packageIn this step we will change the UI appearance of the package.
The EndThis concludes our tutorial. To learn more, please read the Other Languages tutorial. | |
|
| Privacy Policy | Windows Installer | Search Engine Ranking | Link Analyzer | ||
| © 2002 - 2008 Caphyon Ltd. Trademarks belong to their respective owners. All rights reserved. | ||