Wix:如何在64位计算机上写入32位寄存器

胃蛋白酶

我一直在寻找解决方案,但没有成功。我必须承认我是wix的始作俑者。我有一个针对x86和x64单独编译的项目(使用Visual Studio 2015的WPF + caliburn)。我使用x64机器创建两个MSI。不幸的是,在安装过程中,安装程序始终会写入64位寄存器,这会导致应用程序出现问题。

我创建了以下组件,试图使用Win64 =“ no”条目修复它,不幸的是没有成功。可以请建议正确的组件配置吗?

<DirectoryRef Id="TARGETDIR">
  <?if $(var.Platform)="x64"?> 
          <Component Id="Registry_DefaultStoragePath" Guid="123-456-789" Win64="yes">
              <RegistryKey Root="HKLM"
                                       Key="Software\KeyName" Action="createAndRemoveOnUninstall">
                  <RegistryValue Type="string" Name="DefaultStorageLocation" Value="[DEFAULTSTORAGE]" KeyPath="yes"/>
              </RegistryKey>
          </Component>

          <Component Id="Registry_InstallType" Guid="123-456-789" Win64="yes">
              <RegistryKey Root="HKLM"
                                       Key="Software\KeyName" Action="createAndRemoveOnUninstall" >
                  <RegistryValue Type="string" Name="InstallType" Value="[INSTALLTYPE]" KeyPath="yes"/>
              </RegistryKey>
          </Component>
  <?endif?>
  <?if $(var.Platform)="x86"?> 
          <Component Id="Registry_DefaultStoragePath" Guid="132-456-789" Win64="no">
              <RegistryKey Root="HKLM"
                                       Key="Software\KeyName" Action="createAndRemoveOnUninstall">
                  <RegistryValue Type="string" Name="DefaultStorageLocation" Value="[DEFAULTSTORAGE]" KeyPath="yes"/>
              </RegistryKey>
          </Component>

          <Component Id="Registry_InstallType" Guid="123-456-789" Win64="no">
              <RegistryKey Root="HKLM"
                                       Key="Software\KeyName" Action="createAndRemoveOnUninstall" >
                  <RegistryValue Type="string" Name="InstallType" Value="[INSTALLTYPE]" KeyPath="yes"/>
              </RegistryKey>
          </Component>
  <?endif?>    

莫滕·弗雷德里克森(Morten Frederiksen)

主要问题是<?if $(var.Platform)="x64"?>由预处理器处理的,因此它是在编译时而不是运行时进行评估的。

为了处理x86 / x64运行时,您可以执行以下操作:

<component ....>
  <condition>NOT VersionNT64</condition>
  <!-- 32 bit component -->
  <!-- Add component content here -->
</component>
<component ....>
  <condition>VersionNT64</condition>
  <!-- 64 bit component -->
  <!-- Add component content here -->
</component>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在64位计算机上测试特定于32位内核的syscall?

如何在64位计算机上以32位模式运行exe?

如何在我的64位计算机上使用gcc编译32位.o文件?

如何在64位计算机上运行针对32位的API?

如何在64位计算机上构建32位deb文件?

如何在32位计算机上安装64位.deb文件?

在64位计算机上编译32位内核

在64位计算机上创建32位initramfs

如何在64位计算机上使用64位处理器运行QEMU?

如何在64位Windows计算机上链接32位Nasm程序集目标代码

如何创建32位远程Powershell会话(在64位计算机上)?

在64位计算机上,Java中的int大小是32位还是64位?

在32位和64位计算机上总是64位

使用-m64在32位计算机上编译64位时出错

我如何在Pentium 4计算机上安装Ubuntu 64位?

32位计算机上64位可变算术运算的行为

在32位计算机上运行64位VirtualBox存档

Java原子在32位计算机上是64位分配吗?

在64位计算机上进行Crypto ++ 32位编译

在同一台计算机上运行Java 32位和64位

64位计算机上的32位Java可访问性

在Java中的64位计算机上运行32位dll

为什么gdb在64位计算机上仅显示32位地址?

在64位计算机上添加32位版本的Qt 5.7

IE默认为32位吗?即使在64位计算机上?

在32位和64位计算机上的C / C ++可执行文件

我可以在64位计算机上安装Ubuntu 32位吗?

我可以在32位计算机上安装64位版本的Ubuntu吗?

蒙哥马利乘法 - 32 位寄存器与 64 位寄存器