Sample for "Modifying app config file as a post-install action"

Jun 6, 2016 at 6:27 PM
I have been unable to locate the sample for modifying an app.config file after installation, which is mentioned in the home page. Could someone please point me to the sample?
Thank you.
Jun 7, 2016 at 2:15 AM
Here: Samples/DeferredActions/setup.cs
Jun 22, 2016 at 11:03 AM

I have tried this modification method but custom action OnInstall is not getting executed. Hence the file is copied as it is. Could u please help?
Jun 24, 2016 at 5:28 AM
There is a mistake in the sample. It sets managed action to rollback. This is a typo as it has to be:
Execute = WixSharp.Execute.deferred
You can even completely remove the line as ElevatedManagedAction constructor sets it to deferred anyway. It is in fact what makes a ManagedAction into ElevatedManagedActions.

Though to be honest I would rather go with project.AfterInstall event. It completely eliminates the errors as this.
Jun 29, 2016 at 1:11 PM
Hi oleg,

Thnx fr replying. I had tried to use after_install but the issue was when i tried to save the file it kept giving access denied err.

So I modified ElevatedmanagedAction to be run in InstallExcutesequence on InstallFinalize that worked like a charm :) :)
Jun 29, 2016 at 2:14 PM
Great. I am glad you sorted it out.

Just in case I have checked the after_install event again. It seems like it works fine and the event handler is properly elevated and I was able successfully overwrite the just installed text file. However, of course, there could be other (Wix# unrelated) reasons for your "access denied err".