To automatically update my WPF application, I have this strategy:
- (1) process.exe starts
- process.exe is looking for update => there is an update
- process.exe makes a copy of itself => process_copy.exe
- process.exe launches process_copy.exe with update options
- process.exe shuts down
- (2) process_copy.exe starts
- process_copy.exe see "update" parameters, download the update to the process.exe file
- process_copy.exe launch process.exe
- process_copy.exe shuts down
- process.exe launches
Please note that my application uses dll.
this strategy works, except for several times (not every time) when the application starts when it starts at HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run
Sometimes it falls from (2), with
Fix System.IO.FileNotFoundException was unhandled Message = "Failed to load file or assembly" ManagedWinapi, Version = 0.3.0.0, Culture = neutral, PublicKeyToken = null "or one of its dependencies.
I donβt understand why it can fall. If it can start in (1), why can't it (sometimes) start with (2)?
Does anyone have an explanation?
Thank you in advance for your reply.
source share