If your Visual Studio Tools for Office solution must be usable offline, you have two main options:
Deploying to Each User's Computer
To deploy a document-level customization to each end user's computer
-
Update the embedded application manifest so that it uses an environment variable to point to the assembly. Instead of using a specific drive letter and path, use %ProgramFiles% or %UserProfile% to begin the path. For example, the path might look like this:
%ProgramFiles%/MyApplication/MyApplication.dll
For more information about updating the assembly path in an embedded application manifest, see How to: Update Application Manifest Assembly Paths Programmatically.
-
Copy the document and the assembly to each end user's computer. You can create a Setup program to install the files by using an application such as Microsoft Windows Installer. For more information, see Deploying Applications and Components.
For articles that describe how to create and use a Setup project to deploy a document-level customization, see "Deploying Visual Studio 2005 Tools for Office Solutions Using Windows Installer (Part 1 of 2)" (http://go.microsoft.com/fwlink/?linkid=57779) and "Deploying Visual Studio 2005 Tools for Office Solutions Using Windows Installer: Walkthroughs (Part 2 of 2)" (http://go.microsoft.com/fwlink/?linkid=57780).
Note |
|---|
| To set an environment variable on the user's computer during installation, add a value to the key HKLM\System\CurrentControlSet\Control\Session Manager\Environment. The user must restart the computer after installation before the new value is recognized. |
-
Update the security policy on the computer to grant full trust to the assembly, and any dependent assemblies. For more information, see How to: Grant Permissions to Folders and Assemblies.
To deploy an application-level add-in to each end user's computer
-
Update the application manifest that is created when you build the solution so that it uses an environment variable to point to the assembly. Instead of using a specific drive letter and path, use %ProgramFiles% or %UserProfile% to begin the path. For example, the path might look like this: %ProgramFiles%/MyAddIn/MyAddIn.dll
The assembly path is specified by the codebase attribute of the installFrom element, which is a child of the dependency element. For more information, see <installFrom> Element (Visual Studio Tools for Office Reference).
-
Copy the assembly and the application manifest to each end user's computer. You can use the default Setup project that is included with your add-in project. For more information, see Setup Projects for Application-Level Add-ins.
Note |
|---|
| To set an environment variable on the user's computer during installation, add a value to the key HKLM\System\CurrentControlSet\Control\Session Manager\Environment. The user must restart the computer after installation before the new value is recognized. |
-
Update the security policy on the computer to grant full trust to the assembly, and any dependent assemblies. For more information, see How to: Grant Permissions to Folders and Assemblies.
Deploying to a Web Server
If you deploy an assembly to a network location and you want it to be cached to the user's local computer for offline use, the assembly must be located on a Web server and accessed through an HTTP or HTTPS path. You cannot use a UNC path or mapped network drives for offline solutions, unless you use IntelliMirror to synchronize folders instead of relying on the Internet Explorer cache. For more information, see Offline Model for Office Solutions.
Make sure that the application manifest and deployment manifest use the correct HTTP or HTTPS path to the assembly. If you use the Publish Wizard, the manifests are created for you. For more information, see Deploying Document-Level Customizations and Deploying Application-Level Add-ins.
To set the assembly path
See Also