Click here to Skip to main content
15,903,203 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to call event and method after my setup is complete.
I have setup file of windows form application and I try to call event after-install but I don't get it how to call for application I get all solution for service please give me step by step example how to call afterInstallEvent For Application
thanx in advance

What I have tried:

<pre>  Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Me.WriteToFile("From Laod Form")

    End Sub
  
  Public Event AfterInstall As InstallEventHandler
   
    Sub New()
        MyBase.New()
        AddHandler AfterInstall, AddressOf AfterInstallEventHandler
        Me.WriteToFile("From handler")
    End Sub 'New

    Private Sub AfterInstallEventHandler(ByVal sender As Object, _
                                    ByVal e As InstallEventArgs)
        ' Add steps to perform any actions after the install process.
        Console.WriteLine("Code for AfterInstallEventHandler")
        Me.WriteToFile("Log Entry ")

    End Sub 'AfterInstallEventHandler



    Private Sub WriteToFile(text As String)
        Dim path As String = "Log File Path"
        Using writer As New StreamWriter(path, True)
            writer.WriteLine(String.Format(text))
            writer.Close()
        End Using
    End Sub
Posted
Updated 14-Jul-17 23:27pm

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900