未在 Wow64 节点中创建 Wix 安装程序注册表项
Wix installer registry keys not getting created in Wow64 node
我有一台 64 位机器,我需要在其中安装 Windows 服务。此服务是使用 Apache procrun 创建的,因此我需要创建某些注册表项。这些应该像我期望的那样进入 wow64 节点,但它们是在 HKLM/SOFTWARES instread HKLM/SOFTWARE/Wow64 节点中创建的。下面是我的 Product.wxs 文件。
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="DummyInstaller" Language="1033" Version="1.0.0.0" Manufacturer="Bryan" UpgradeCode="94D1BC64-7CC1-45DA-BD5F-8ED40980E75C">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Property Id="JAVA_CURRENT_VERSION64">
<RegistrySearch Id="JRE_CURRENT_VERSION_REGSEARCH64" Root="HKLM" Key="SOFTWARE\JavaSoft\Java Runtime Environment" Name="CurrentVersion" Type="raw" Win64="yes" />
</Property>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="DummyInstaller" Level="1" >
<!--<ComponentGroupRef Id="NewFilesGroup" />-->
<ComponentRef Id="REGISTRY_A" />
<ComponentRef Id="PROCRUN.EXE"/>
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="DummyDir" Name="DummyInstaller">
<!--<Directory Id="MyProgramDir" Name="MosquittoNew" />-->
<Directory Id="SERVERDIR" Name="UpdaterService" >
<Component Id="REGISTRY_A" DiskId="1" Guid="*" Win64="yes">
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\UpdaterService\Parameters\Java" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Classpath" Value="E:\Service\Update_Service-1.0.jar" KeyPath="yes" />
<RegistryValue Type="string" Name="Jvm" Value="C:\Program Files\Java\jdk1.8.0_25\jre\bin\server\jvm.dll" />
<RegistryValue Type="multiString" Action="append" Name="Options">
<MultiStringValue Type="multiString" Name="Options" Action="append">-Duser.language=en</MultiStringValue>
<MultiStringValue Type="multiString" Name="Options" Action="append">-Duser.region=US</MultiStringValue>
</RegistryValue>
<RegistryValue Type="integer" Name="JvmMs" Value="256" />
<RegistryValue Type="integer" Name="JvmMx" Value="1024" />
<RegistryValue Type="integer" Name="JvmSs" Value="4000" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\UpdaterService\Parameters\Log" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Path" Value="c:\logs" />
<RegistryValue Type="string" Name="Level" Value="Error" />
<RegistryValue Type="string" Name="Prefix" Value="UpdaterService" />
<RegistryValue Type="string" Name="StdError" Value="c:\logs\stderr.txt" />
<RegistryValue Type="string" Name="StdOutput" Value="c:\logs\stdout.txt" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\UpdaterService\Parameters\Start" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Mode" Value="jvm" />
<RegistryValue Type="string" Name="Class" Value="com.kohls.kube.services.updater.UpdaterServiceMain" />
<RegistryValue Type="string" Name="Params" Value="start" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\UpdaterService\Parameters\Stop" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Mode" Value="jvm" />
<RegistryValue Type="string" Name="Class" Value="com.kohls.kube.services.updater.UpdaterServiceMain" />
<RegistryValue Type="string" Name="Method" Value="stop" />
<RegistryValue Type="string" Name="Params" Value="stop" />
<RegistryValue Type="string" Name="StdOutput" Value="auto" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\UpdaterService" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Description" Value="Kube updater service performing updates and installation" />
<RegistryValue Type="string" Name="DisplayName" Value="UpdaterService" />
<RegistryValue Type="string" Name="ImagePath" Value="E:\Service\prunsrv.exe.exe //RS//UpdaterService" />
<RegistryValue Type="string" Name="DependsOnService" Value="Tcpip Afd" />
<RegistryValue Type="string" Name="ObjectName" Value="LocalSystem" />
<RegistryValue Type="integer" Name="ErrorControl" Value="1" />
<RegistryValue Type="integer" Name="Start" Value="2" />
<RegistryValue Type="integer" Name="Type" Value="16" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\UpdaterService\Parameters" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Test" Value="Pass" />
</RegistryKey>
</Component>
<Component Id="PROCRUN.EXE" DiskId="1" Guid="*" Win64="yes">
<!-- this is the renamed procrun 64 bit executable -->
<File Id="prunsrv.exe" Name="prunsrv.exe" Source="E:\Service\prunsrv.exe" />
<ServiceInstall Id="PROCRUN" Type="ownProcess" Name="UpdaterService" DisplayName="UpdaterService" Description="Kube 2.0 Updater Service" Start="auto" Account="LocalService" ErrorControl="normal" Arguments=" //RS//UpdaterService" />
<ServiceControl Id="StartPRUNSRV" Start="install" Stop="both" Remove="uninstall" Name="UpdaterService" Wait="no" />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
</Wix>
我已经指定了 Win64=yes 参数。对于 WIX 安装项目,我还在项目设置->工具集->附加参数下指定了“-arch x64”。我仍然得到在正常 HKLM/SOFTWARES 中创建的注册表项,而不是在 wow64 节点中创建的。为什么会这样?请指教
对于需要转到 64 位安装程序中的 32 位注册表位置 (Wow6432Node) 的密钥,您需要指定 Win64="no"
有点令人困惑,但 Wow6432Node 实际上是 64 位机器上注册表的 32 位部分,而不是 64 位部分。
我有一台 64 位机器,我需要在其中安装 Windows 服务。此服务是使用 Apache procrun 创建的,因此我需要创建某些注册表项。这些应该像我期望的那样进入 wow64 节点,但它们是在 HKLM/SOFTWARES instread HKLM/SOFTWARE/Wow64 节点中创建的。下面是我的 Product.wxs 文件。
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="DummyInstaller" Language="1033" Version="1.0.0.0" Manufacturer="Bryan" UpgradeCode="94D1BC64-7CC1-45DA-BD5F-8ED40980E75C">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Property Id="JAVA_CURRENT_VERSION64">
<RegistrySearch Id="JRE_CURRENT_VERSION_REGSEARCH64" Root="HKLM" Key="SOFTWARE\JavaSoft\Java Runtime Environment" Name="CurrentVersion" Type="raw" Win64="yes" />
</Property>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="DummyInstaller" Level="1" >
<!--<ComponentGroupRef Id="NewFilesGroup" />-->
<ComponentRef Id="REGISTRY_A" />
<ComponentRef Id="PROCRUN.EXE"/>
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="DummyDir" Name="DummyInstaller">
<!--<Directory Id="MyProgramDir" Name="MosquittoNew" />-->
<Directory Id="SERVERDIR" Name="UpdaterService" >
<Component Id="REGISTRY_A" DiskId="1" Guid="*" Win64="yes">
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\UpdaterService\Parameters\Java" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Classpath" Value="E:\Service\Update_Service-1.0.jar" KeyPath="yes" />
<RegistryValue Type="string" Name="Jvm" Value="C:\Program Files\Java\jdk1.8.0_25\jre\bin\server\jvm.dll" />
<RegistryValue Type="multiString" Action="append" Name="Options">
<MultiStringValue Type="multiString" Name="Options" Action="append">-Duser.language=en</MultiStringValue>
<MultiStringValue Type="multiString" Name="Options" Action="append">-Duser.region=US</MultiStringValue>
</RegistryValue>
<RegistryValue Type="integer" Name="JvmMs" Value="256" />
<RegistryValue Type="integer" Name="JvmMx" Value="1024" />
<RegistryValue Type="integer" Name="JvmSs" Value="4000" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\UpdaterService\Parameters\Log" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Path" Value="c:\logs" />
<RegistryValue Type="string" Name="Level" Value="Error" />
<RegistryValue Type="string" Name="Prefix" Value="UpdaterService" />
<RegistryValue Type="string" Name="StdError" Value="c:\logs\stderr.txt" />
<RegistryValue Type="string" Name="StdOutput" Value="c:\logs\stdout.txt" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\UpdaterService\Parameters\Start" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Mode" Value="jvm" />
<RegistryValue Type="string" Name="Class" Value="com.kohls.kube.services.updater.UpdaterServiceMain" />
<RegistryValue Type="string" Name="Params" Value="start" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\UpdaterService\Parameters\Stop" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Mode" Value="jvm" />
<RegistryValue Type="string" Name="Class" Value="com.kohls.kube.services.updater.UpdaterServiceMain" />
<RegistryValue Type="string" Name="Method" Value="stop" />
<RegistryValue Type="string" Name="Params" Value="stop" />
<RegistryValue Type="string" Name="StdOutput" Value="auto" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\UpdaterService" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Description" Value="Kube updater service performing updates and installation" />
<RegistryValue Type="string" Name="DisplayName" Value="UpdaterService" />
<RegistryValue Type="string" Name="ImagePath" Value="E:\Service\prunsrv.exe.exe //RS//UpdaterService" />
<RegistryValue Type="string" Name="DependsOnService" Value="Tcpip Afd" />
<RegistryValue Type="string" Name="ObjectName" Value="LocalSystem" />
<RegistryValue Type="integer" Name="ErrorControl" Value="1" />
<RegistryValue Type="integer" Name="Start" Value="2" />
<RegistryValue Type="integer" Name="Type" Value="16" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\UpdaterService\Parameters" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Test" Value="Pass" />
</RegistryKey>
</Component>
<Component Id="PROCRUN.EXE" DiskId="1" Guid="*" Win64="yes">
<!-- this is the renamed procrun 64 bit executable -->
<File Id="prunsrv.exe" Name="prunsrv.exe" Source="E:\Service\prunsrv.exe" />
<ServiceInstall Id="PROCRUN" Type="ownProcess" Name="UpdaterService" DisplayName="UpdaterService" Description="Kube 2.0 Updater Service" Start="auto" Account="LocalService" ErrorControl="normal" Arguments=" //RS//UpdaterService" />
<ServiceControl Id="StartPRUNSRV" Start="install" Stop="both" Remove="uninstall" Name="UpdaterService" Wait="no" />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
</Wix>
我已经指定了 Win64=yes 参数。对于 WIX 安装项目,我还在项目设置->工具集->附加参数下指定了“-arch x64”。我仍然得到在正常 HKLM/SOFTWARES 中创建的注册表项,而不是在 wow64 节点中创建的。为什么会这样?请指教
对于需要转到 64 位安装程序中的 32 位注册表位置 (Wow6432Node) 的密钥,您需要指定 Win64="no"
有点令人困惑,但 Wow6432Node 实际上是 64 位机器上注册表的 32 位部分,而不是 64 位部分。