使用COM DLL注册时,我是否需要MSIUSEREALADMINDETECTION用于此WIX配置?

时间:2014-08-22 17:15:46

标签: dll com wix windows-installer

我有一个COM DLL的WIX安装设置似乎工作正常,而MSIUSEREALADMINDETECTION值设置为1.但是,我不确定它是否适用于所有配置(Windows版本,.NET版本等)。 / p>

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

据我了解,此属性将强制安装程序以“真实”管理权限运行。

这适用于企业应用程序,因此安装顺利进行非常重要。

WIX文件:

  <?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>

2 个答案:

答案 0 :(得分:3)

不,不要使用它。它不会给安装任何更多的特权做任何事情。这是一个遗留设置,允许较旧的MSI安装获取Privileged和AdminUser值的值,就像它们在UAC之前一样。换句话说,如果你在UI序列中询问AdminUser属性的值(在UAC提示之前),如果设置了MSIUSEREALADMINDETECTION,它将告诉你“true”,如果不设置则告诉你“false”(这被认为是正确答案,因为没有提升提示,那么用户如何成为管理员?)。

答案 1 :(得分:0)

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

更好地回答

摘要:一个区别是它更改了运行CustomActions的用户凭据。