Windows Service MSI Installer - Custom action (EXE) not running with elevated permissions
Posted: Thu Aug 22, 2019 8:07 am
To help you better we need some information from you.
*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build:
32 or 64 bit version of product: 64-bit
Operating system: Windows 10 Pro
32 or 64 bit OS: 64-bit
*** Please add details and screenshots as needed below. ***
I have created a Windows Service which works perfectly, PS Studio made this a lot easier. The only issue I have at the moment is that I need to capture a value from the user as part of the installation and save the value to the registry. The 'Use a simple UI when installing' checkbox is a dream and makes the installer creation and package itself very professional and simple to use, but it really is a simply UI with no configuration or branding options.
When I run the MSI without any custom actions everything works as expected, but because I didn't collect a vital value from the user the service itself is useless.
To collect the ID I have created a custom action which runs Install.exe (which is a 'compiled' .ps1 script that prompts for a value in a small window and writes to the registry). Unfortunately the service's MSI is run as administrator but Install.exe is not inheriting these elevated permissions, and so it fails to write to the registry and the install process fails.
The EXE also has a manifest to require elevation.
How can I get the EXE (which collects the ID from the user) to run with elevated permissions, when it is being triggered as a custom action by the MSI which is aleady running with elevated permissions?
One important note is that if I run Install.exe manually rather than as a custom action, it requests elevation and works perfectly. Both components works perfectly in isolation, but together it fails.
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build:
32 or 64 bit version of product: 64-bit
Operating system: Windows 10 Pro
32 or 64 bit OS: 64-bit
*** Please add details and screenshots as needed below. ***
I have created a Windows Service which works perfectly, PS Studio made this a lot easier. The only issue I have at the moment is that I need to capture a value from the user as part of the installation and save the value to the registry. The 'Use a simple UI when installing' checkbox is a dream and makes the installer creation and package itself very professional and simple to use, but it really is a simply UI with no configuration or branding options.
When I run the MSI without any custom actions everything works as expected, but because I didn't collect a vital value from the user the service itself is useless.
To collect the ID I have created a custom action which runs Install.exe (which is a 'compiled' .ps1 script that prompts for a value in a small window and writes to the registry). Unfortunately the service's MSI is run as administrator but Install.exe is not inheriting these elevated permissions, and so it fails to write to the registry and the install process fails.
The EXE also has a manifest to require elevation.
How can I get the EXE (which collects the ID from the user) to run with elevated permissions, when it is being triggered as a custom action by the MSI which is aleady running with elevated permissions?
One important note is that if I run Install.exe manually rather than as a custom action, it requests elevation and works perfectly. Both components works perfectly in isolation, but together it fails.
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM