MSI-based web deployment and updating
for Internet Explorer browser extensions
MSI-based web deployment - ClickTwice :)
Add-in Express provides its own MSI-based Web deployment technology, aka ClickTwice :) . Unlike ClickOnce, it allows both standard users and admins to run MSIs from the web (Internet and Intranet) for installing and updating per-user and per-machine IE extensions.
You use ClickTwice :) to deploy an IE extension over the web. This technology allows using your favorite installation software to create an .MSI installer. In case you develop your setup project in Visual Studio, see Creating MSI installers. When you have got the .MSI installer, open the Publish dialog of your Internet Explorer extension project.
Build the plug-in project and choose Publish ADX Project in the context menu or in the Project menu.
This opens the dialog window shown in the screenshot below.
Specifying the path to the .MSI installer in the Publish dialog fills in some fields in the upper part of the dialog.
You may publish the installer to a file share or FTP server; publishing to an IIS is not supported. When publishing the installer, the Publishing location can be 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:
The location from which users download and run the installer may differ from the location where you initially published 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 installer. 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 http://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 will be empty when you open the Publish wizard next time.
You can specify an icon in the Icon file field. The icon will be shown in the downloader window, which is displayed when the installer 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 for the certificate (optional).
Click the Preferences button to open the Preferences dialog.
The dialog allows you to specify if the Windows installer UI will be shown during installation / uninstallation. Also, it allows specifying an arbitrary string such as the URL of a web page. That string will be returned by the CheckForUpdates method, see Updating an IE Extension via ClickTwice :). This allows implementing custom update logics, welcome pages, information pages, etc.
Open the Prerequisites dialog and select the prerequisites required by your Internet Explorer extension.
You must choose the following prerequisites for installing on a clean PC:
Everything is ready; let's click the Publish button.
This generates files discussed below.
Files generated by ClickTwice :)
In the process of publishing controlled by the Publish wizard, you specify the .MSI installer to be published as well as the location where subsequent updates of your IE extension will be located. The wizard generates the folder structure demonstrated in the screenshot below:
Below, we describe every folder shown in the screenshot.
The root folder of the folder structure created by the Publish wizard is the Publish folder; you can specify any other folder, of course. version-info.xml describes all updates available for the given product. A sample version-info.xml is shown below:
Language-specific folders (1033 etc.)
Folder 1033 in the screenshot below is named according to the language code of the installer UI. A list of language codes (or Locale Ids) can be found here.
Version-specific folders (1.0.0 & 1.0.1)
These folders are named according to the version of your .MSI installer; see the Version property of the setup project in VS. You see the content of such a folder in the screenshot below:
The folder includes the following files:
Every Add-in Express module provides the CheckForUpdates method. When your IE extension calls it, the version_info.xml is downloaded via HTTP and parsed. If there are no updates, CheckForUpdates returns an empty string. If there are new updates, CheckForUpdates finds the latest update and returns either the URL of the corresponding setup.exe (if it exists) or the downloader.
Note.To implement custom update logics, welcome pages, information pages, etc., you may choose CheckForUpdates to return an arbitrary string; see Preferences.
The code sample below demonstrates installing a new version of your IE extension programmatically.
The code is based on three methods.
In the code above, we use CreateProcess to launch the executable specified in the update URL. The code runs Internet Explorer in the same integrity level as the host application. Of course, you can use your code to initiate updates on the target machine. E.g. you can use the Process class to launch the default browser providing it with the URL returned by CheckForMSIUpdate.
Note. In the sample code above, we specified the full path to iexplore.exe (which is the Internet Explorer application) in the CreateProcess method. However, this approach does not work for Internet Explorer 6. In this case, you can specify the full path to explorer.exe (which is the Windows Explorer application). Many thanks to Aaron for the suggested workaround!