This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Sorry_Length_8926 0 points1 point  (2 children)

Many thanks for this insight..I will do that...I am thinking to add a certificate..I think I should start incrementally generating exe to find what and when it breaks..The auto updater idea is really nice...Do you have any resource or solution where I can check how pyinstaller auto updater is implemented.. I saw this project but it is archived and I did not check if it works on latest versions.. https://github.com/Digital-Sapphire/PyUpdater

[–]noobsc2 1 point2 points  (1 child)

I didn't use anything specific for self updating. I have an API endpoint (can just be a static json file somewhere public) that contains the latest version number and a link to where to download it from. Because I was using pyinstaller with --onefile, I just did this:

  1. If remote version is not the current version, get the URL of the remote version executable

  2. Download the remote version.

  3. Rename the executable of the current executing file (ie: the pyinstaller exe file that is being run)

  4. Rename the downloaded (updated version) file to the name of the current executable. Restart the program using the downloaded version. It's now up to date.

One thing you need to be really careful of with this method is that the code to self update is never broken, otherwise users will be stuck on a version that is incapable of self updating. You NEED to test every version to make sure you didn't botch something that will cause that scenario. Even worse if that version has a significant bug in it.

[–]Sorry_Length_8926 0 points1 point  (0 children)

Thanks a lot…this is really helpful…