创建一个补丁来升级.NET应用程序创建一个、应用程序、补丁、NET

2023-09-03 10:24:12 作者:白衣牛仔少年痴货最帅比@

我想创建一个补丁,我的.NET应用程序。的要求是:

I would like to create a patch for my .NET application. The requirements are:

找到安装目录 覆盖旧的文件与新的 在重新启动Windows服务

我想更新程序发送给用户,让他们简单地运行它,并更新应用程序。使用Visual Studio部署项目创建我的原始安装程序。

I want to send the updater to the user so that they simply run it and update the application. My original installer is created using Visual Studio Deployment Project.

我做了很多,如果研究,发现这一点:

I did alot if research, and found this:

What是最好的选择。构建Windows安装程序?

How要更新安装窗口应用程序(创建补丁)

的http://wyday.com/forum/viewtopic.php?f=1&t=245&p=793&hilit=offline+install#p793

http://www.advancedinstaller.com/user-guide/tutorial- patch.html

我试图创建这将只包含我需要更换的文件,但是我无法找到一个方法来确定我的应用程序的安装目录下的另一个安装程序。

I tried created another installer which would just contain the files I need to replace, however I could not find a way to determine the installation directory of my application.

WyBuild似乎是一个很好的解决方案,但是它们不支持离线安装,并要求您的主机服务器上的更新文件。

WyBuild seemed like a good solution, however they do not support an offline install and require you to host the update files on the server.

我试图创建使用高级安装补丁程序,但它只是产生了一堆的构建错误,我无法修复的。

I tried creating a patch using Advanced Installer but it just generates a bunch of build errors that I could not fix.

有教程如何修改使用逆戟鲸或WIX的MSI文件,但似乎很多更复杂的比它应该是。

There are tutorials how to modify the MSI files using Orca or WIX, but that seems alot more complicated than it should be.

我忍不住要推出自己的,但我不知道如何去做,而这似乎是这样一个基本的要求,有得是一个解决方案,在那里了。

I am tempted to roll my own but I am not sure how to go about it, and this seems like such a basic requirement that there's got to be a solution out there already.

推荐答案

如果您已经使用AA VS安装项目,你可以部署该项目的新版本,它会升级现有的安装。有一个在安装和升级的ID。该服务的停止和启动可以通过可在项目中确定,将被执行,即当您的设置提交或rollbacked等自定义操作来完成。

If you already use a a VS Setup Project you can deploy the new version of this project and it will upgrade existing installations. Have a look at the setup and upgrade ids. The stop and start of the service can be done by custom actions that can be defined in the project and will be executed i.e. when your setup is committed or rollbacked etc.