I've been trying to do this seemingly simple task for over a day now. So I would appreciate if someone can shed some light on what am I missing here?
I wrote an Outlook 2007 add-in (in Visual Studio 2008, C# project) and now I'm trying to write an MSI installer for it (using WiX). The installation process also requires VS Tools For Office Runtime to be installed, which I do separately.
Then, the following are registry keys, that I've been testing it with for the current user. Using WiX mark-up:
<Component Id="RegistryRegAddin" Guid="{GUID}">
<RegistryKey Id="RegKey_AddIn" Root="HKCU" Key="Software\Microsoft\Office\Outlook\Addins\$(var.ProductThis)" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
<RegistryValue Type="string" Name="Description" Value="$(var.AppDescr)" />
<RegistryValue Type="string" Name="FriendlyName" Value="$(var.ProductThis)" />
<RegistryValue Type="integer" Name="LoadBehavior" Value="3" />
<RegistryValue Type="string" Name="Manifest" Value="[INSTALLFOLDER]AddInName.vsto|vstolocal" />
</RegistryKey>
</Component>
So this works just fine for the current user.
But now I'm trying to change it so that the add-in is installed for all users. I modified HKCU
to HKLM
in the WiX registry markup above. But in that case, the MSI installs fine (on a 32-bit Windows 7 Pro), but my add-in doesn't load into Outlook.
Why!????
Then if I go in Outlook to Tools -> Trust Center -> Add-ins -> my add-in is in the "Inactive Application Add-ins" but when I try to check it to enable it, Outlook shows this message:
The connected state of Office Add-Ins registered in HKEY_LOCAL_MACHINE cannot be changed.
Argh!!!!