How to add a software update to wpf without clicking once and any other third-party tool?

I have an application created in wpf that needs to be updated when updating. The update is compared to the xml file on the server that contains the software version. I found a link to the SharpUpdater video series to a youtube Sharp Updater link in C # . It works great for a Windows Form application, since I downloaded and tried it in my application, but when it comes to implementing the same logic in a wpf application, this does not happen because the api used in this application has links that only work with winform application. I used another link for automatic updating. Simple automatic update, automatic patch for WPF applications without Updater block , which also does not work for my need. I'm just curious to know how to put our downloaded .exe file into program files if there are so many restrictions. To update the previous .exe, I used the following snippet

private void UpdateApplication(string tempFilePath, string currentPath, string newPath, string launchArgs) { string argument = "/C choice /CY /N /DY /T 4 & Del /F /Q \"{0}\" & choice /CY /N /DY /T 2 & Move /Y \"{1}\" \"{2}\" & Start \"\" /D \"{3}\" \"{4}\" {5}"; ProcessStartInfo Info = new ProcessStartInfo(); Info.Arguments = String.Format(argument, currentPath, tempFilePath, newPath, Path.GetDirectoryName(newPath), Path.GetFileName(newPath), launchArgs); Info.WindowStyle = ProcessWindowStyle.Hidden; Info.CreateNoWindow = true; Info.FileName = "cmd.exe"; Process.Start(Info); } 

But it limits me to put the downloaded file in a folder located in the program files. Thank you for your mercy.

+8
c # wpf
source share
2 answers

I would advise you not to reinvent the wheel and go with an existing, proven solution. While the auto-update client seems simple at first, it can easily become difficult and messy if you don't use different scripts from the start.

ClickOnce

ClickOnce has good built-in support in Visual Studio, .NET, and Windows, but you may also encounter security and deployment issues, especially if you use a self-signed certificate. Although I did not have any serious problems with this, many people feel bad about ClickOnce (but I still don’t know about the list, because what I read is usually not supported by specific technical details).

I would consider that ClickOnce would be acceptable for internal or small projects, but could not be controlled by a wider version, especially for several clients.

Protein

Squirrel is a free, open source installation and upgrade solution.

If you tried the Visual Studio code, you have already experienced what Squirrel installation and update is.

This is a one-click installation that expands to the data folder of the user's local application, so no administrative / UAC permissions are required. You can let it work using its default settings, or use your API for more control over the update process. And if you do not like some of its parts, you can always branch it and change it for your needs.

+1
source share

wyBuild AutomaticUpdater control

The AutomaticUpdater control is part of wyBuild and can be included in your applications for free. It works with Visual Studio 2005, 2008, 2010, 2012 and .NET 2.0, 3.0, 3.5, 4.0, and 4.5. It works with all .NET languages ​​(C #, VB.NET, etc.)

automatic-updates

0
source share

All Articles