Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
注册表项在Wix中工作不正常_Wix_Windows Installer_Registry - Fatal编程技术网

注册表项在Wix中工作不正常

注册表项在Wix中工作不正常,wix,windows-installer,registry,Wix,Windows Installer,Registry,我正在创建一个x64微星。我有一些注册表值要设置。在Wix中,我使用以下代码 <Component Id="RegistryEntries1" Guid="{GUID1}" Win64="yes"> <RegistryKey Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{FF.....}"

我正在创建一个x64微星。我有一些注册表值要设置。在Wix中,我使用以下代码

  <Component Id="RegistryEntries1" Guid="{GUID1}" Win64="yes">
    <RegistryKey Root="HKLM"
                 Key="Software\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{FF.....}"
                 Action="createAndRemoveOnUninstall">
      <RegistryValue Type="string" Value="SomeName" KeyPath="yes"/>
    </RegistryKey>
  </Component>


  <Component Id="RegistryEntries2" Guid="{GUID2}" Win64="yes">
    <RegistryKey Root="HKCR"
                   Key="CLSID\{FF.....}"
                   Action="createAndRemoveOnUninstall">
      <RegistryValue Type="string" Value="SomeName" KeyPath="yes"/>
    </RegistryKey>
  </Component>


  <Component Id="RegistryEntries3" Guid="{GUID3}" Win64="yes">
    <RegistryKey Root="HKCR"
                   Key="CLSID\{{FF.....}\InprocServer32"
                   Action="createAndRemoveOnUninstall">
      <RegistryValue Type="string" Value="SomeName.dll" KeyPath="no"/>
      <RegistryValue Type="string" Name="ThreadingModel" Value="Apartment" KeyPath="yes"/>
    </RegistryKey>
  </Component>

我的Wix代码中是否有任何问题。

问题可能是HKCR是一个虚拟密钥,在您的情况下是HKLM\Software\Classes和HKCU\Software\Classes的合并视图。这说明:

因此,使用本地系统帐户运行的东西看不到这两种情况。如果您使用系统帐户运行regedit,那么如果发生这种情况,您将看不到您的HKCR类


因此,如果您在HKLM\Software\Classes中执行这些条目,我认为您的服务/服务安装程序代码会看到它们。ServiceInstaller类通常使用系统帐户作为自定义操作运行。如果您使用的是WiX,则不需要ServiceInstaller类(可能是从VisualStudio安装迁移的),因为ServiceInstall和ServiceControl将完成此工作

您的应用程序是作为服务运行还是作为其他帐户运行?@PhilDW是。我的应用程序是一个服务安装程序。
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{FF.....}]
@="SomeName"

[HKEY_CLASSES_ROOT\CLSID\{FF.....}]
@="SomeName"

[HKEY_CLASSES_ROOT\CLSID\{FF.....}\InprocServer32]
@="SomeName.dll"
"ThreadingModel"="Apartment"