Use Add-in Express and VSTO Loaders to create
setup projects manually in Visual Studio .NET
Add-in Express
for Microsoft .net
Add-in Express Home > Add-in Express.NET > Online Guide > Creating setup projects manually
Creating setup projects manually
We don't recommend that you create setup project manually because you always can create them 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 instructions.
Add-in Express Loader
To create the setup project manually, please follow the steps below.
Add a new setup project
Right-click the solution item and choose Add | New Project.

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

File system editor
Right-click the setup project item (Setup1 in the screenshot above) and choose View | File System.
Primary output
Right-click the Application Folder item and choose Add | Project Output

In the Add Project Output Group dialog, select the Primary Output Item of your Add-in/RTD Server/Smart Tag project and click OK.

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

Select AddinExpress.MSO.2005.tlb (or AddinExpress.MSO.2003.tlb in Visual Studio 2003) and, in the Properties window, set the Exclude property to True.

Extensibility.dll
Add the Extensibility.dll assembly to the Application Folder if it doesn’t exist in the Detected Dependencies section of the setup project

Project-depended resources
Now you add all resources (e.g. assemblies, dlls or any resources) required for your project.
Add-in Express Loader and manifest
Add the adxloader.dll and adxloader.dll.manifest files from the ‘Loader’ subfolder of the add-in project directory to the ‘Application Folder’ of the setup project.

Custom actions
Open the Custom Actions editor and add a new action to the Install, Rollback, Uninstall sections. Use the adxloader.dll file as an item for the custom actions.

EntryPoint
Add the following parameter to the EntryPoint property of the following custom actions:
- Install
DllRegister
- Rollback
DllUnregister
- Unistall
DllUnregister

Dependencies
Right click on the Detected Dependencies section of the setup project and choose the Refresh Dependencies option. Also, exclude all dependencies that are not required for your setup.
Visual Studio 2005 only
Right click on the setup project and open the Properties dialog. Click on the Prerequisites button and, in the Prerequisites dialog, check all prerequisites you need. You can choose the ‘Download prerequisites from the same location as my application’ option to distribute all prerequisites with the add-in installation package.
Deploy
Rebuild the setup project. See Project wizard options for more details. Copy all setup files to the target PC and run the setup.exe file to install the add-in.
VSTO Loader
To create the setup project manually, please follow the steps below.
Add a new setup project
Right-click the solution item and choose Add | New Project.
In the Add New Project dialog, select the Setup Project item and click OK. This will add the setup project to your solution.

File system editor
Right-click the setup project item (Setup1 in the screenshot) and choose View | File System.
Primary output
Right-click the Application Folder item and choose Add | Project Output

In the Add Project Output Group dialog, select the Primary Output Item of your Add-in/RTD Server/Smart Tag project and click OK.

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

Select AddinExpress.MSO.2005.tlb and, in the Properties window, set the Exclude property to True. In the same way, you exclude the following files:
- Microsoft.VisualStudio.Tools.Applications.Runtime.dll
- Microsoft.VisualStudio.Tools.Applications.Runtime.tlb
- VSTOStorageWrapper.Interop.dll
- Microsoft.Office.Interop.SmartTag
- Microsoft.Office.Tools.Common.dll

Exclude all TLBs
Always exclude all TLB files from the setup project except for TLBs that you create yourself.
Extensibility.dll
Add the Extensibility.dll assembly to the Application Folder if it doesn’t exist in the Detected Dependencies section of the setup project.

Project-depended resources
Now you add all resources (e.g. assemblies, dlls or any resources) required for your project.
VSTO Loader manifest
Add the <projectname>.manifest located in the Loader folder of your add-in project to the ‘Application Folder’ of the setup project.

Custom actions
Add the adxregaddin.dll file located in the Redistributables folder of the Add-in Express install folder to the ‘Application Folder’ of the setup project. Open the Custom Actions editor and add a new action to the Install, Rollback, and Uninstall sections. Use the adxregaddin.dll file as an item for the custom actions. Add the following strings to the Arguments property of the following custom actions:
|Install|
/install="[TARGETDIR]\vstoloader.manifest" /displayerrors=1
Rollback
/uninstall="[TARGETDIR]\vstoloader.manifest"
Uninstall
/uninstall="[TARGETDIR]\vstoloader.manifest"
Please, don't forget to set the InstallerClass property of the custom actions to False.

