【发布时间】:2015-06-15 23:09:33
【问题描述】:
问题的目的是在 installshield 开始安装服务后停止安装。
特别是,如果在所选目录中找不到文件file.txt,我想停止安装(用户将选择安装路径)。
为了控制它,我从ServiceInstaller 调用BeforeInstall 事件。
Private Sub ServiceInstaller1_BeforeInstall(sender As Object, e As InstallEventArgs) Handles ServiceInstaller1.BeforeInstall
Dim filePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).Replace("\", "\\")
If Not File.Exists(filePath) & "\file.txt" Then
MsgBox("The specified file is not found in that path, the installation will stop.")
'Missing code
End If
End Sub
我尝试了End、Exit 和许多其他人,但没有人停止安装。
【问题讨论】:
-
您可能想显示一个
Dialog,然后决定关闭 installshield 托架,在您的程序中调用类似return 0的内容 -
什么样的对话框?我怎样才能做到这一点?请再解释一下。
-
Dialog窗口,一种常见的通知用户的方式,可能通过添加“确定”或“取消”按钮等决定来通知用户。 -
是的,我明白了。我的意思是,使用那个对话框窗口,我怎样才能停止安装进行回滚?
标签: vb.net events installation installshield