Hello Justin,
I run the .msi by double click not using command prompt. Does it cause to request administrator privileges again?
In
"Custom Actions" page, we can see that the installation process consists of two stages:
-
Wizard Dialogs Stage (also called the
client process)
-
Install Execution Stage (also called the
server process)
When launching an MSI by double clicking on it, if it is scheduled to install into a per-machine location that by default requires administrator privileges (e.g. the
"Program Files" folder), it will elevate when the user pressed on the
"Install" button.
When the user presses the "Install" button is when the MSI goes from the
"client" process to the
"server" process.
During the "server" process, the system is being modified (e.g. the files are installed, registry entries are written, etc.), therefore this is the reason why the elevation happens right before that.
Now, if your custom action is executed during the
"Install Execution Stage", then the custom action should inherit the elevation from the parent process (the "server" process).
Now, you did not quite mentioned how your custom action is scheduled.
When I asked this:
If possible, could you please give me some more details about your custom action so I can further investigate this (e.g. some screenshots of the custom action and its' settings)?
The reason why I asked for the screenshots of the custom action was to see how it is scheduled.
Could you please take a screenshot of the custom action in the
"Custom Actions" page and forward that to me so I can have a look over it?
how do I build both exe and msi files at same time?
I am afraid you can not build both an EXE and an MSI from the same build (both being functional on their own, of course). To achieve this, you will need to use
"Multiple Builds Configurations".
However, I do not think you need to do that since that is most likely not the cause of this.
Looking forward to hearing from you!
Best regards,
Catalin