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

New Post: Running installed program after Install

$
0
0
Great. If you collect user input (choice to run or not) before you start the actual install the you will need to propagate this information to the project_AfterInstall handler. There are a few ways to do that one way is to store the info in the session property then "tunnel" it into deferred AfterInstall event:
var project = new ManagedProject("My Product",
                  new Property("EXECUTEATE_THE_APP", "no"),
                  ...
project.DefaultDeferredProperties += ",EXECUTEATE_THE_APP";
...
//in cutom dialog set EXECUTEATE_THE_APP variable
...
staticvoid project_AfterInstall(SetupEventArgs e)
{
    if (e.IsInstalling && e.session.Property("EXECUTEATE_THE_APP") != "no")
    {
        var app = System.IO.Path.Combine(e.Session.Property("INSTALLDIR"), 
                                        @"My Company\My Product\product.exe");
        Process.Start(app, "/install");
    }
}
An alternative technique is demonstrated in the 'Setup Events' sample.

Cheers,
Oleg

Viewing all articles
Browse latest Browse all 1354

Trending Articles



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