我需要创建一个安装程序,获取用户输入以创建注册表项。我查看了Wix教程,并且非常清楚如何安装注册表项,但是我需要用户提供一些信息(在这种情况下它是一个url),以便可以在注册表项上使用url。
我该怎么做?
答案 0 :(得分:2)
重复问题!?
如果有帮助,请查看此答案:https://stackoverflow.com/a/20679626/1331719
修改 - 稍微修改链接中的答案:
首先添加此组件,请注意值[USERINPUT]
<DirectoryRef Id="INSTALLDIR">
<Component Id="RegistryEntries" Guid="{YOURGUID}">
<RegistryKey Root="HKLM" Key="Software\Company123\App123" Action="create">
<RegistryValue Type="string" Name="UserInput" Value="[USERINPUT]" />
</RegistryKey>
</Component>
</DirectoryRef>
引用功能中的组件:
<Feature>
<ComponentRef Id="RegistryEntries" />
...
</Feature>
使用msiexec安装时获取用户输入:
msiexec /i your.msi /qb+ USERINPUT="http://urlYouWantToStoreIn.Registry"
检查注册表HKLM \ Software \ Company123 \ App123 \ UserInput,网址应该在那里。