Deploying Internet Explorer add-ons: C#, VB.NET.
Create Windows Installer package.

Add-in Express™
for Internet Explorer® and Microsoft® .net

Add-in Express Home > Add-in Express for Internet Explorer > Online Guide > IE add-on deployment - Creating MSI installers

Deploying Internet Explorer add-on - Creating MSI installers

To make the deployment of your IE add-ons as fast and easy as it could possibly be, Add-in Express-based Internet Explorer solutions include setup projects with all necessary prerequisites and advanced actions that you can use to customize the installation process. You create conventional Windows Installer packages (aka .MSI installers) using the Add-in Express Setup Project Wizard that generates localized setup projects. In addition, Add-in Express supports a simple technology of Web-based deployment and update of IE extensions.

Creating an IE add-on installation package automatically

To create an installation package for Windows Installer, you start the setup project wizard via the context menu of your IE add-on project.

Starting a new setup project

The wizard allows specifying all sorts of description strings as well as the location and localization of the setup project.

Setup Project wizard

The Setup Project wizard adds the following setup project to the solution.

Solution explorer

Let's walk through the files.

  • AddinExpress.IE.dll is the Add-in Express assembly.

    The loader files (adxloader.dll, adxloader64.dll and adxloader.dll.manifest) are taken from the Loader folder of your add-on project.

  • adxregistrator.exe is a custom action executable that registers and unregisters the add-on.

  • Interop.SHDocVw.dll and Microsoft.mshtml.dll are interop assemblies.

Note that ieframe.dll and AddinExpress.IE.tlb are excluded. You must exclude all .TLB and .OLB files from the setup project except for .TLBs required for the functionality of your IE extension.

Creating an IE add-on setup project manually

You can always create a setup project with the Add-in Express project wizard when starting a new project. Nevertheless, if you need to create a setup project manually, use the following step-by-step guide.

Add a new setup project

Right-click the solution item in the Solution Explorer window and choose Add | New Project.

IE add-on setup project template

In the Add New Project dialog, select the Setup Project item and click OK. This adds a new setup project to your solution.

File System editor

Right-click the newly added setup project item and choose View | File System in the context menu.

Primary output of an IE add-on

Right-click the Application Folder item and choose Add | Project Output

Adding project output

In the Add Project Output Group dialog, select the Primary output and Localized resources items of your IE add-on project and click OK.

Add project output group dialog

This adds the following entries to the Application Folder of your setup project.

Files in the Application Folder

Select AddinExpress.IE.tlb and, in the Properties window, set the Exclude property to True. Also, exclude the ieframe.dll file in the same way. You may get the following dialog, which you can safely ignore:

Please confirm that all dependencies have been added dialog

Note. Always exclude all TLB and OLB files from the setup project except for TLBs that you create yourself.

Project-dependent resources

Now you add all resources (e.g. assemblies, DLLs or any resources) required for your IE plug-in project.

Add-in Express Loader and its manifest

Add the adxloader.dll, adxloader64.dll and adxloader.dll.manifest files from the Loader subfolder of the add-in project directory to the Application Folder of the setup project.

Add-in Express loader files

MSHTML interop assembly

Add Microsoft.mshtml.dll from the Interop Assemblies folder of the Add-in Express install folder to the Application Folder in the setup project.

Adding Microsoft.mshtml.dll

Custom actions

Add the adxregistrator.exe file from the Redistributables folder of the Add-in Express install folder to Application Folder of the setup project.

Adding the adxregistrator.exe file

Open the Custom actions editor and add a new action to the Install, Rollback, Uninstall sections. Choose adxregistrator.exe as an item for the custom actions.

Adding custom actions

Add the following values to the Arguments properties of the following custom actions:

  • Install
    /install="MyIEAddon1.dll" /privileges=admin
  • Rollback
    /uninstall="MyIEAddon1.dll" /privileges=admin
  • Uninstall
    /uninstall="MyIEAddon1.dll" /privileges=admin

Please replace the "MyIEAddon1.dll" strings above with the file name of your add-on.

Dependencies

Right click on the Detected Dependencies section of the setup project and choose Refresh Dependencies. Also, exclude all dependencies that are not required for your setup.

PostBuildEvent

Set this property of the setup project as follows:

{Add-in Express folder}\Bin\adxpatch.exe" "$(BuiltOuputPath)" /UAC=On

Prerequisites

Right click on the setup project and open the Properties dialog.

Click on the Prerequisites button and, in the Prerequisites dialog, check all needed prerequisites.

Prerequisites dialog

You can choose the ‘Download prerequisites from the same location as my application’ option to distribute all prerequisites with the IE add-on installation package.

IE Bar only

Absolutely all the steps above are applicable also for an IE bar if it is installed for all users on the PC. But IE Bar is the only IE extension type installable by a standard user. For your IE bar to be installed by a standard user, you need to set the RegisterForAllUsers property of the ADXIEBarModule in your IE bar project to false and change the setup project as follows (pay attention to the text in bold):

PostBuildEvent

{Add-in Express folder}\Bin\adxpatch.exe" "$(BuiltOuputPath)" /UAC=Off

DefaultLocation

Right-click the setup project item in the Solution Explorer window, choose View | File System in the context menu, click Application Folder and set the DefaultLocation property as follows:

[AppDataFolder][Manufacturer]\[ProductName]

