如何在VB.NET中安装应用程序后调用方法 [英] How to call method after install my setup of application in VB.NET

查看:95
本文介绍了如何在VB.NET中安装应用程序后调用方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在设置完成后调用事件和方法。

我有windows窗体应用程序的设置文件,我尝试在安装后调用事件但我不明白如何请求申请我得到所有服务解决方案请给我一步一步的例子如何调用afterInstallEvent申请

$提前



< b>我尝试了什么:



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

推荐答案

也许这会有所帮助: Visual Studio安装程序 - 项目和自定义操作 - 简单对话 [ ^ ]
Maybe this will be of help: Visual Studio Setup - projects and custom actions - Simple Talk[^]


这篇关于如何在VB.NET中安装应用程序后调用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