简体   繁体   English

wix 3.5的静默安装程序,带有c#\\ .NET中的自定义操作

[英]Silent installer for wix 3.5 with custom actions in c#\.NET

Is there any way I can put all the properties and values of my WIX 3.5 installer, like the user inputs in my custom dialogs , into one single file and pass it to my MSI installer for silent installation? 有没有什么方法可以将我的WIX 3.5安装程序的所有属性和值(如自定义对话框中的用户输入)放入一个文件中,并将其传递给我的MSI安装程序以进行静默安装? Something like one would do with a response file with installshield with a properties file? 像一个带有带有属性文件的installshield的响应文件那样的东西? I made sure to have all my custom actions in installexecute sequence. 我确保在installexecute序列中拥有所有自定义操作。 All my custom actions are in c#/.NET 我的所有自定义操作都在c#/。NET中

You use the Windows Installer SDK tool ORCA (MSI database editor) to create a transform. 您使用Windows Installer SDK工具ORCA(MSI数据库编辑器)来创建转换。 In the transform you define all your properties. 在转换中,您可以定义所有属性。

Editing MSI files with Microsoft Orca 使用Microsoft Orca编辑MSI文件

Once you have created your transform you perform the silent installation like this: 创建转换后,执行静默安装,如下所示:

msiexec /I foo.msi TRANSFORMS=foo.mst /qn /l*v install.log

Silent installations completely skip the UI sequence so you aren't recording user input like a response file. 静默安装完全跳过UI序列,因此您不会像响应文件那样记录用户输入。 You are setting properties and fully skipping the UI. 您正在设置属性并完全跳过UI。

Not quite. 不完全的。

As you probably know, all the UI actions are skipped during a silent installation => no dialogs => no place for user inputs. 您可能知道,在静默安装期间会跳过所有UI操作=>没有对话框=>没有用户输入的位置。

There are methods, though. 但是有一些方法。 You'll have to set the properties as they would have been set by the UI. 您必须设置UI所设置的属性。

  • First, as an alternative, you could build your installer without any dialogs that take user inputs => same outcome with silent and non-silent installations. 首先,作为替代方案,您可以构建安装程序,而无需任何带有用户输入的对话框=>与静默和非静默安装相同的结果。
  • Second, if the defaults are okay, then no properties need to be changed. 其次,如果默认值没问题,则不需要更改任何属性。
  • In any case, you might get by with passing property values on the msiexec command line. 无论如何,您可能会在msiexec命令行上传递属性值。
  • If not, Christopher Painter's answer concerning transforms gives the most general solution. 如果没有,Christopher Painter关于变换的答案给出了最通用的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM