This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Custom Action to run As Admin
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 18, 2019
03:00 PM
Custom Action to run As Admin
Hello,
I have a Basic MSI project which includes a custom action that runs an Installscript code.
The script has to copy some external files somewhere early in the installation process (later installed services need them).
I set it to run After InstallFiles in Install Exec sequence.
I have to set the In-script Execution for CA as Immediate Execution, if not I cannot retrieve the SOURCEDIR path - where my external files are.
if I build a setup, everything goes well.
If I build only an MSI, the xCopy function in the script fails with 'Access is denied' when the target path is a restricted folder (like 'Program files...'.).
So, I presume that the script does not run with Admin privileges.
How can I force the script to run As Admin?
Do I have other solution?
Thanks,
Ioan
I have a Basic MSI project which includes a custom action that runs an Installscript code.
The script has to copy some external files somewhere early in the installation process (later installed services need them).
I set it to run After InstallFiles in Install Exec sequence.
I have to set the In-script Execution for CA as Immediate Execution, if not I cannot retrieve the SOURCEDIR path - where my external files are.
if I build a setup, everything goes well.
If I build only an MSI, the xCopy function in the script fails with 'Access is denied' when the target path is a restricted folder (like 'Program files...'.).
So, I presume that the script does not run with Admin privileges.
How can I force the script to run As Admin?
Do I have other solution?
Thanks,
Ioan
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 21, 2019
09:07 AM
Have you set "Require Administrative Privileges" to yes in the "Summary Information Stream" of your MSI ?
regards
Markus
regards
Markus
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 24, 2019
09:54 AM
Only Deferred actions can run with Elevated (Administrative) Privileges. To retrieve the value of properties in deferred custom actions, you'll need to use the CustomActionData property to pass information to a deferred action.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)