从任务计划程序运行时,MSI安装程序无法运行

时间:2020-07-05 17:07:49

标签: windows powershell windows-installer taskscheduler

我有一个.msi安装程序,用于安装我公司开发的应用程序组件。我正在尝试自动化安装过程。

我发现从GUI运行msi时可以很好地安装它,当我从PowerShell运行静默安装命令时,将任务计划为以登录用户身份运行,但是在尝试将其计划为以从未登录过的用户身份运行。在这种情况下,我收到以下错误消息:

*MSI (s) (B8:C8) [16:58:06:301]: Closing MSIHANDLE (498) of type 790542 for thread 3784
MSI (s) (B8:C8) [16:58:06:316]: Deferring clean up of packages/files, if any exist
MSI (s) (B8:C8) [16:58:06:316]: MainEngineThread is returning 1603
MSI (s) (B8:BC) [16:58:06:316]: RESTART MANAGER: Session closed.
MSI (s) (B8:BC) [16:58:06:316]: No System Restore sequence number for this installation.
=== Logging stopped: 7/5/2020  16:58:06 ===
MSI (s) (B8:BC) [16:58:06:316]: User policy value 'DisableRollback' is 0
MSI (s) (B8:BC) [16:58:06:316]: Machine policy value 'DisableRollback' is 0
MSI (s) (B8:BC) [16:58:06:316]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (B8:BC) [16:58:06:316]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 
MSI (s) (B8:BC) [16:58:06:316]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 
MSI (s) (B8:BC) [16:58:06:316]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
MSI (s) (B8:BC) [16:58:06:316]: Destroying RemoteAPI object.
MSI (s) (B8:78) [16:58:06:316]: Custom Action Manager thread ending.
MSI (c) (A4:E8) [16:58:06:332]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
MSI (c) (A4:E8) [16:58:06:332]: MainEngineThread is returning 1603
=== Verbose logging stopped: 7/5/2020  16:58:06 ===*

我需要解决此问题,因为该应用程序将在没有人登录的新服务器上静默安装。

我已安排任务运行,无论用户是否登录并以最高特权运行。任何人都有任何想法可能导致这种情况,以及如何解决它?

谢谢

1 个答案:

答案 0 :(得分:1)

记录 :该日志太短,无法确定正在发生的情况。 Have a look at this answer on logging


假冒 :MSI GUI在用户上下文中运行。实际安装以LocalSystem(系统上下文)运行。跳过用户界面将在系统上下文中运行所有内容。以没有生成配置文件的用户身份运行将不允许正确的文件夹解析,并且可能会出现运行时错误。某些安装程序仅针对每个用户使用(不是很多)。大多数可以为所有用户安装。


每台机器 :如果您安装“每台机器”,则大多数情况下MSI文件应在没有任何登录用户的情况下安装OK。适用于计算机上的所有用户。

Can you show us the exact command line you use to install the software?sample

自定义操作 :某些自定义操作设计不当,在涉及用户个人资料活动的情况下会导致失败-也可能是此问题的原因。 Try another MSI for testing?


重要说明 :以下内容可能与您的情况无关,但您应该了解整体情况下的这些技术详细信息(静默运行MSI安装程序):

UILevel:您应注意UILevel影响安装和卸载(MSI文件的静默运行级别不同-总共4个)。请在这里快速阅读:Uninstall from Control Panel is different from Remove from .msi


其他链接