Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a patch to upgrade .NET application

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

  • Find the installation directory
  • Overwrite the old files with the new ones
  • Restart a windows service

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:

https://stackoverflow.com/questions/3767/what-is-the-best-choice-for-building-windows-installers

How to Update the installed Window Application (Creating Patches)

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 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.

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.

like image 424
Serge Avatar asked Nov 10 '10 15:11

Serge


People also ask

How do I upgrade my .NET framework?

To update the target framework for all projects, right-click on the project (one by one), click properties, and from the “Application” tab change the target framework to the desired one as in the following screenshot and select “Yes” in the popup that is displayed after the framework is changed.

How do I upgrade from .NET 5 to .NET 6?

Migrating from . NET 5. In Visual Studio, simply right click on your project in Solution Explorer and choose Properties. Under Application > General > Target framework, choose . NET 6.0.


1 Answers

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.

like image 158
MatthiasG Avatar answered Sep 20 '22 13:09

MatthiasG