2

I have a WIX installation setup for a COM DLL that seems to work fine without the MSIUSEREALADMINDETECTION value set to 1. However, I am not sure if it works on all configurations (Windows versions, .NET versions, etc).

Would you include ("Property Id="MSIUSEREALADMINDETECTION" Value="1") in my WIX configuration file just to be 100% sure that the MSI will register the COM DLL correctly in all corner cases?

As I have understood, this property will force the installer to run with "real" administrative rights.

This is for an enterprise application so it is very important the installation goes smooth.

WIX file:

  <?xml version="1.0" encoding="UTF-8"?>

<!-- <Property Id="MSIUSEREALADMINDETECTION" Value="1" /> unsure if this is needed yet -->

<Property Id="ARPHELPLINK" Value="http://www.example.com" />
<Property Id="ARPURLINFOABOUT" Value="http://www.example.com" />    
<PropertyRef Id="NETFRAMEWORK40FULL" />
<PropertyRef Id="NETFRAMEWORK40CLIENT" />
<Condition Message="This application requires .NET Framework 4.0 or later. Please install the .NET Framework 4.0 or later and then run this installer again.">
  <![CDATA[Installed OR NETFRAMEWORK40FULL OR NETFRAMEWORK40CLIENT]]>
</Condition>
<WixVariable Id="WixUIDialogBmp" Value="InstallerBackgroundWix.bmp" />
<WixVariable Id="WixUIBannerBmp" Value="InstallerBannerWix.bmp" />

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
    <Directory Id="INSTALLFOLDER" Name="example">
      <Component Id="MyAddin" Guid="guid3" Win64="no">
        <File Id="exampleDLL" Source="$(var.example.TargetDir)example.dll"/>

        <Class Id="{guid4}" Context="InprocServer32" Description="example" ThreadingModel="both" ForeignServer="mscoree.dll">
          <ProgId Id="example" Description="example" />
        </Class>
        <RegistryValue Root="HKCR" Key="CLSID\{guid4}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
        <RegistryValue Root="HKCR" Key="CLSID\{guid4}\InprocServer32\1.0.0.0" Name="Class" Value="example.Addin" Type="string" Action="write" />
        <RegistryValue Root="HKCR" Key="CLSID\{guid4}\InprocServer32\1.0.0.0" Name="Assembly" Value="example, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
        <RegistryValue Root="HKCR" Key="CLSID\{guid4}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
        <RegistryValue Root="HKCR" Key="CLSID\{guid4}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///[#exampleDLL]" Type="string" Action="write" />
        <RegistryValue Root="HKCR" Key="CLSID\{guid4}\InprocServer32" Name="Class" Value="example.Addin" Type="string" Action="write" />
        <RegistryValue Root="HKCR" Key="CLSID\{guid4}\InprocServer32" Name="Assembly" Value="example, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
        <RegistryValue Root="HKCR" Key="CLSID\{guid4}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
        <RegistryValue Root="HKCR" Key="CLSID\{guid4}\InprocServer32" Name="CodeBase" Value="file:///[#exampleDLL]" Type="string" Action="write" />

        <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Office\Outlook\Addins\example">
          <RegistryValue Type="integer" Name="LoadBehavior" Value="3"/>
          <RegistryValue Type="string" Name="Description" Value="example Outlook Add-in"/>
          <RegistryValue Type="string" Name="FriendlyName" Value="example Outlook Add-in"/>
        </RegistryKey>
      </Component>
    </Directory>
        </Directory>
    </Directory>
</Fragment>

John
  • 61
  • 1
  • 5

2 Answers2

5

No, don't use it. It does not give the install any more privilege to do anything. It's a legacy setting that enables older MSI installs to get values for the Privileged and AdminUser values as they were before UAC. In other words if you ask the value of the AdminUser property in the UI sequence (before the UAC prompt) it will tell you "true" if MSIUSEREALADMINDETECTION is set and "false" if it isn't (which is considered the right answer because there's been no elevation prompt so how can the user be Admin?).

PhilDW
  • 20,260
  • 1
  • 18
  • 28
0

Better answer at Mark MSI so it has to be run as elevated Administrator account

Summary: One difference is it changes the user credentials that CustomActions are run under.

Community
  • 1
  • 1