I have created a python gui application that runs different processes and I am adding new features and bug fixes constantly. Multiple people use it and they are not very tech oriented so instead of having them manually download the new version and delete the old version I'd like to have the program prompt the user when it is launched that there is a new version available and if they would like to update it. The method I use to update my repo is I make my edits then freeze the program into an EXE file and push it along with the new source code to my repo (note I also include a "version.txt" file that has the version number in it). How do I make my program detect the change and overwrite the current program installed on their computer? Are there better practices for the method I use to upload my executable? For further context this is on a github enterprise repo so I am using an API github token for authentication.
I have tried a few different methods including making url calls with urllib and requests for example:
req = requests.get(url, headers=headers)
open("program.exe", "wb").write(req.content)
subprocess.run(["program.exe"])
using the url "https://github.build.company/user/repo/releases/download/tag/program.exe" but this just returns the html for authentication from my company
and when I try the url for download where the frozen file is stored in the project files "https://github.build.company/user/repo/raw/main/dist/program.exe" I get error [WinError 193] %1 is not a valid Win32 application
My problem was I was trying to download from the URL I mentioned but to get the desired response I had to add "raw" to the beginning of the url. For example: "https://raw.github.build.company.com..." Additionally I ran into another problem when I figured out that the exe file was being managed by lfs on my github repo. When making an api request for a file managed by lfs it returns a few details including the file size and sha256 not the desired file's contents. To resolve this I followed this guide https://gist.github.com/fkraeutli/66fa741d9a8c2a6a238a01d17ed0edc5.