Renat Tlebaldziyeu

Deploying per-user Office extensions via ClickOnce

In part 4 of the deployment series I will show you how to deploy your per-user Office extension using ClickOnce. Before we proceed, I recommend that you read Part 1 for a brief overview of all deployment technologies.

Step 1. Set RegisterForAllUsers = false

If you develop a COM add-in or an RTD server, set the RegisterForAllUsers property of your AddinModule or RTDServerModule to False, otherwise go to Step 2.

Set RegisterForAllUsers = false

Step 2. Fill the Assembly information

Fill in the obligatory fields of the Assembly information as shown in the screenshot below:

Assembly information dialog

Step 3. Build your project

If you want to support 32-bit and 64-bit applications of Office 2010, set the Platform target property to “Any CPU” before building your project.

Set the Platform target property

Note! If you use a 32-bit component in your Office extension (say a native-code DLL, ActiveX DLL, or .NET assembly), you should compile with the “x86″ target platform. But please keep in mind that your Office extension will work in Office 2000 – 2010 (32-bit) only and will not work in Office 2010 (64-bit).
Similarly, if you use any 64-bit third-party components, you should compile with “x64″ but your Office extension will work in Office 2010 (64-bit) only.
Summing up, if you use a bitness-aware component, your extension will work for Office versions of that bitness only.

Step 4. Open the publish dialog

Select your project in the Solution Explorer window and choose Publish ADX Project in the project context menu.

Publish ADX Project menu item

In the opened Publish dialog, switch to the ClickOnce deployment tab.

Publish dialog, ClickOnce deployment tab

Step 5. Populate files

Click the Populate button. This creates the Publish\{AssemblyVersion} folder and copies all files and dependencies of the Office extension (as well as the Add-in Express loader and its manifest) into that folder.

Publish directory

Step 6. Add additional files (optional)

If you want to add additional files and/or folders, copy the files and folders required by your project to the Publish/<AssemblyVersion> folder and click the Populate button again.

Step 7. Set application icon (optional)

You can add a .ico file and mark it as Icon File in the Type column of the Files listbox. This icon will be shown in the ClickOnce installer window and Windows Start menu.

Set application icon

Step 8. Set the “Provider URL”

In the Provider URL field, enter the location of the deployment manifest using one of the following formats:

  • web-site: http://<www.website.com>/<deployment manifest name>.application
  • a Virtual Directory: http://localhost/<deployment manifest name>.application
  • an FTP server: ftp://<ftp.domain.com>/<deployment manifest name>.application
  • a file path: C:\<folder>\<deployment manifest name>.application
  • a UNC path: \\<server>\<deployment manifest name>.application

Note! <deployment manifest name> must be in the lower case.

Step 9. Sign the installer files

Browse for the existing certificate file (.pfx or .p12) or click New to create a new one. Enter the password of the certificate if there is any.

Step 10. Set preferences (optional)

Click the Preferences button to open the following dialog window:

Preferences dialog

In this dialog, you can allow showing your custom or the built-in UI and specify the Support Location, which will provide users with additional information about your product in the Add/Remove dialog (called Programs and Features since Vista).

Step 11. Prerequisites (optional)

Click the Prerequisites button to specify the prerequisites of your Office extension.

Prerequisites dialog

Step 12. Click the Publish button

Upon clicking the Publish button the wizard generates (updates) the manifests:

Deployment manifest – <SolutionFolder>/Publish/<projectname>.application

Application manifest – <SolutionFolder>/Publish/<AssemblyVersion>/<ProjectName>.exe.manifest

Publish directory

Step 13. Upload files and folders

Upload the following files and folders to the location you specified in the Provider URL field:

- files and folders of the Publish\{AssemblyVersion} folder;

- the deployment manifest ({projectname}.application);

- setup.exe.

Note! For testing purposes, you can just double-click the deployment manifest in Windows Explorer.

Step 14. Running the installer

To run the installer, the user needs to open the deployment manifest (<projectname>.application) in Internet Explorer or Windows Explorer.

Runing the installer

In the “Application Install – Security Warning” dialog you click the Install button.

Application install - Security Warning

Clicking the Install button opens the ClickOnce installer window (see the screenshot below):

ClickOnce installer window

Users will see this dialog when the installation is completed successfully:

Registration succeeded dialog

Please note that ClickOnce doesn’t provide any opportunity to customize or hide dialogs and messages shown while the user is installing or updating your add-in.

Step 15. Register/unregister or uninstall the Office extension

To unregister or re-register your Office extension, the user browses for the deployment manifest (<projectname>.application) in Internet Explorer or Windows Explorer and runs it. This opens the dialog below, where the user can click either Unregister or Register.

ClickOnce setup dialog

Note! You can add the ClickOnce module to your project to show a custom dialog instead of the above dialog.

To uninstall your product, the user uses the standard features of operating system, Control Panel -> Add or Remove programs (Programs and Features since Vista).

Maintenance dialog

Step 16. Installing a new version of the Office extension

Please see Redeploying per-user Office extensions via ClickOnce.

2 Comments

Post a comment

Have any questions? Ask us right now!