Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 2

Custom action in Basic MSI, in-script execution?


I have a question relating to setting up a custom action and which in-script execution to use.
I am confused with the "Terminal Server Aware" option. For instance I have the following options...

- Deferred Execution
- Deferred Execution (Terminal Server Aware)

The custom action that runs a .bat file and will be installed both locally and by a remote desktop connection.
Is it better to use Deferred Execution (Terminal Server Aware) since the software could be installed via a remote desktop?
What are the differences between the two?

Thanks in advance!!
Labels (1)
0 Kudos
(1) Reply
Level 7

The msidbCustomActionTypeTSAware flag differentiates between the user context in which your deferred (i.e. "in-script") custom action will execute.

"Executes with user impersonation. Runs with user impersonation during per-machine installs on a server running the Terminal Server role service. Normal deferred execution custom actions, without this attribute, run with no user impersonation on a terminal server during per-machine installations. This attribute has no effect if the action also has the msidbCustomActionTypeNoImpersonate attribute."

I admit that I do not have the experience launching a .bat file from a in-script custom action, but my guess is that it depends on what the CA and the .bat are doing and what the user's privileges are. When using Remote Desktop without this flag the CA will run in the context of the remote server's local system account (even if on a 'local' system it would have run using impersonation). With this flag the CA would run in the context of the user that connected to the remote server (unless the 'no impersonation' flag was also used), the same as it would run on the local system. At least that is my understanding.
0 Kudos