Auto replace of the exe file or the script/myscript.pl from the Server

68 Views Asked by At

So I deploy the PerlPacked exe tool to the users. I would like to run the self auto-replacement of the new Tool from the server after checking if there is new tool available.

1) I know in windows, when a Program is Running, you can rename my.exe => myTemp.exe, download the new mytool.exe from the Server, and in next Run when mytool.exe is running the software update check, remove the myTemp.exe. But renaming pp generated exe during its run is not possible.

2) Alternatively, I thought of replacing the /tmp/par-/cache-/inc/script/mytool.pl from the server, but ironically, this doens't take effect. Even if I remove this file, the exe runs smoothly without generating the new one. I wonder doesn't it require this script file ? from where does the exe run my script ?

Does some has any alternative solution for my requirement ?

1

There are 1 best solutions below

1
On

Split out the updater into a second process. When it's time to update the tool, spawn the updater and exit the tool. That way it's not locked for overwriting.