Add-in Express 2010 MSI-based web deployment: Publishing the application, part 2

In the first article of this series I covered the basics of our Add-in Express 2010 MSI-based web deployment, also known as ClickTwice :) and gave you a step-by-step guidance on creating a new setup project. Now we are going to look at the main aspects of publishing the application using this deployment technology.

At this point, all is done for project publication and you can choose 'Publish ADX Project' in the project context menu. Since Add-in Express provides MSI-based Web deployment, you need to specify the path to an msi database. The msi database can be created using the Visual Studio setup project as well as any third party installers like Wise or InstallShield. So, you just need to click a button to the right of the 'Installer file' edit box to open a database file (.MSI). The wizard will read some general info about the database and fill in some fields in the upper part of the dialog.

Publishing a project: retrieving information from a database file

To make an application available to users, you shall publish it to a Web server, file share, or removable media. When publishing the project, the 'Publishing location' field specifies the location of the application files. It can be a URL for an IIS Virtual Directory, a file path, or a path to an FTP server. By default, the Publish wizard suggests publishing your application to the MSIPublish subfolder in the project directory. In 'Publishing location', enter the location using one of the following formats:

  • To publish to a Virtual Directory, enter the URL using the format https://localhost/ApplicationName (ApplicationName is a virtual directory created in the IIS manager).
  • To publish to a file share, enter the path using either a UNC path (\\Server\ApplicationName) or a file path (C:\Deploy\ApplicationName).
  • To publish to an FTP server, enter the path using the format ftp://ftp.domain.com/ApplicationName

Note. In some cases the URL of a virtual directory may not work when you open it via a browser. In this case you need to replace 'localhost' with '127.0.0.1' IP address.

When publishing an application, be aware that the location from which users download and install the application is not necessarily the location where you initially publish it. For example, in some organizations a developer might publish an application to a staging server, and then an administrator can move the application to a Web server.

In this case, you can use the 'Installation URL' field to specify the Web server to which users will go to download the application. This step is necessary for Add-in Express to know where to check for updates. In 'Installation URL', enter the installation location using a fully qualified URL in the format 'https://www.domain.com/ApplicationName', or a UNC path using the format '\\Server\ApplicationName'.

Note. If 'Publishing location' and 'Installation URL' are the same, 'Installation URL' becomes empty when you open the Publish wizard next time.

You can also set an icon for your application in the 'Icon file' field. It will be shown in the downloader window, which is displayed when the application installation is downloaded from the installation location.

To sign the installation files, browse for the existing certificate file or click New to create a new one. Enter the password of the certificate (optional).

Publishing a project: signing the installation files

Add-in Express provides some additional options to control the installation process.

To show / hide the Windows installer UI during installation / uninstallation, you can check the appropriate options in the Preferences dialog. You can also specify a web page that will provide users with additional information about available updates.

Preferences dialog

When you click the Prerequisites button and select any prerequisites in the dialog, Add-in Express gathers the prerequisites you’ve chosen and creates a setup.exe to install them. When the user runs the setup.exe, it installs the prerequisites and invokes the Add-in Express downloader program to install  / update your add-in.

Prerequisites dialog

When you click Publish, the wizard publishes the application to the location specified in the Publishing location field. In our case it is the MSIPublish subfolder of the add-in project.

Publishing directory in Windows Explorer

Let's look at the files that have been created by the wizard. First of all, it is the version_info.xml file. The content of the file is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<application name="myaddin1">
<product language="1033">
<version name="1.0.0" installationUrl="D:\Projects\MyAddin1\MyAddin1\MSIPublish" productCode="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" updateType="directLink">
<files msi="MyAddin1Setup(1033)">
<file>MyAddin1Setup(1033).msi</file>
 </files>
<preferences>
<showInstallUI>true</showInstallUI>
<showUninstallUI>false</showUninstallUI>
<webPage />
</preferences>
</version>
</product><product language="…">
<version name="…"

</version></product></application>

This file provides information about all published versions of the product. It is used by the Add-in Express code to find out if any updates are available. It is also used by the downloader program during the installation process.

All published versions of the product are placed into separated subfolders under the installation URL. In our case it is the .\1033\1.0.0 folder, where 1033 is the locale id and 1.0.0 is the version of the installation package. The version folder contains all files that are ready to be installed on the end-user's PC.

Publishing location structure

The setup.exe program is added to the version folder when the 'Create setup program to install prerequisites components' option is enabled in the Prerequisites dialog. So, in order to install any specific version of your add-in, you just need to provide the whole URL of the installation. In our case it will be:

  • if prerequisites are included:

 'https://mywebsite/applications/myaddin1/1033/1.0.0/setup.exe'.

  • if prerequisites are not included:

 'https://mywebsite/applications/myaddin1/1033/1.0.0/myaddin1.exe'.

Now you can click the Install button in the Publish wizard to test the installation. The Publish wizard will run the downloader program (myaddin1.exe above).

Downloader UI

The downloader program downloads the msi database and initiates the installation. Everything else is done by the Windows Installer.

Installation wizard

In Vista or Windows 7, when the application is installed for all users, and you run the installation under a non-admin account, the UAC message pops up to ask for administrator credentials.

To uninstall the application, you can use the 'Add or Remove Programs' dialog of the Control panel or just click Uninstall in the Publish wizard.

Uninstalling the application

That’s all for now. In the next, and final part of this series, we will look into managing updates of your applications.

You may also be interested in:

Add-in Express 2010 MSI-based web deployment – ClickTwice, part 1
Add-in Express 2010 MSI-based web deployment: Managing updates, part 3

Post a comment

Have any questions? Ask us right now!