Elevation problem with InstallFinalize action - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

tmitchell
Posts: 5
Joined: Fri Jul 03, 2009 11:25 pm

Elevation problem with InstallFinalize action

I'm using the ReplaceInFile vbs code that is circulated around this forum to put the install path into a configuration file our software needs to run. It's a simple insertion of the "C:\Program Files\Blah" for [InstallDir] within a single text file... fairly simple.

The issue seems to be that the .vbs does not run with elevated privileges so it cannot write to a file once it has been placed into the Program Files folder. Is there a way around this?

Alternatively, is there a way to have AI place the correct values into that file BEFORE it copies it into the Program Files folder?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Elevation problem with InstallFinalize action

Hi,

To run a custom action with Administrator privileges you can use the "Deferred with no impersonation" option in the Custom Action Properties pane. This way it will run under the local system account with full privileges.
Alternatively, is there a way to have AI place the correct values into that file BEFORE it copies it into the Program Files folder?
This is supported only for INI files and XML files.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tmitchell
Posts: 5
Joined: Fri Jul 03, 2009 11:25 pm

Re: Elevation problem with InstallFinalize action

I see that option, however it's greyed out. Only "Immediate Execution" is selectable.

Is there a better place to put a script like this than in the InstallFinalize action?
tmitchell
Posts: 5
Joined: Fri Jul 03, 2009 11:25 pm

Re: Elevation problem with InstallFinalize action

Ran in the Commit action, seemed to work correctly.

Thanks for the help.

Return to “Common Problems”