Dependencies
Right click on the Detected Dependencies section of the setup project and choose the Refresh Dependencies option. Also, exclude all dependencies that are not required for your setup.
Prerequisites
Right click on the setup project and open the Properties dialog. Click on the Prerequisites button and, in the Prerequisites dialog, check all prerequisites you need.

You can choose the ‘Download prerequisites from the same location as my application’ option to distribute all prerequisites with the add-in installation package. However, note that if you include them to the setup, a non-admin on Vista will get the elevation dialog and this can end with installing the add-in to the admin profile. In such a case, the add-in will not be available for the standard user.
Deploy
Rebuild the setup project. You may want to run one of the following command lines:
%AddinExpressInstallFodler%\Bin\DisableUAC.exe %BuiltOuputPath% /UAC=On
%AddinExpressInstallFodler%\Bin\DisableUAC.exe %BuiltOuputPath% /UAC=Off
See Project wizard options for more details.
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.
Universal shim - MSCOREE.DLL
Typically, you use this shim when your add-in doesn't have any special requirements to security. The main advantage of using this shim is its simplicity. However, you cannot sign it, and this is its main drawback. If the host application security is set to Medium, High or Very High (Tools | Macro | Security), unsigned add-ins will not start. This shim is included in the .NET Framework. That is, you don't need to include it into your setup project.
If you choose the Create the Setup Project option of the Add-in Express Project Wizard, the wizard will create the setup project automatically.
To create setup project manually, please follow the steps below.
Add a new setup project
Right-click the solution item and choose Add | New Project.

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

File system editor
Right-click the setup project item (Setup1 in the screenshot above) and choose View | File System.
Primary output
Right-click the Application Folder item and choose Add | Project Output

In the Add Project Output Group dialog, select the Primary Output Item of your Add-in/RTD Server/Smart Tag project and click OK.

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

Select AddinExpress.MSO.2005.tlb (or AddinExpress.MSO.2003.tlb in Visual Studio 2003) and, in the Properties window, set the Exclude property to True.

Extensibility.dll
Add the Extensibility.dll assembly to the Application Folder if it doesn’t exist in the Detected Dependencies section of the setup project

Project-depended resources
Now you add all resources (e.g. assemblies, dlls or any resources) required for your project.
AddinExpress.Install.2005.dll / AddinExpress.Install.dll
Add the AddinExpress.Install2005.dll / AddinExpress.Install.dll (for VS 2003) assembly to the Application Folder.


Custom actions
Open the Custom Actions editor and add a new action to the Install, Rollback, Uninstall sections. Use the AddinExpress.Install.dll / AddinExpress.Install.2005.dll (for VS 2005) assembly as an item for the custom actions.

CustomActionData
Add the following parameter to the CustomActionData property of all the custom actions mentioned above depending on your project type.
- COM Add-in
/Addin="[TARGETDIR]\<the add-in assembly name>.dll"
- RTD Server
/RTD="[TARGETDIR]\<the RTD server assembly name>.dll"
- Smart Tag
/SmartTag="[TARGETDIR]\<the smart tag assembly name>.dll"
- Excel Automation Add-in
/Addin="[TARGETDIR]\<the add-in assembly name>.dll"

Dependencies
Right click on the Detected Dependencies section of the setup project and choose the Refresh Dependencies option. Also, exclude all dependencies that are not required for your setup.
Visual Studio 2005 only
Right click on the setup project and open the Properties dialog. Click on the Prerequisites button and, in the Prerequisites dialog, check all prerequisites you need. You can choose the ‘Download prerequisites from the same location as my application’ option to distribute all prerequisites with the add-in installation package.

Deploy
Rebuild the setup project. Copy all setup files to the target PC and run the setup.exe file to install the add-in.
Back to Add-in Express.NET homepage


