20 May 2012

Create Basic Install

The following is a tutorial on how create a basic installation package that installs some application files and registry entries. Initially we will create a .msi installation package. Later we will add a setup.exe bootstrapper to improve the visual appearance.

Create a new project

  • Run MSIStudio and select New Project from the File Menu. We are going to use the project wizard for this tutorial so select Setup Wizard from the main list and set the name to ACMEProduct. Set the Location field to a folder of your choice such as C:\TEMP.

  • Within the Setup Wizard, click past the Welcome page. In the Project Type page select the option to create a naive MSI package and click Next.

  • In the General Information page, set the company name to 'ACME Software', the product name to 'ACME Product 1.0', and leave the other fields to their default value. As this is the first version of the product we leave the version at 1.0 and as it's a single English language install, leave the language as (Neutral). Click Next.

  • On the Project Files page we are going to add some files to the setup. Click the Add button and navigate to the Tutorials/Basic Project subfolder of the MSIStudio install location. Select the files 'FirstApplication.exe' and 'ACME Product.txt'. Click Next.

  • Next is the shortcuts page and we would like to create some shortcuts for our application so select the top 2 check boxes on the Project Shortcuts page. The main application file we selected earlier will be used as the target for the shortcuts. Click Next.

  • We would like to have a full user interface so check all 3 boxes on the User Interface page. For the license agreement file, select the file ACME License.txt in the Tutorials/Basic Project folder. Click Next.

  • A review of the choices made in the wizard is presented. Click Finish to generate the project.

Note that an installation package can be configured to run on either 32-bit or 64-bit Windows but not on both. A new project will be assigned a target platform to match the operating system MSIStudio is being run on. For example, if a setup is being developed and tested on 64-bit Windows 7, to get it to run on 32-bit Windows XP, the target platform will need to be changed manually. This setting can be modified in the Release\Compatibilty settings page.

Add a Registry entry to the setup

  • Open the Registry screen using the navigation toolbar button. Create a key under HKEY_LOCAL_MACHINE/SOFTWARE called 'ACME Software'. Create a string value and set the name propery to 'Sample Key' and the value to 'Sample Value'.

Build and run the project

  • Press F7 to build the project. It should build with no errors or warnings.

  • Press CTRL+F5 to run the project. The Windows Installer wizard will appear in the center of the screen. Step through the installation wizard to install the product. On the Windows Start Menu/Programs/ACME Software folder there will be an icon for our new product and also an uninstall icon. Select the application icon and the main test application will run. Close the application and then select the uninstall icon to uninstall the application from the system.

Using a bootstrapper

A bootstrapper is an exe file that is used to initiate the installation. As an executable it can perform some other tasks before ultimately handing control over to Windows Installer to install the application. In our sample, we are going to use it to display a nice background window with our company name and image. Also, we would like to use the same icon for the setup.exe as we use for our application.

  • Open the Release Manager from the toolbar. This will bring up an options dialog for Default Release, the release that is created with the initial project. Click on General and set the 'Output Type' to 'Setup.exe only'. Click on Visuals, and enable the 'Specify Setup.exe icon' checkbox. Set the icon file to the FirstApplication.exe. At build time, this will extract the icon from the executable and set it to be the icon for the bootstrapper. MSIStudio can extract icons from any icon file or executable for this purpose.

  • Enable the Display Background Image check box and set the image file to the file 'SoftBlue.jpg' in the Tutorials/Basic Install folder.

  • Rebuild the project. Click the 'Open Release Folder' icon from the toolbar and note how the icon has changed to our application icon. Run the installation now. A full screen background window will appear with the product name in the top corner and the regular installation wizard will appear in the foreground. Note that when uninstalling via the uninstall icon or via the Control Panel Add Remove Programs applet, the bootstrapper is not invoked and just the native Windows Installer user interface is displayed. This is because Windows only caches the .msi file on product installation.