我对VB.NET有点新,所以我来这里问一个问题。我制作了一个自定义安装程序,它启动位于本地目录中的“setup.exe”,并由Visual Studio的“发布”功能创建。我想我的WindowsFormApplication
从'setup.exe'得到'是或否'的结果,如果是,它将启用button1
,如果否,它将显示MsgBox
告诉“进程被用户取消。我研究了。很多只讲述如何从MsgBox
得到YesorNo
结果,并做一些动作在互联网上我尝试这样做:从推出的应用程序获得'是或否'结果 - Vb.net
Dim result As Integer = Process.Start("setup.exe")
If result = Result.No Then
MessageBox.Show("Process Cancelled by user")
ElseIf result = Result.Yes Then
Button1.Enabled = True
End If
'Publish'生成的setup.exe旨在用作ClickOnce安装程序。由部署项目(ISLE或[扩展名](https://visualstudiogallery.msdn.microsoft.com/f1cc3f3e-c300-40a7-8797-c509fb8933b9)生成的setup.exe包含取消按钮。 – peterG
谢谢,但我已经安装了“Microsoft Visual Studio 2015安装程序项目”。 f这种方法对Visual Studio生成的setup.exe是不可能的,有没有其他方法可以做到这一点? –
我不知道你要做什么,tbh,但我认为[这个问题](http://stackoverflow.com/questions/1585354/get-return-value-from-process)可能是你正在寻找。 – peterG