1

I'm working on a WPF .Net Core application and right now I'm looking for some solutions to update the app once it's published. My requirements are:

  • not published to store;
  • don't want an auto-update feature;
  • the device should work and update without internet;
  • update should start by picking an update file;
  • update should happen in the background without any UI;
  • the app has to be open at all times, a restart could be added so changes will apply (if requied);

I've looked into ClickOne, MSIX, Squirrel, etc. with no success.

Is there someone experienced and can give me some pointers?

Macaret
  • 797
  • 9
  • 33
  • Does this answer your question? [How to automatically update an application without ClickOnce?](https://stackoverflow.com/questions/12787761/how-to-automatically-update-an-application-without-clickonce) – sommmen Aug 12 '20 at 08:01
  • Dupe: https://stackoverflow.com/questions/12787761/how-to-automatically-update-an-application-without-clickonce – sommmen Aug 12 '20 at 08:01
  • I don't want an Auto-Update feature. My update file has to be picked from the running app, and the update has to work in the background. The update has to work when the device is offline. – Macaret Aug 12 '20 at 08:04
  • Apologies, i either misread or the question was updated – sommmen Aug 12 '20 at 08:12
  • When you say work and update without internet, do you mean you want to update through usb stick? I have been using WiX, it's a bit cumbersome but once you get it to work it has a lot of functionality. – XAMlMAX Aug 12 '20 at 08:31
  • Yes, Update from an USB stick. – Macaret Aug 12 '20 at 09:42

1 Answers1

0

You can run an app from a folder without registering any exe or dll.

A filecopy would work.

If the wan is available you could maybe push install new versions using AD server software such as SMS. Maybe this is a pc in a warehouse or nuclear facility and totally air gapped.

The way I would suggest approaching this is to filecopy the app to the user's appdata. Exe, dll config just file copy it all. Into a v1 folder.

When the user gets a new usb version you filecopy that to a v2 folder.

Restarting the app is then a matter of running the exe from the highest version folder. Which means a small loader app or update the registry with current location so when they start xxx it will work out location from there. Which might not be practical if they can't update the registry.

You can the approach more sophisticated using mef.

Make the entry point mainwindow very simple and that hosts content from dll which are dynamically discovered. They can be discovered from the highest version folder. Resource dictionaries can be loaded from there and either delivered uncompiled as raw xaml files or in a usercontrol library.

Hence your main functionality would move into say a usercontrol library. The actual exe would have very little in it.

You might want to consider full on PRISM here which allows you to dynamically load the shell and everything. If you've not done this before it's perhaps worth mentioning there'd be a faire amount of PRISM knowledge required to get that working.

Andy
  • 11,864
  • 2
  • 17
  • 20