Quantcast
Channel: wixsharp Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1354

New Post: How can best I allow edits on a config file for Windows Service App before the installation?

$
0
0
Typically you would need to find the step name which corresponds to the stage you are interested in and schedule a custom action for this step. In your custom actions you modify the the config file.

For the step name you will need to dig the WiX documantation.
For the config file modifications see the "DeferredActions" sample.
For the service install see the "WinService_WiX" sample.

Though you may find that your custom action will not be elevated and most likely this will prevent you from editing the config file. In this case you may reconsider your strategy. You may install your app fully but do not configure to start start the services at the end of install. Then use deferred action (which is elevated) to modify the config and start the service. The easiest way to define deferred action is to use AfterInstall event of ManagedProject:
project.AfterInstall += msi_AfterInstall;
...
staticvoid msi_AfterInstall(SetupEventArgs e)
{
    MessageBox.Show(e.ToString(), "AfterExecute");
}

Viewing all articles
Browse latest Browse all 1354

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>