维克斯:托管BA命令行无效 [英] Wix: Managed BA command line not effective
问题描述
虽然与打rel=\"nofollow\"> TestBA引导程序首先,我安装了1.0.0.0。
然后我递增版本1.0.0.1和记录的过程。这里是-uninstall -quite命令行是升级过程中通过部分:
While playing with TestBA Bootstrapper from Bryan, first I installed 1.0.0.0. Then I incremented version to 1.0.0.1 and logged the process. Here is the part where -uninstall -quite command line was passed during upgrade:
[2870:21C0][2014-02-24T17:46:38]i300: Apply begin
[1A44:1E54][2014-02-24T17:46:41]i360: Creating a system restore point.
[1A44:1E54][2014-02-24T17:47:15]i361: Created a system restore point.
[1A44:1E54][2014-02-24T17:47:15]i000: Caching bundle from: 'C:\Users\fwaheed\AppData\Local\Temp\{57a07296-0310-4628-971c-2da38aa09f25}\.be\BootstrapperSetup.exe' to: 'C:\ProgramData\Package Cache\{57a07296-0310-4628-971c-2da38aa09f25}\BootstrapperSetup.exe'
[1A44:1E54][2014-02-24T17:47:15]i320: Registering bundle dependency provider: {57a07296-0310-4628-971c-2da38aa09f25}, version: 1.0.0.1
[1A44:2B40][2014-02-24T17:47:16]i305: Verified acquired payload: DummyInstallationPackageId at path: C:\ProgramData\Package Cache\.unverified\DummyInstallationPackageId, moving to: C:\ProgramData\Package Cache\{F1D62AA5-E68C-4B99-A6DD-D7EAE5A1D238}v1.0.0.1\DummyInstaller.msi.
[1A44:1E54][2014-02-24T17:47:16]i323: Registering package dependency provider: {F1D62AA5-E68C-4B99-A6DD-D7EAE5A1D238}, version: 1.0.0.1, package: DummyInstallationPackageId
[1A44:1E54][2014-02-24T17:47:16]i301: Applying execute package: DummyInstallationPackageId, action: Install, path: C:\ProgramData\Package Cache\{F1D62AA5-E68C-4B99-A6DD-D7EAE5A1D238}v1.0.0.1\DummyInstaller.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7"'
[2870:21C0][2014-02-24T17:47:22]i319: Applied execute package: DummyInstallationPackageId, result: 0x0, restart: None
[1A44:1E54][2014-02-24T17:47:22]i325: Registering dependency: {57a07296-0310-4628-971c-2da38aa09f25} on package provider: {F1D62AA5-E68C-4B99-A6DD-D7EAE5A1D238}, package: DummyInstallationPackageId
[1A44:1E54][2014-02-24T17:47:22]i301: Applying execute package: {f1d57671-5e3d-4be7-908f-5a47e72737d9}, action: Uninstall, path: C:\ProgramData\Package Cache\{f1d57671-5e3d-4be7-908f-5a47e72737d9}\BootstrapperSetup.exe, arguments: '"C:\ProgramData\Package Cache\{f1d57671-5e3d-4be7-908f-5a47e72737d9}\BootstrapperSetup.exe" -uninstall -quiet -burn.related.upgrade'
[2870:21C0][2014-02-24T17:48:54]i319: Applied execute package: {f1d57671-5e3d-4be7-908f-5a47e72737d9}, result: 0x0, restart: None
[2870:21C0][2014-02-24T17:48:54]i399: Apply complete, result: 0x0, restart: None, ba requested restart: No
[2870:21C0][2014-02-24T17:48:55]i500: Shutting down, exit code: 0x0
问题:而不是静静地卸载,它会显示卸载对话框。如果我点击卸载,会卸载1.0.0.0,然后应用程序将被升级到1.0.0.1。
Problem: Instead of quietly uninstalling, it would display the Uninstall Dialog. And if I click Uninstall, it would uninstall 1.0.0.0 and then application would be upgraded to 1.0.0.1.
问:如何使之了解其命令行参数,做的过程中没有显示卸载对话框
Question: How to make it understand its command line arguments and do the process without showing Uninstall Dialog box?
我也咨询从维克斯3.7源WixBA项目,但它的命令行处理只处理InstallFolder说法。
I also consulted in WixBA project from Wix 3.7 source, but its command line handling is only handling InstallFolder argument.
我真的很感激任何帮助,因为这样升级方案是阻止我的引导程序的项目。
I would really appreciate any help, as this upgrade scenario is block my Bootstrapper project.
感谢一大堆。
推荐答案
关键是要的拾取了 -quiet
标记和不可以显示UI,而是只执行所请求的操作。
The key is to pick-up the -quiet
flag and not display a UI, and instead just execute the action being requested.
这是通过使用 DISPLAYMODE
属性,它使用了显示引导程序的基类暴露
枚举值。选项有
This is exposed via the Bootstrapper base class using the DisplayMode
property, which uses a Display
enum value. Options are
public enum Display
{
Unknown,
Embedded,
None,
Passive,
Full,
}
您可以然后确定通过 Command.Action
值(同样,在引导程序基类)要执行的动作,它使用一个 LaunchAction
枚举。选项包括:
You can then determine which action to execute via the Command.Action
value (again, in the Bootstrapper base class) which uses a LaunchAction
enum. Options are:
public enum LaunchAction
{
Unknown,
Help,
Layout,
Uninstall,
Install,
Modify,
Repair,
}
所以,我用我命名的自定义属性 RunningSilent
来检测模式,我不应该显示一个UI,然后利用了如下图所示:
So, I've used a custom property I named RunningSilent
to detect the modes where I should not display a UI, then utilize that as shown below:
/// <summary>
/// True if running in silent display mode (ie: no UI).
/// </summary>
public virtual bool RunningSilent
{
get
{
return (DisplayMode != Display.Full && DisplayMode != Display.Passive);
}
}
protected override void Run()
{
if (RunningSilent)
{
Log("Running without UI");
LaunchAction requestedAction = Command.Action;
//... this is an async call, so handle it accordingly.
Engine.Plan(requestedAction);
//... followed by Engine.Apply();
}
else
{
Log("Showing UI window");
//.. Run your Managed UI
}
}
这篇关于维克斯:托管BA命令行无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!