[英]how to update a visual basic application without reinstalling
I have a simple form with a button when clicked says Hello. 我有一个简单的带有按钮的表格,当您单击“说好”时。
Code as follows: 代码如下:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("hello")
End Sub
End Class 末级
I installed it on my machine and now I was wondering how would i write updates to it without reinstalling the whole thing? 我将其安装在计算机上,现在我想知道如何在不重新安装整个内容的情况下对其进行更新?
You could roll your own updater app which checks on an ftp site / web site for files which are newer. 您可以滚动自己的更新程序应用程序,该应用程序在ftp站点/网站上检查较新的文件。 But it will have to be a separate app because you won't be able to update the currently running exe without stopping it first.
但这必须是一个单独的应用程序,因为您必须先停止它才能更新当前正在运行的exe。 Also the location of files can be an issue depending on permissions etc.
文件的位置也可能是一个问题,具体取决于权限等。
A better option as HansPassant suggested is to use ClickOnce deployment. HansPassant建议的更好的选择是使用ClickOnce部署。 This handles all the above for you and allows you to force your application to check for updates before it runs so you know you have the latest version out there.
这将为您处理以上所有问题,并允许您强制应用程序在运行之前检查更新,以便您知道那里有最新版本。
Here is a link to get you started 这是一个让您入门的链接
If YOU KNOW that the updates have no problems with the various environment (eg: no change in framework, DB, etc, etc) and you are just testing and work in a "controlled" place then you can simply replace the executable file. 如果您知道更新对各种环境都没有问题(例如:框架,数据库等没有变化),而您只是在“受控”位置进行测试和工作,则只需替换可执行文件即可。
But I certainly prefer ClickOnce :-) 但我当然更喜欢ClickOnce :-)
Once you set it up it works so nicely that the time to update the application is just a little more than replacing the executable... and you are much more safe 设置完成后,它的工作原理非常好,以至于更新应用程序的时间仅比替换可执行文件多一点……而且您更加安全
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.