The context is the following: there is a program that need to be updated when necessary by itself. The idea was to rename the current executable, download new one, place it as normally named and delete the renamed afterwards. But all the shortcuts linking to the original program are being automatically modified to follow the new path. Thus making them invalid after update. Is there a way to prevent such behavior? The program is c# .NET Framework executable.
Asked
Active
Viewed 217 times
1 Answers
2
I think the best thing would be to do the update by an other executable in a new process, that is not a child of your process. Just download the update first and have an updater process copy over the new exe from a separate process.
I looked at a discussion for doing this here: link
You would have three components basically:
- A launcher that checks for updates and launches the main executable
- The main application executable you wish to replace
- A separate updater executable to perform the required updates.

Schwarzie2478
- 2,186
- 26
- 30
-
This is almost the way it is now. We wanted to get rid of the launcher. Updating exe file by itself seems better, if not for that shortcut snag. – Timofeus Sep 03 '21 at 09:03