2021年4月9日星期五

Inno Setup: Updating a service running as LocalSystem

I know there are a couple of questions concerning this topic but I found non of these answering my question. The scenario I have is a service that is running under the LocalSystem account (NT-AUTHORITY\SYSTEM) on a Windows machine. This service is being installed from a web application by the user on demand. Now there is a limitation that the service should always run the same version that the web application does. Therefore a version check is made and on mismatch the Inno Setup executable file is downloaded by the service into a temporary directory and on completion the setup is launch by the service. So my understanding of Windows user permissions is, that the setup is run as LocalSystem.

In my Inno Setup script file I have specified both of the following:

// Run in administrative mode by default  PrivilegesRequired=admin  // Allow override of the installation mode via command line switch  PrivilegesRequiredOverridesAllowed=commandline  

But when the service launches the setup, no matter if it passes the /ALLUSERS flag or not, I see the following in the logs:

2021-04-09 08:41:27.226   User privileges: None  2021-04-09 08:41:27.232   Administrative install mode: No  

This causes the setup to abort because it needs administrative rights to stop and start the service and to copy the files to the program files directory.

Is it at all possible to launch a setup with administrative privileges from such a service and how would I do that?

Thanks in advance for any hint!

https://stackoverflow.com/questions/67016548/inno-setup-updating-a-service-running-as-localsystem April 09, 2021 at 03:06PM

没有评论:

发表评论