Custom actions

  • Install
    /install="MyIEBar1.dll" /privileges=user
  • Rollback
    /uninstall="MyIEBar1.dll" /privileges=user
  • Uninstall
    /uninstall="MyIEBar1.dll" /privileges=user

Please replace the "MyIEBar1.dll" strings above with the file name of your IE bar.

Deploy your IE add-on

Rebuild the setup project. Copy all setup files to the target PC and run the msi file to install the add-in. However, to install Prerequisites, you will need to run setup.exe.

Creating a WiX setup project automatically

The below is a minimal introduction to using WiX to deploy an IE extension created with Add-in Express. As you understand, it is not possible to describe all the features provided by WiX.

The setup project wizard creates a WiX project containing just one file called Product.wxs. The file is the source of the configuration information (in the XML format) for the WiX binaries mentioned in the References section of the WiX project.

The product to be installed is described in the tag Product.


		<Product 
		  Id="69553541-790c-4326-a49e-657c5fd31596" 
		  Name="MyIEAddon1" 
		  Language="1033" 
		  Version="1.0.0" 
		  Manufacturer="MyIEAddon1" 
		  UpgradeCode="69553541-790c-4326-a49e-657c5fd31597" 
		  Codepage="1252">
		  
		  <Package 
			InstallerVersion="200" 
			Compressed="yes" 
			InstallScope="perMachine" 
			Description="MyIEAddon1"
			Manufacturer="MyIEAddon1"
			Languages="1033"
			SummaryCodepage="1252" 
			InstallPrivileges="elevated"
		  />

		  <!-- Properties for all current versions of the .NET Framework are available
			here: http://wix.sourceforge.net/manual-wix3/wixnetfxextension.htm -->
		  <PropertyRef Id="NETFRAMEWORK40CLIENT"/>
		  <Condition Message="This application requires .NET Framework 4.0. Please install the .NET Framework then run this installer again.">
			<![CDATA[Installed OR NETFRAMEWORK40CLIENT]]>
		  </Condition>
		</Product>
		

The set of important tags describes custom actions which register and unregister your IE extension:


		<Binary Id="adxregistrator_exe"
			SourceFile="$(var.ADX_PATH)\Redistributables\adxregistrator.exe" />

		<CustomAction Id="RegisterDll" BinaryKey="adxregistrator_exe" Execute="deferred"
			ExeCommand='/install="[INSTALLFOLDER]$(var.MyIEAddon1.TargetFileName)" /privileges=admin /returnExitCode=false'
			Impersonate="yes" />

		<CustomAction Id="UnregisterDll" BinaryKey="adxregistrator_exe" Execute="immediate"
			ExeCommand='/uninstall="[INSTALLFOLDER]$(var.MyIEAddon1.TargetFileName)" /privileges=admin'
			Impersonate="yes" Return="ignore" />

		<InstallExecuteSequence>
		  <Custom Action="RegisterDll" After="SelfRegModules">NOT Installed</Custom>
		  <Custom Action="UnregisterDll" After="SelfUnregModules">Installed</Custom>
		</InstallExecuteSequence>
		

And finally, there're tags describing files that will be delivered to the target PC. The minimum set of files includes:

  • your assembly
  • loader manifest
  • 32bit loader
  • 64bit loader
  • Interop for IE
  • Interop for MSHTML
  • AddinExpress.IE.dll

		<Fragment>
		  <ComponentGroup Id="ProductComponents" >
			<Component Id="ProductComponent"
				Guid="758f473a-e9a4-4029-8e91-4d6e5489eebf"
				DiskId="1" Directory="INSTALLFOLDER" >
			  <RegistryKey Root="HKLM" Key="Software\[Manufacturer]\[ProductName]">
				<RegistryValue Type="string" Name="Installed" Value="[INSTALLFOLDER]" />
			  </RegistryKey>
			  <File Id="$(var.MyIEAddon1.TargetName)_dll"
				Name="$(var.MyIEAddon1.TargetFileName)"
				Source="$(var.MyIEAddon1.TargetPath)" />
			  <File Id="adxloader_dll_manifest"
				Name="adxloader.dll.manifest"
				Source="$(var.MyIEAddon1.ProjectDir)Loader\adxloader.dll.manifest" />
			  <File Id="adxloader_dll"
				Name="adxloader.dll"
				Source="$(var.MyIEAddon1.ProjectDir)Loader\adxloader.dll"
				KeyPath="yes" /> 
			  <File Id="adxloader64_dll"
				Name="adxloader64.dll"
				Source="$(var.MyIEAddon1.ProjectDir)Loader\adxloader64.dll" />
			  <File Id="Interop_SHDocVw_dll"
				Name="Interop.SHDocVw.dll"
				Source="$(var.MyIEAddon1.TargetDir)" />
			  <File Id="Microsoft_mshtml_dll"
				Name="Microsoft.mshtml.dll"
				Source="$(var.MyIEAddon1.TargetDir)" />
			  <File Id="AddinExpress_IE_dll"
				Name="AddinExpress.IE.dll"
				Source="$(var.ADX_PATH)\Bin\" />
			</Component>
		  </ComponentGroup>
		</Fragment>
		
		

Please refer to the WiX manual for more information.

Tips on Internet Explorer add-ons <<

>> MSI-based web deployment - ClickTwice :)