Visual Studio Installer > How To Launch App at End of Installer

前端 未结 6 919
再見小時候
再見小時候 2020-11-29 17:59

This is probably a stupid question and my Googling just is not functioning today.

I have an application I added a Visual Studio Installer > Setup Wizard project to.

6条回答
  •  难免孤独
    2020-11-29 18:18

    Warning: The application will end up running as a high privilege account, which has security and user experience implications.

    In Visual Studio 2010 here it is easy...

    Step1: Add a new installer class to the application project that you wish to run after install, call it what you like.

    Step2: Add the following code to the Installer class you just added replcaing MyApplication.exe with the name of yours.

    Public Overrides Sub Commit(ByVal savedState As System.Collections.IDictionary)
    
        MyBase.Commit(savedState)
        System.Diagnostics.Process.Start(System.IO.Path.GetDirectoryName(Me.Context.Parameters("AssemblyPath")) + "\MyApplication.exe")
    
    End Sub
    

    Compile and go...

提交回复
热议问题