Hello,
I have prepared very simple autoupdate concept:
1. Read remote json file, check value of the version key, compare it with FileVersionInfo from exe file
2. If they don't match, download executable and overwrite itself
But dealing with this when script is packaged as exe is major pain: the exe file is blocked from overwrite itself because the process is using it. If I close process, I won't able to execute "copy&overwrite".
If this would be c#, I would use Squierl.Windows or something similar but it's Powershell so I can't. Any way to achieve such simple autoupdate concept?
EXE Form - overwrite itself
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- ALIENQuake
- Posts: 112
- Last visit: Mon Jan 29, 2024 7:35 am
- Has voted: 4 times
Re: EXE Form - overwrite itself
Simple. Download file to new location. Schedule a job to copy the new file over old file and exit. Job can restart the EXE with new file after copy.
Note that PSS uses a separate executable to do this which is also easy. If a new file is detected start the second exe and exit current version. The "installer" EXE will then copy the file and restart it.
Note that PSS uses a separate executable to do this which is also easy. If a new file is detected start the second exe and exit current version. The "installer" EXE will then copy the file and restart it.
- ALIENQuake
- Posts: 112
- Last visit: Mon Jan 29, 2024 7:35 am
- Has voted: 4 times
Re: EXE Form - overwrite itself
Sorry for late reply, great idea. I've created very simple AutoUpdate application for everyone to use. Everything should be easy to figurue out: