3

I know that there are many questions about auto updating, but all of them requires external programs or big works with servers that are not useful for my specific case.

I need to update my WPF application in a custom way: I want to control which users will have to update it and which users will not (I have server, backends, and selecting which users will have an update is not a problem).

The point is that my users might have very different versions and I need to control to which version they will be updated to.

The practical example:

two users have both version 1.0

the last version is 1.5

I want one of them to be updated to version 1.5 and the other one to be updated to 1.3

In the above mentioned example, can I simply download the 1.3 version of the installer for one user, the 1.5 for the other one, close the application and run the downloaded installer as administrator all programmatically?

But most importantly, will this approach work? Running the downloaded installer generated with clickonce (for example) will correctly update the whole application?

This solution looks very simple and quick, and I would know if that could be a possible way to manage my updates.

Notes:

  • This is a B to B application, so I don't actually care about security problems, I just need to have the full control on my updates.
  • I can use FTP, webapi, ... to download the new installer.

Is this tecnically possible?

Thanks

Community
  • 1
  • 1
Pier Giorgio Misley
  • 5,305
  • 4
  • 27
  • 66
  • I think you can use any update framework like [Squirrel](https://github.com/Squirrel/Squirrel.Windows) – styx Jul 04 '19 at 10:31
  • Do you really need any "installer"? You can usually filecopy dll etc so long as the target folder is in appdata. Just copy to a new version folder under the one they run from. Copy into the run folder next run. You'll need a separate loader exe to do the copying stuff. That could be winforms or c++ so it shows a splash screen quicker than wpf would. – Andy Jul 04 '19 at 10:46
  • @Andy yeah I could do that, but if the application is installed on the system, would it work anyway? I will need to run as you said a separate app that copies the files and restart my application. This might work! I will give it a try thanks – Pier Giorgio Misley Jul 04 '19 at 11:15
  • @styx I will have a look at that! thanks – Pier Giorgio Misley Jul 04 '19 at 11:15
  • I was thinking of doing the new-version check on start up. That means you have a point where you check for a new version and you've not got the thing running. You could alternatively use signalr or the like to tell the running app to go get a new version. You'd still need a separate process to switch out of course but that could be a very simple piece of code and splash UI. Filecopy, delete and process.start sounds like maybe 2-3 hours dev time. – Andy Jul 04 '19 at 13:15
  • @Andy yeah it looks really easy and I like that way, I was just curious to know if just subscribing all dlls works, but if you say so I will assume it does! If you post an answer about it I will try to implement that this night or tomorrow night and give you a feedback back. Thanks! – Pier Giorgio Misley Jul 04 '19 at 13:40
  • If you just stick all your dll in the same folder as your exe then it should find them and it'll all work. I have often relied on this, using windows server "push" file copy to "install" my apps. – Andy Jul 04 '19 at 13:46

0 Answers0