toonetown
Posts: 37
Joined: Wed May 16, 2018 3:46 pm

Launch Installed File as different user

Is there a way to run the custom actaion "Launch Installed File" as a different user? For example, I'd like to run an application as the currently logged-in user (as fetched by the `LogonUser` property).

I have investigated using `runas` command, but that prompts for a password.

I can also use `schtasks` to create a task to run at some point in the future, but then it only runs on whole minute intervals, and it feels kind of hacky.

This is likely possible by writing a custom DLL that uses the ImpersonateUser system calls...but that's quite a heavy-weight approach.

I'm wondering if there is some feature within AI or as a part of the MSI frameworks that I'm missing that would allow doing this (what I would assume is a) fairly common task.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Launch Installed File as different user

Hello,

Unfortunately we do not have dedicated support for this. Can you please make sure you did not select the "Run under the LocalSystem account with full privileges (no impersonation)" option for your custom action?

When the above option is deselected the custom action should run under the user account which launched the installation (most commonly this is the currently logged on user account). Do you have a different installation scenario? If so, can you please give us more details about this, maybe exemplify us a small use case?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
toonetown
Posts: 37
Joined: Wed May 16, 2018 3:46 pm

Re: Launch Installed File as different user

Our upgrade installer is automatically launched and silently run by a service running as the local SYSTEM account. That is the reason we are not able to launch as the logged on user. I guess we will go the custom dll route. I just wanted to make sure that I wasn’t missing something prebuilt into advanced installer.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Launch Installed File as different user

Hello,

Thank you for your follow up on this.

Indeed, we do not have support for this. The only option for you will be a custom action.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”