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

New Post: Launch application after install as normal user

$
0
0
The scenario you are describing is rather less common as usually the after-install executions need top be elevated (e.g. product itself or its config util) That is why the AfterInstall event handlers are scheduled by Wix# as deferred (elevated).

Meaning that events are not completely suitable for you. You will need to use managed custom actions instead. The code below shows how to start Notepad with normal user privileges:
var project = new Project("CustomActionTest",
        new Dir(@"%ProgramFiles%\My Company\My Product", 
            new File("setup.cs")),
        new ManagedAction(CustomActions.RunNotepad, Return.check, 
                          When.After, Step.InstallFinalize, Condition.NOT_Installed)
        ...        

publicclass CustomActions
{
    [CustomAction]
    publicstatic ActionResult RunNotepad(Session session)
    {
        try { Process.Start("notepad.exe"); } catch { }

        return ActionResult.Success;
    }
}        

Viewing all articles
Browse latest Browse all 1354

Trending Articles



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