这个 WIX 配置是否需要 MSIUSEREALADMINDETECTION 和 COM DLL 注册?

Joh*_*ohn 2 com dll windows-installer wix

我有一个 COM DLL 的 WIX 安装设置,它在没有将 MSIUSEREALADMINDETECTION 值设置为 1 的情况下似乎可以正常工作。但是,我不确定它是否适用于所有配置(Windows 版本、.NET 版本等)。

您是否会在我的 WIX 配置文件中包含 ("Property Id="MSIUSEREALADMINDETECTION" Value="1") 只是为了 100% 确定 MSI 将在所有极端情况下正确注册 COM DLL?

据我所知,此属性将强制安装程序以“真正的”管理权限运行。

这是针对企业应用程序的,因此安装顺利进行非常重要。

WIX文件:

  <?xml version="1.0" encoding="UTF-8"?>
Run Code Online (Sandbox Code Playgroud)

<!-- <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" />
Run Code Online (Sandbox Code Playgroud)

<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>
Run Code Online (Sandbox Code Playgroud)

Phi*_*lDW 5

不,不要使用它。它不会给安装任何更多的特权来做任何事情。这是一个旧设置,它使较旧的 MSI 安装能够像在 UAC 之前一样获取 Privileged 和 AdminUser 值的值。换句话说,如果您询问 UI 序列中 AdminUser 属性的值(在 UAC 提示之前),如果 MSIUSEREALADMINDETECTION 被设置,它会告诉您“真”,如果没有,它会告诉您“假”(这被认为是正确的答案,因为没有提升提示,所以用户怎么可能是管理员?)。