简体   繁体   English

WiX静默安装条件通过财产

[英]WiX silent install condition via property

Is it possible to make a silent install without the "/q" parameter via a condition within the WiX Setup? 是否可以通过WiX设置中的条件进行无“/ q”参数的静默安装?

I have a UIRef and a silent property with the value of 1 and now I want to install silent if this property is 1. 我有一个UIRef和一个值为1的静默属性,现在我想安装静态,如果此属性为1。

WiX GUI : Never seen this to be honest, and I wouldn't recommend it. WiX GUI :从来没有看到这是诚实的,我不会推荐它。 Some MSI files have no GUI in them at all, and then they install without any GUI - obviously. 一些MSI文件根本没有GUI,然后它们安装时没有任何GUI - 显然。 I suppose that is one option that is unacceptable. 我认为这是一个不可接受的选择。

Condition : I had a quick look, and conditioning the WelcomeDlg entry in InstallUISequence might work, though I find it a very odd design: 条件 :我快速浏览了一下,并且调整InstallUISequenceWelcomeDlg条目可能会有效,尽管我发现这是一个非常奇怪的设计:

  1. Use Orca and add this condition to the WelcomeDlg : (NOT Installed OR PATCH) AND (NOT SILENT=1) 使用Orca并将此条件添加到WelcomeDlg :(未(NOT Installed OR PATCH) AND (NOT SILENT=1) WelcomeDlg (NOT Installed OR PATCH) AND (NOT SILENT=1)
  2. Also add an entry to the Property table ; 还要在Property table添加一个条目; SILENT=0 to avoid silent being the default run mode SILENT=0以避免静默为默认运行模式

Now you can try double clicking the MSI and you will see dialogs. 现在您可以尝试双击MSI,您将看到对话框。 If you use the below command line there should be no dialogs, but you will see a progress bar and you will get the UAC elevation prompt: 如果您使用以下命令行,则应该没有对话框,但您将看到一个进度条,您将获得UAC提升提示:

msiexec.exe /i MySetup.msi SILENT=1

WiX Snippet : Here is the markup you can try to use. WiX Snippet :这是您可以尝试使用的标记。 No guarantees! 不保证! :-). :-)。 I can replace with a full "small runnable" sample if requested - the below is just what you can "slipstream" into a working setup. 如果需要,我可以用完整的“小型可运行”样本替换 - 下面就是您可以“滑入”工作设置的内容。 You also need to change the maintenance mode / uninstall dialogs if you want uninstall, modify and repair to be silent. 如果要将卸载,修改和修复设置为静默,还需要更改维护模式/卸载对话框。 Making modify silent sort of does not make sense. 进行修改静默排序没有意义。

Please remember that the markup is a "hack" and has not been fully tested in all installation modes: install , modify , repair , self-repair , patch , resume suspended , uninstall , major upgrade uninstall , etc... - please test accordingly - there are always surprises: 请记住,标记是“黑客”,并未在所有安装模式下进行全面测试: installmodifyrepairself-repairpatchresume suspendeduninstallmajor upgrade uninstall etc... - 请相应地进行测试 - 总会有惊喜:

 <..> <Property Id="SILENT" Value="0" /> <UIRef Id="WixUI_Mondo" /> <..> <InstallUISequence> <Show Dialog="WelcomeDlg" After="ResumeDlg">(NOT Installed OR PATCH) AND (NOT SILENT=1)</Show> <Show Dialog="ExitDialog" OnExit="success">(NOT SILENT=1)</Show> </InstallUISequence> <..> 

Note! 注意! Constructs like these tend to backfire in real life. 像这样的构造在现实生活中往往会适得其反。 Suddenly you see a problem you never expected in some obscure installation mode (suspended resume, patch, modify or similar). 突然间,你会看到一个在一些不起眼的安装模式中没想到的问题(暂停的简历,补丁,修改或类似)。 If you want to use this, make sure you test well. 如果您想使用它,请确保测试良好。

Note that there are other dialogs - such as modify and repair (maintenance mode dialogs) - that will still show up. 请注意,还有其他对话框 - 例如修改和修复(维护模式对话框) - 仍会显示。 You have to condition them as well if you want them to behave differently (and perhaps persist the SILENT property to determine i if you want to suppress dialogs or not). 如果你希望它们的行为不同,你也必须对它们进行条件化(并且可能会保持SILENT属性以确定是否要禁止对话框)。

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

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