Wix-如何从以前安装的MSI获取用户输入? [英] Wix - How to get user input from a previously installed msi?

查看:108
本文介绍了Wix-如何从以前安装的MSI获取用户输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用wix 3.8进行安装.我可以使用自定义属性来存储自己的输入,但是我想使用以前安装的msi上的输入值. 有没有办法完成这样的事情?.

I'm trying to do an installer using wix 3.8. I can use custom properties to store my own input, but I'd like to use values that where inputs on a previously installed msi. Is there a way to accomplish such thing?.

推荐答案

要使您朝正确的方向,请在拳头MSI中添加(当然首先要使其适应您的需求):

To get you in the right direction add this (of course adapt it to your needs first) in your fist MSI:

<DirectoryRef Id="INSTALLDIR">
  <Component Id="RegistryEntries" Guid="{0AC76129-F8E2-47D3-B9FD-09B1E10A8541}">
    <RegistryKey Root="HKLM" Key="Software\Company123\App123" Action="create">
      <RegistryValue Type="integer" Name="SomeIntegerValue" Value="1" KeyPath="yes"/>
      <RegistryValue Type="string" Name="UserInput" Value="[USERINPUT]" />
    </RegistryKey>
  </Component>
</DirectoryRef>

不要忘记引用<Feature> <ComponentRef Id="RegistryEntries" />中的组件 安装时,请为属性[USERINPUT]分配一个值,例如msiexec /i your.msi /qb+ USERINPUT="the value to be saved in registry"

Don't forget reference the component in your <Feature> <ComponentRef Id="RegistryEntries" /> When you install assign a value to the property [USERINPUT] e.g. msiexec /i your.msi /qb+ USERINPUT="the value to be saved in registry"

然后在第二个MSI中添加如下内容:

Then in the second MSI add something like this:

   <Property Id="READREGISTRY">
       <RegistrySearch Id="USERINPUT_Value" Root="HKLM" Key="Software\Company123\App123" Name="UserInput" Type="raw" />
   </Property>

在安装过程USERINPUT=中输入的值/字符串将存储在第二个MSI的属性READREGISTRY

The value/string you entered during installation USERINPUT= will be stored in your second MSI in the property READREGISTRY

这是我的第二个msi日志:

Here a piece of log in my second msi:

PROPERTY CHANGE: Adding READREGISTRY property. Its value is 'testing registry wef wef wef w'.

根据安装的位置(可能是每用户"或每台计算机"),您可以将根"调整为HKCU(用于PerUser安装),或者将其保留为HKLM(用于PerMachine).

Based on your installation where it might be Per User or Per Machine you may adjust the Root to HKCU for PerUser installs or leave it to HKLM for PerMachine.

有关更多信息,请参阅Wix文档,提示:如何:在安装过程中编写注册表项"和如何:在安装过程中读取注册表项".

For more information please refer to Wix documentation, hints: "How To: Write a Registry Entry During Installation" and "How To: Read a Registry Entry During Installation".

这篇关于Wix-如何从以前安装的MSI获取用户输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