Auto update - waegari/waegari.github.io GitHub Wiki

์ž๋™ ์—…๋ฐ์ดํŠธ ๊ตฌํ˜„์„ ์œ„ํ•œ ์‹คํ—˜

์„ค์น˜ํŒŒ์ผ ๋งŒ๋“ค๊ธฐ

flutter_distributor๋ฅผ ์จ์„œ ๋งŒ๋“ฆ

  • ๋””ํ…Œ์ผํ•œ ์„ค์ •์„ ์œ„ํ•ด์„œ๋Š” inno_setup.iss ํŽธ์ง‘ ํ•„์š”
  • inno_setup์—์„œ ์“ฐ์ด๋Š” ํŒŒ๋ผ๋ฏธํ„ฐ ๋“ฑ์— ๋Œ€ํ•ด ์•Œ์•„๋‘๋ฉด ์ข‹๋‹ค.
  • ๋‘ ๋ฒ„์ „์˜ ํ…Œ์ŠคํŠธ์šฉ ์•ฑ ์ œ์ž‘
    • test100.exe (v1.0.0)
    • test101.exe (v1.0.1)

์กฐ์šฉํ•œ ์„ค์น˜(SILENT)

  • 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๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ์‚ฌ์šฉ์ž๊ฐ€ ๋ฌด์–ธ๊ฐ€๋ฅผ ์„ ํƒํ•˜์ง€ ์•Š์•„๋„ ์„ค์น˜(์—…๋ฐ์ดํŠธ)๊ฐ€ ์ง„ํ–‰๋œ๋‹ค. ์‚ฌ์šฉ์ž๋Š” ์„ค์ง€ ์ง„ํ–‰๋ฅ  ์ •๋„๋งŒ ํ™”๋ฉด์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

iexpress.exe๋ฅผ ํ†ตํ•œ ๋ฌธ์ œ ํ•ด๊ฒฐ

  • ๋จผ์ €, 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 ์ž…๋ ฅ์นธ
        • ์ธ ์ฑ„๋กœ ๋‘ 
    • Show window
      • Hidden ์„ ํƒ
        • ์ค‘์š”ํ•˜๋‹ค. โ€˜Defaultโ€™ ์˜ต์…˜์„ ๊ถŒ์žฅํ•˜๋Š” ๋ชจ์–‘์ด์ง€๋งŒ, Default๋ฅผ ์„ ํƒํ•˜๋ฉด test101.exe๊ฐ€ ์‹คํ–‰๋˜์–ด ์—…๋ฐ์ดํŠธ๋ฅผ ์ˆ˜ํ–‰ํ•˜๋Š” ๋™์•ˆ ๋นˆ ์ปค๋งจ๋“œ ์ฐฝ์ด ๊ณ„์†ํ•ด์„œ ๋–  ์žˆ๊ฒŒ ๋œ๋‹ค. Hidden์€ ์ปค๋งจ๋“œ ์ฐฝ์„ ๊ฐ์ถ”๋Š” ์˜ต์…˜์ด๋‹ค.
    • Finished message
      • No message.
        • ์™„๋ฃŒ ๋ฉ”์‹œ์ง€ ๋”ฐ์œ„ ํ•„์š” ์—†๋‹ค.
    • Package Name and Options
      • ์™„์„ฑํ•  ํŒŒ์ผ์˜ ๊ฒฝ๋กœ์™€ ์ด๋ฆ„ ์ง€์ •. 'test101_update' ์ž…๋ ฅํ–ˆ๋‹ค.
    • Configure restart
      • No restart
        • ์„ค์น˜ ์ดํ›„ PC ์žฌ์‹œ์ž‘ ์—ฌ๋ถ€ ์„ ํƒ
    • Save Self Extraction Directive
      • Self Extraction Directive File์„ ์ €์žฅํ•  ๊ฒƒ์ธ์ง€ ์„ ํƒํ•˜๋Š” ๋‹จ๊ณ„
      • Save Self Extraction Directive (SED) file:
        • ์ž๋™ ์ž…๋ ฅ๋œ ๊ฒฝ๋กœ์™€ ํŒŒ์ผ๋ช… ๊ทธ๋Œ€๋กœ ์„ ํƒ.
    • Create package
      • '๋‹ค์Œ'์„ ๋ˆ„๋ฅด๋ฉด ์œ„์—์„œ ์ง€์ •ํ•œ ๊ฒฝ๋กœ์— ํŒŒ์ผ์ด ๋งŒ๋“ค์–ด์ง„๋‹ค.
        • ์˜ˆ) ๊ฒฝ๋กœ\test101_update.exe

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 ๋ฒ„์ „์˜ ์•ฑ์ด ์‹คํ–‰๋œ๋‹ค.

โš ๏ธ **GitHub.com Fallback** โš ๏ธ