Solution is set to RegisterForAllUsers but fails at adding registry keys

Add-in Express™ Support Service
That's what is more important than anything else

Solution is set to RegisterForAllUsers but fails at adding registry keys
 
Sebastian Theuerkorn


Guest


Hello,

I've created an outlook addin. It works properly and installing it per user is also not a problem. It's able to copy the files and set the registry keys correctly.

When I try to install it on a per machine level however, it asks for administration privieges during install and is then able to copy the files correctly. It then fails to create the registry keys though.

Custom Actions from my Product.wxs are:

<Binary Id="adxregistrator_exe" SourceFile="$(var.ADX_PATH)\Redistributables\adxregistrator.exe" />
<!-- The "adxregistrator.exe" custom action. -->
<CustomAction Id="_0B4E3450_A27B_46EC_B241_B3852A1D43C0" BinaryKey="adxregistrator_exe" Execute="deferred" ExeCommand="/install=&quot;[TARGETDIR]$(var.EmailTrigger.TargetFileName)&quot; /privileges=admin" Impersonate="yes" />
<!-- The "adxregistrator.exe" custom action. -->
<CustomAction Id="_F2B63D01_4F64_4823_833E_CCDBC5893220" BinaryKey="adxregistrator_exe" Execute="rollback" ExeCommand="/uninstall=&quot;[TARGETDIR]$(var.EmailTrigger.TargetFileName)&quot; /privileges=admin /generateLogFile=false" Impersonate="yes" />
<!-- The "adxregistrator.exe" custom action. -->
<CustomAction Id="_38CA3207_34F0_471F_81FC_083882466B2A" BinaryKey="adxregistrator_exe" Execute="deferred" ExeCommand="/uninstall=&quot;[TARGETDIR]$(var.EmailTrigger.TargetFileName)&quot; /privileges=admin" Impersonate="yes" />
<!-- Initialize the "TARGETDIR" directory property. -->
<CustomAction Id="DIRCA_TARGETDIR" Property="TARGETDIR" Value="[ProgramFilesFolder][Manufacturer]\[ProductName]" Execute="firstSequence" />

which look correct to me.
I'm wondering why the log file says that it's not run as administrator or elevated.

This is my adxregistrator.log:

Add-in Express Registrator Log File: 07/13/2016 13:40:43

Installation directory: C:\Windows\Installer\
Registrator version: 8.2.4371.0
Operating System: Microsoft Windows 10 Professional (build 10586), 64-bit
Process Owner: Administrator
Command Line: "C:\Windows\Installer\MSIB4B1.tmp" /install="C:\Program Files (x86)\Default Company\EmailTrigger\Email Trigger.dll" /privileges=admin
Run 'As Administrator': No
Process Elevated: No
Integrity Level: Medium
UAC (User Account Control): On
--------------------------------------------------------------
13:40:43 0404 Starting the add-in registration process.
13:40:43 0404 Loading mscoree.dll
13:40:43 0404 Success.
13:40:43 0404 .NET Framework installation directory:
13:40:43 0404 The latest version of .NET Framework: 'v4.0.30319'
13:40:43 0404 Loading CLR: v4.0.30319.
13:40:43 0404 Calling CLRCreateInstance method.
13:40:43 0404 Success.
13:40:43 0404 Calling GetRuntime method.
13:40:43 0404 Success.
13:40:43 0404 Checking if the hosting API of .NET Framework v4.0 beta is installed.
13:40:43 0404 The hosting API is up to date.
13:40:43 0404 Calling GetInterface method for the CorRuntimeHost interface.
13:40:43 0404 Success.
13:40:43 0404 Starting CLR...
13:40:43 0404 Success.
13:40:43 0404 Getting the CLR version.
13:40:43 0404 The CLR v4.0.30319 has been initialized successfully.
13:40:43 0404 Creating a new domain setup.
13:40:43 0404 Success.
13:40:43 0404 The 'shadow copy' is disabled.
13:40:43 0404 Creating a new application domain.
13:40:43 0404 Success.
13:40:43 0404 Getting the base directory for the domain.
13:40:43 0404 Success. The directory is 'C:\Program Files (x86)\Companyname\EmailTrigger\'.
13:40:43 0404 Searching for the Add-in Express core library.
13:40:43 0404 Success. The 'AddinExpress.MSO.2005.dll' file is found.
13:40:43 0404 Creating an instance of the 'AddinExpress.Deployment.ADXRegistrator' class.
13:40:43 0404 Assembly identity is 'AddinExpress.MSO.2005'.
13:40:43 0404 Success.
13:40:43 0404 Unwrapping the instance of the 'AddinExpress.Deployment.ADXRegistrator' class.
13:40:43 0404 Success.
13:40:43 0404 Calling the managed registration procedure (DISPID = 1610743823).
13:40:43 0404 Managed Error:
Date and Time: 13.07.2016 13:40:43
Machine Name: mycomputer (edited)
IP Address: 172.20.13.99
Current User: domain\localuser (edited)

