-
Notifications
You must be signed in to change notification settings - Fork 0
Auto update
flutter_distributor를 써서 만듦
- 디테일한 설정을 위해서는 inno_setup.iss 편집 필요
- inno_setup에서 쓰이는 파라미터 등에 대해 알아두면 좋다.
- 두 버전의 테스트용 앱 제작
- test100.exe (v1.0.0)
- test101.exe (v1.0.1)
-
inno_setup 공식 문서의 기타 참고 사항 항목의 내용
To easily auto update your application, first make your application somehow detect a new version of your Setup.exe and make it locate or download this new version. Then, to auto update, start your Setup.exe from your application with for example the following command line:
/SP- /silent /noicons "/dir=expand:{autopf}\My Program"
After starting setup.exe, exit your application as soon as possible. Note that to avoid problems with updating your .exe, Setup has an auto retry feature. Optionally you could also use the skipifsilent and skipifnotsilent flags and make your application aware of a '/updated' parameter to for example show a nice message box to inform the user that the update has completed.
- 위의 설명에 따라, cmd.exe에서
test101.exe /SP- /SILENT /NOICONS를 실행하면 사용자가 무언가를 선택하지 않아도 설치(업데이트)가 진행된다. 사용자는 설지 진행률 정도만 화면에서 확인할 수 있다.
- 먼저, win+R 단축키를 입력하고 iexpress.exe를 입력해 iexpress wizard를 실행한다.
- 진행단계별 선택한 옵션, 입력값
- Welcome page
- Create new Self Extraction Directive file
- Package purpose
- Extract files and run an installation command
- Package title
- 적당한 타이틀 입력 ('test101')
- Confirmation prompt
- No prompt.
- License agreement
- Do not display a license.
- Packaged files
- Add를 눌러 위에서 제작한 test101.exe 추가
- Install Program to Launch
- Install Program 입력칸
- cmd.exe /c “test101.exe /SP- /SILENT /NOICONS” 입력
- ‘cmd.exe를 열어서 다음 명령어(“...”)를 수행해라(/c)’라는 의미
- Post Install Command 입력칸
- 인 채로 둠
- Install Program 입력칸
- Show window
- Hidden 선택
- 중요하다. ‘Default’ 옵션을 권장하는 모양이지만, Default를 선택하면 test101.exe가 실행되어 업데이트를 수행하는 동안 빈 커맨드 창이 계속해서 떠 있게 된다. Hidden은 커맨드 창을 감추는 옵션이다.
- Hidden 선택
- Finished message
- No message.
- 완료 메시지 따위 필요 없다.
- No message.
- Package Name and Options
- 완성할 파일의 경로와 이름 지정. 'test101_update' 입력했다.
- Configure restart
- No restart
- 설치 이후 PC 재시작 여부 선택
- No restart
- Save Self Extraction Directive
- Self Extraction Directive File을 저장할 것인지 선택하는 단계
- Save Self Extraction Directive (SED) file:
- 자동 입력된 경로와 파일명 그대로 선택.
- Create package
- '다음'을 누르면 위에서 지정한 경로에 파일이 만들어진다.
- 예) 경로\test101_update.exe
- '다음'을 누르면 위에서 지정한 경로에 파일이 만들어진다.
- Welcome page
updat을 통한 업데이트 테스트
-
1.0.0 버전을 설치한 후 실행했다. 현재 앱 버전은 1.0.0이다. 서버가 “최신 버전은 1.0.1이야. (+ 경로 …에 업데이트 파일이 있어)”라고 알려 준다.
install now를 누르면,
커스터마이징한 updat가 1.0.0 버전의 프로그램을 닫고, 아까 만들어서 서버에 올려뒀던 test101_update.exe를 다운로드한 뒤 실행한다.
그러면 test101_update.exe가 명령어
cmd.exe /c “test101.exe /SP- /SILENT /NOICONS”를 수행한다.사용자 계정 컨트롤이 ‘이 앱이 디바이스를 변경하는 것을 허용하겠냐’고 묻는다. 사용자가 ‘예’를 누르면, 바로 업데이트가 진행된다. 위에서 언급한 inno_setup.iss에서, silent 설치인 경우에도 설치가 종료되면 앱을 실행하도록 설정해 뒀기 때문에, 업데이트가 끝나면 자동으로 1.0.1 버전의 앱이 실행된다.