본문 바로가기

개발하자

pyinstaller로 생성된 python 실행 파일 자동 업데이트

반응형

pyinstaller로 생성된 python 실행 파일 자동 업데이트

작업 중인 데스크톱 앱이 있고 배포 해제 파일을 생성하는 데 사용하고 있습니다.

사용하기가 매우 쉽고 윈도우 dll에 신경 쓸 필요가 없기 때문에 선택했지만 사용할 때는 단순히 자동 업데이트를 사용할 수 있지만 사용할 수는 없습니다.

그래서 자동 업데이트 어플리케이션을 어떻게 시작해야 할지 모르겠어요. 누군가 생각이 좀 있거나 내가 어떻게 사용하고 에스케이를 할 수 있는지 아는 사람?




@djvg가 코멘트에서 언급한 바와 같이 가장 최근의(2023년) 접근 방식과 작업 데모는

Pyupdateresky 등은 모두 보관되어 있다.




기본 응용 프로그램에 대한 런처 응용 프로그램을 만들고 거기에 모든 업데이트 로직을 추가할 수 있습니다. 런처 응용 프로그램은 다음을 수행합니다:

팝업을 표시합니다(사용자에게 프로그램이 로드 중이라는 빠른 피드백을 제공합니다)

로컬 및 리포지토리 버전을 확인합니다

로컬 < 원격(v1.0 < v2.0이라고 함)인 경우:

.... 원격 저장소에서 updater_v2.0.exe라는 업데이트 프로그램이 있는지 확인합니다.

........ 다운로드하면 실행하고 종료합니다. (아래 참조)

........ 없는 경우: 최신 주 응용 프로그램 exe를 다운로드하고 로컬 응용 프로그램 exe를 교체합니다(이 단계에서는 파일 액세스 권한에 주의하십시오). c:\program 파일에 기록하려고 합니다.

if local > remote then:

.... Display an error/warning except if this is a developers workstation (you need a setting for this)

Start up the main application.

The purpose of the updater application is to accommodate cases where fetching a fresh main application exe is not enough. I also use it in order to update the launcher application itself (that's why the launcher is exiting as soon as it runs the updater - BTW give windows a bit of time before trying to overwrite the laucher executable)




I ran into the same issue some time ago--so I wrote a small library (updater4pyi) to do exactly that on Mac OS X, Linux and Windows. You can get it from PyPI for example with

> pip install updater4pyi

The source repository is at: https://github.com/phfaist/updater4pyi.

This is a small and not very mature project. It's meant to be as flexible as possible, not relying for example on any specific gui toolkit. I have done some testing on the different platforms, but there may still be bugs. I hope it might be useful to someone else, too.




as of today pyinstaller has only experimental python3 support. If anyone wants to use esky i would recommend using cx freeze. It supports python 2 and 3 and works on linux mac and windows

You are then able to use esky. Esky has the advantage of working with a bootstrap mechanism so that you always have at least one runnable version installed.




There is also PyUpdater. I see it is not cited here


반응형