Application Domain: C:\Program Files (x86)\Default Company\EmailTrigger\
Assembly Codebase: file:///C:/Windows/assembly/GAC_MSIL/AddinExpress.MSO.2005/8.2.4371.0__4416dd98f0861965/AddinExpress.MSO.2005.dll
Assembly Full Name: AddinExpress.MSO.2005, Version=8.2.4371.0, Culture=neutral, PublicKeyToken=xxxx (edited)
Assembly Version: 8.2.4371.0

Exception Source: AddinExpress.MSO.2005
Exception Type: System.ComponentModel.Win32Exception
Exception Message: Zugriff verweigert (Access denied)
Exception Target Site: CreateSubKey

---- Stack Trace ----
AddinExpress.Projects.Common.ADXRegistryKey.CreateSubKey(subKeyName As String)
AddinExpress.MSO.2005.dll: N 0132 (0x84) IL
AddinExpress.Projects.Common.Utilities.RegisterManagedType(rootKey As ADXRegistryKey, type As Type, strAsmName As String, strAsmVersion As String, strAsmCodeBase As String, strRuntimeVersion As String, targetHive As ADXTargetRegistryHive, createVersionKey As Boolean)
AddinExpress.MSO.2005.dll: N 0082 (0x52) IL
AddinExpress.Projects.Common.Utilities.RegisterType(t As Type, createVersionKey As Boolean, allUsers As Boolean, targetHive As ADXTargetRegistryHive, callRegMethod As Boolean)
AddinExpress.MSO.2005.dll: N 0206 (0xCE) IL
AddinExpress.Projects.Common.Utilities.RegisterAssembly(assembly As Assembly, createVersionKey As Boolean, allUsers As Boolean, targetHive As ADXTargetRegistryHive, callRegMethod As Boolean)
AddinExpress.MSO.2005.dll: N 0040 (0x28) IL
AddinExpress.Deployment.AddinDomainAdapter.RegisterForComInterop(register As Boolean, dllType As String, dllPath As String, showExceptions As Boolean)
AddinExpress.MSO.2005.dll: N 0205 (0xCD) IL
AddinExpress.Deployment.ADXRegistrator.RegisterAssembly(commandLine As String)
AddinExpress.MSO.2005.dll: N 0705 (0x2C1) IL



13:40:43 0404 The add-in registration process is completed with HRESULT = -2147467259.


Any help on this would be appreciated.

One more information: If I log into the computer as the domain admin, I am able to install it, and it's able to write the registry keys correctly and the addin is available to all users of the machine.
Posted 13 Jul, 2016 07:58:23 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello Sebastian,

You need to run the installer using setup.exe, not the .MSI. In this case, you should get the UAC prompt immediately, not when files are copied.


Andrei Smolin
Add-in Express Team Leader
Posted 13 Jul, 2016 08:32:58 Top
Sebastian Theuerkorn


Guest


Hello Andrej,

thank you for your quick reply and for that solution.
I'm still wondering: Is there no way to create an msi package that's able to write local machine registry keys?
Posted 13 Jul, 2016 08:41:45 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello Sebastian,

Please check https://www.add-in-express.com/docs/net-wix-setup.php#dual-purpose.


Andrei Smolin
Add-in Express Team Leader
Posted 14 Jul, 2016 08:14:14 Top