arunm
arunm

Reputation: 63

MSI Installer not working when run from task scheduler

I have a .msi installer that installs a component of an application that my company develops. I am trying to automate the installation process.

I have found that the msi installs fine when I run it from the GUI, when I run the silent install commands from PowerShell, schedule the task to run as a user who is logged in but fails when I try to schedule it to run as a user that never logged in. In this situation I get the following error message:

*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 ===*

I need fix this issue because the application will be installed silently on a new server that no one has logged into.

I have scheduled the task to run whether the user is logged in or not and run with the highest privileges. Anyone have any ideas what maybe causing this and how I can get around it?

Upvotes: 0

Views: 2511

Answers (1)

Stein Åsmul
Stein Åsmul

Reputation: 42216

Logging: That log is too short to determine what is going on. Have a look at this answer on logging.


Impersonation: MSI GUI is run in user context. The actual installation is run as LocalSystem (system context). Skipping the user interface runs everything in system context. Running as a user without generated profile will not allow proper folder resolution and a runtime error is likely. Some installers are made to be per-user only (not that many). Most can be installed for all users.


Per-Machine: MSI files should install OK without any logged in user in most cases if you install "per-machine" - that means that the software is installed for all users on the machine.

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

Custom Actions: Some custom actions are badly designed and cause failure in scenarios that involve user profile activity - that could be the cause of this problem as well. Try another MSI for testing?


Important note: The below may not be relevant for your case, but you should know about these technical details for your overall scenario (silent running of MSI installers):

UILevel: You should be aware that UILevel affects installation and uninstallation (different levels of silent running for MSI files - 4 in total). Have a quick read here please: Uninstall from Control Panel is different from Remove from .msi


Further Links:

Upvotes: 1

Related Questions