Dmitry Kostochko

HowTo: Install a COM add-in automatically using Windows Server Group Policy

Every successful development project ends with its installation. This post will be useful for developers as well as for domain administrators. Here you will get to know how to use Windows Server 2000 – 2008 Group Policy for deploying and installing applications automatically, including automatic installation of COM add-ins for Microsoft Office. This technology makes corporate deployment of your Office COM add-ins a gain with no pain.

Let's proceed to step-by-step instructions on how to use Group Policy to automatically distribute a COM add-in to domain users.

Create a Distribution Point

To install an add-in, you need to create a distribution point on a publishing server:

    1. Log on to a Windows Server as an administrator.
    2. Create a shared network folder where you will place the MSI package that you want to install.
    3. Set permissions on the share to allow access to the installation package.
    4. Copy the MSI package to the distribution point.

Create a Group Policy object in Windows Server 2000 and 2003

Use a Group Policy object (GPO) to install the software package. Here are 9 easy steps to create it:

    1. Start the Active Directory Users and Computers snap-in (Start -> All Programs -> Administrative Tools -> Active Directory Users and Computers).
    2. Right-click on your domain in the console tree, and then choose Properties.
    3. Switch to the Group Policy tab, and then click New.
    4. Type the name you want for this policy (e.g. My Addin Distribution), and then press ENTER.
    5. Click Properties, and then switch to the Security tab.
    6. Click the Add button to add security groups or users to the list.
    7. Unselect the Apply Group Policy check box for those groups or users that you don't want this policy to apply to.
    8. Select the Apply Group Policy check box for the groups or users that you want this policy to apply to.
    9. When you get through, click OK.

Create a Group Policy object in Windows Server 2008

To create a Group Policy object (GPO) that you'll use to install the software package:

    1. Start the Group Policy Management snap-in (Start -> Administrative Tools -> Group Policy Management).
    2. Right-click on your domain in the console tree, and then choose Create a GPO in this domain, and Link it here.
    3. Type the name you want to call this policy (e.g. My Addin Distribution), and click OK.
    4. Expand the Group Policy Objects item and select the newly added policy.
    5. Click the Remove button to delete the Authenticated Users security group.
    6. Click the Add button to add security groups or users.

Assign the installation package

To assign software to users that are logging on to Windows 2000 and higher workstations:

    1. Windows Server 2000/2003. Start the Active Directory Users and Computers snap-in.
    Windows Server 2008. Start the Group Policy Management snap-in.
    2. Windows Server 2000/2003. Right-click your domain in the console tree, click Properties, switch to the Group Policy tab, select the group policy object that you want, and then click Edit.
    Windows Server 2008. Locate and expand your domain in the console tree, then expand Group Policy Objects, right-click on the group policy object that you want, and then click Edit.
    3. The Group Policy Object Editor will start.
    4. Windows Server 2000/2003. Expand Software Settings under User Configuration.
    Windows Server 2008. Under User Configuration, expand Policies, then Software Settings.
    5. Right-click Software installation, point to New, and then click Package.
    6. In the Open dialog box, type the full Universal Naming Convention (UNC) path to the shared folder with the MSI package that you want (e.g. \\server\share\setup.msi).
    Warning. If the Windows Installer file resides on the local hard disk, do not use a local path. You need to use the UNC path to indicate the location of the installation files.
    7. Click Open.
    8. Click Assigned, and then click OK. The package will be listed in the right pane of the Group Policy window.
    9. Right-click the package, click Properties, switch to the Deployment tab.
    10. Select the Install this application at logon check box, and click OK.
    11. Close the Group Policy Editor, then quit the Active Directory Users and Computers or Group Policy Management snap-in. When the user logs on, the managed software package is automatically installed.

Remove the installation package

To remove a package:

    1. Windows Server 2000/2003. Start the Active Directory Users and Computers snap-in.
    Windows Server 2008. Start the Group Policy Management snap-in.
    2. Windows Server 2000/2003. Right-click your domain in the console tree, click Properties, switch to the Group Policy tab, select the group policy object that you want, and then click Edit.
    Windows Server 2008. Locate and expand your domain in the console tree, then expand Group Policy Objects, right-click on the group policy object that you want, and then click Edit.
    3. The Group Policy Object Editor opens.
    4. Windows Server 2000/2003. Expand Software Settings under User Configuration.
    Windows Server 2008. Under User Configuration, expand Policies, then Software Settings.
    5. Select the Software installation container with the package.
    6. In the right pane of the Group Policy window, right-click the package, point to All Tasks, and then click Remove.
    7. Click Immediately uninstall the software from users and computers, and then click OK.
    8. Close the Group Policy Editor, then quit the Active Directory Users and Computers or Group Policy Management snap-in.

NOTE: Such kind of installation requires client computers that run Microsoft Windows 2000 and higher.

By using the steps above, you can create an automatic installer for your Office 2007 – 2000 COM add-in, in this way making the deployment and installation as easy as they can possibly be.

You can download Microsoft Office Excel and Word add-in samples now by using one of the links below. You'll find setup projects within the Visual Studio solutions.

You may also be interested in:

Deploying Add-in Express based Office COM addins
ClickOnce solution for add-in deployment

Available downloads:

The sample add-ins below were written using Add-in Express for Office and .net

C# sample add-in for VS 2005  
VB.NET sample add-in for VS 2005

2 Comments

  • http://0.gravatar.com/avatar/e3175836271c1881b546cd4edb86331f?s=32&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Chip says:

    Thanks for the article. Question: does the installation proceed under the credentials of the user logging in? I am facing a problem where it seems the installer runs, but perhaps has some kind of permissions problem. In the application logs seems to indicate success, but the addin is not really installed? Are there any logs for the installation, either on the local machine or on the domain controller? Thanks.

  • http://0.gravatar.com/avatar/ab4ec2858cfdf1e44dadf8c50fae314d?s=32&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Dmitry Kostochko (Add-in Express Team) says:

    Yes, the installation proceeds under the credentials of the user logging in. You can find the log file generated by Add-in Express in the Documents\Add-in Express\adxloader.log file.

Post a comment

Have any questions? Ask us right now!