Jump to content

Python download updated code and apply it to itself (zip)

Go to solution Solved by HunterAP,

Most apps that have an automatic updater usually have a separate app built for the updating process. This update app would compare the installed version to the newest one available, and if there was an update it would close out the app in question, download the newest version, overwrite the current files with the newer ones, then restart that app.

If it's in Python, you would write a Python script to be called when the user checks for an update, which would kill the original app and do as I described above.

How can I make a python program download a new version of itself and apply it? I thought about just downloading the zip file and overwriting itself, but this will fail as it's already running the .exe file right?

 

So whats the best way to do this where the user to select "download now" and it overwrites everything with the new code and then etc restarts or something.

Back-end developer, electronics "hacker"

Link to post
Share on other sites

Most apps that have an automatic updater usually have a separate app built for the updating process. This update app would compare the installed version to the newest one available, and if there was an update it would close out the app in question, download the newest version, overwrite the current files with the newer ones, then restart that app.

If it's in Python, you would write a Python script to be called when the user checks for an update, which would kill the original app and do as I described above.

Link to post
Share on other sites

17 hours ago, HunterAP said:

Most apps that have an automatic updater usually have a separate app built for the updating process. This update app would compare the installed version to the newest one available, and if there was an update it would close out the app in question, download the newest version, overwrite the current files with the newer ones, then restart that app.

If it's in Python, you would write a Python script to be called when the user checks for an update, which would kill the original app and do as I described above.

Thanks, I like this approach.

Back-end developer, electronics "hacker"

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×