none
Updating and EXE by itself RRS feed

  • Question

  • I set off an update from MyApp.exe in which I copy MyApp.exe from a USB stick over to the working directory that the MyApp.exe is running from.  I was thinking I'd need to do a script that would run when the EXE was NOT running but then I tried the copy file from the VS2017 IDE runtime and it worked......which made me think it must be possible.

    But running the EXE starting it from the directory vs the IDE it bombs "....because it is being used by another process." which is what I suspected.  

    It's running on a Windows 10 box.  I have written a batch script which works but requires the user to get out of full screen mode to access the bat file to execute it.  

    Any suggestions?  

    Tuesday, May 21, 2019 7:59 PM

Answers

  • All you need to do  is start a file copy program, probably async, within the startup of the program needing the update of the exe with terminating the program once the copy program has started. The running of the copy program copies the exe file for update of the exe that needs update and terminates when done.

    There will be 'no file in use' if the startup program that needs its exe replaced with an new version if the program is not running during the file copy process. 

    • Marked as answer by Mimosa Arts Wednesday, May 22, 2019 12:38 PM
    Tuesday, May 21, 2019 10:59 PM

All replies

  • All you need to do  is start a file copy program, probably async, within the startup of the program needing the update of the exe with terminating the program once the copy program has started. The running of the copy program copies the exe file for update of the exe that needs update and terminates when done.

    There will be 'no file in use' if the startup program that needs its exe replaced with an new version if the program is not running during the file copy process. 

    • Marked as answer by Mimosa Arts Wednesday, May 22, 2019 12:38 PM
    Tuesday, May 21, 2019 10:59 PM
  • Thanks,

    I'd done something similar to a WinCE app a long time ago.  

    Harry

    Wednesday, May 22, 2019 12:44 PM