简体   繁体   English

Wix Burn安装程序无提示安装时无重启

[英]Wix burn installer no reboot on silent install

I have a wix bundle which installs various modules. 我有一个wix捆绑包,可以安装各种模块。 One of the modules amongst those can cause the system reboot. 其中的一个模块可能导致系统重启。 Now the way I would like to happen is that if it is a UI installation then at the end of the installation of the bundle I would like for a prompt to appear and if it is a silent install then I would like to avoid automatic reboot since the user might not be aware that the installation would cause reboot. 现在,我想发生的方式是,如果它是UI安装,那么在捆绑软件安装结束时,我希望出现提示,如果是静默安装,则我想避免自动重启,因为用户可能不知道安装会导致重新启动。

I looked at various threads and options and found that I can pass a "/norestart" parameter for silent install and that would take care of not doing the automatic reboot. 我查看了各种线程和选项,发现可以通过“ / norestart”参数进行静默安装,并且可以避免不进行自动重启。 So I want to fail the silent install if the user doesn't pass the "/norestart" parameter and allow only if that parameter is passed. 因此,如果用户未通过“ / norestart”参数,并且仅允许通过该参数,我将使无提示安装失败。 I was hoping that the "/norestart" would map to a particular value of the REBOOT ( https://msdn.microsoft.com/en-us/library/windows/desktop/aa371101(v=vs.85).aspx ) but what I am observing is that irrespective whether I pass the "/norestart" parameter or not, the value of REBOOT in the logs is always "ReallySuppress" but it does not automatically reboot when the parameter is passed and reboots when the parameter is not passed. 我希望“ / norestart”可以映射到REBOOT的特定值( https://msdn.microsoft.com/en-us/library/windows/desktop/aa371101(v=vs.85).aspx )但是我观察到的是,无论是否传递“ / norestart”参数,日志中的REBOOT值始终为“ ReallySuppress”,但传递参数时不会自动重新启动,而传递参数时则不会自动重新启动通过。 I am really confused as to how it is determining that and how I should programmatically determine it. 我对它是如何确定以及如何以编程方式确定它感到困惑。

This is from the logs of one of the components when it reboots (when I don't pass the "/norestart" parameter) 这来自重新启动时组件之一的日志(当我不传递“ / norestart”参数时)

Command Line: ALLUSERS=1 ARPSYSTEMCOMPONENT=1 MSIFASTINSTALL=7 CWD=<...> REBOOT=ReallySuppress CURRENTDIRECTORY=<...> CLIENTUILEVEL=3 MSICLIENTUSESEXTERNALUI=1 CLIENTPROCESSID=2240

This is from when it doesn't reboot (when I pass the "/norestart" parameter) 这是从它不重新启动时开始的(当我传递“ / norestart”参数时)

Command Line: ALLUSERS=1 ARPSYSTEMCOMPONENT=1 MSIFASTINSTALL=7 CWD=<...> REBOOT=ReallySuppress CURRENTDIRECTORY=<...> CLIENTUILEVEL=3 MSICLIENTUSESEXTERNALUI=1 CLIENTPROCESSID=1984

Any help or pointers is appreciated. 任何帮助或指针表示赞赏。 If you want me to give more info or if something is unclear then let me know. 如果您想让我提供更多信息或不清楚的地方,请告诉我。 Thanks in advance for your time. 在此先感谢您的时间。

Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/aa372024(v=vs.85).aspx 参考: https : //msdn.microsoft.com/zh-cn/library/windows/desktop/aa372024(v= vs.85) .aspx

https://msdn.microsoft.com/en-us/library/windows/desktop/aa371101(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/aa371101(v=vs.85).aspx

As you have found, MSI packages are always suppressed from initiating a reboot. 如您所见,总是禁止MSI程序包启动重新启动。

What you are missing is that the Bootstrapper Application (eg WixStdBA or a custom / Managed BA) is what controls reboots. 您缺少的是Bootstrapper应用程序(例如WixStdBA或自定义/托管BA)可以控制重新启动。

The BA inspects the result of the installation of each MSI package. BA检查每个MSI软件包的安装结果。 If any of the MSI packages require a reboot, the Bootstrapper Application will initiate the reboot (or not, if the user disallows it or the /norestart switch was passed etc). 如果任何MSI软件包都需要重启,则Bootstrapper应用程序将启动重启(或者,如果用户不允许重启或通过/norestart开关,则不重启)。

The /norestart command line switch only prevents the Bootstrapper Application from initiating a reboot at the end of the bundle / chain. /norestart命令行开关仅阻止Bootstrapper应用程序在包/链的末尾启动重新引导。

I'm pretty sure you'd have to use a custom Bootstrapper Application if you wanted to block installation based on the absence of /norestart . 我非常确定,如果您想基于/norestart的存在而阻止安装,则必须使用自定义的Bootstrapper应用程序。

But if you're going to use a custom Bootstrapper Application, you might as well just change the default behaviour (ie make /norestart the default). 但是,如果您要使用自定义的Bootstrapper应用程序,则最好更改默认行为(即,使/norestart为默认值)。

The default value for the REBOOT property is not ReallySuppress, so something else is going on. REBOOT属性的默认值不是ReallySuppress,因此发生了其他情况。 Without looking at the source, any custom actions, or the MSI it's hard to say why this is. 如果不查看源代码,任何自定义操作或MSI,很难说出原因。 A complete verbose log might show it being set; 完整的详细日志可能表明已设置。 it might be in the Property table of the MSI; 它可能在MSI的属性表中; it could be set from custom action code; 可以通过自定义操作代码进行设置; What else is on the command line? 命令行上还有什么? It needs some detective work. 它需要一些侦探工作。

The other issue is that a completely silent install is not going to ask for a reboot, because silent means that it cannot ask, so it's somewhat unclear what the settings are for other properties, ScheduleReboot possibilities and so on. 另一个问题是,完全静默的安装不会要求重新启动,因为静默意味着它不会要求重新启动,因此,尚不清楚其他属性的设置,ScheduleReboot可能性等。 I find it easier to use the traditional command line options, such as /qb and so on because they tend to be more explicit about what they do. 我发现使用传统的命令行选项(例如/ qb等)更加容易,因为它们倾向于更明确地说明它们的作用。 Post a complete full verbose log somewhere if you need people to decipher it. 如果您需要人们对其进行解密,请在其某处发布完整的完整详细日志。

Suppressing reboots typically isn't a good idea. 禁止重新启动通常不是一个好主意。 The main reason they are required is that files need replacing in a way that requires a reboot. 需要它们的主要原因是文件需要以需要重新引导的方式进行替换。 That means that the install is incomplete until the next reboot, and attempting to run the installed app can cause issues if it uses the older files instead of the newer ones that are not yet in place. 这意味着在下一次重新启动之前,安装尚未完成,如果尝试使用已安装的应用程序使用较旧的文件而不是尚未安装的较新文件,则可能会导致问题。

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

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