μ£Όλ‘ μ΄μ©νλ κ²λ€ (NSIS/μμ 1, NSIS/μμ 2, NSIS/μμ 3 μ μμ±ν λ νμν κ² μ λμ μμ€)μμ£Όλ‘ μ 리. μ’ λ μμΈν κ²μ λν΄μλ μλ¬Έμ μ°Έμ‘°.
Contents
- 1. Installer attributes
- 1.1. General
- 1.2. Install Directory
- 1.3. License Page - λΌμ΄μΌμ€ κ΄λ ¨ νμ΄μ§μ μ°μ΄λ μμ±λ€
- 1.4. Component Page - μ€μΉν νλͺ©μ μ ννλ νμ΄μ§μ μ°μ΄λ μμ±λ€
- 1.5. Directory Page - μ€μΉν λλ ν 리λ₯Ό μ ννλ νμ΄μ§μ μ°μ΄λ μμ±λ€
- 1.6. Install Page - μ€μ§μ μΈ Install νλ©΄μ νμνλ νμ΄μ§μ μ°μ΄λ μμ±λ€
- 1.7. Uninstall
- 2. Compiler Flags
- 3. Section
- 4. Function (ν¨μ)
- 5. Labels
- 6. Instructions
- 7. Variables
- 8. Uninstall Section
- 9. Callback functions
- 10. Compiler utility commands
- 11. Compiler defines / conditional compilation
1.1. General ¶
attribute | parameter example | μ€λͺ |
OutFile | "example.exe" | μΈμ€ν¨λ¬μ νμΌ μ΄λ¦ |
Name | "zp_exam_project" | μΈμ€ν¨λ¬ μ΄λ¦ (보ν΅μ μΈμ€ν¨νλ €λ νλ‘κ·Έλ¨μ μ΄λ¦) |
Caption | "zeropage" | μΈμ€ν¨λ¬μ titlebar κ΄λ ¨ caption. defaultλ "Name Setup" |
SubCaption | 0 ": λΌμ΄μΌμ€κΈ°λ‘" | μΈμ€ν¨λ¬ κ° νμ΄μ§ κ΄λ ¨ λΆνμ΄ν |
0 - License Agreement | ||
1 - Installation Options | ||
2 - Installation Directory | ||
3 - Installing Files | ||
4 - Completed | ||
BrandingText | "ZeroPage Installer System v1.0" | μΈμ€ν¨λ¬ νλ¨λΆμ 보μ¬μ§λ ν μ€νΈ |
Icon | "setup.ico" | Installer μ μμ΄μ½. λ°λμ 32*32*16 color μ΄μ¬μΌ νλ€. |
WindowIcon | on | off | Icon μ νμν κ²μΈμ§ λ§κ²μΈμ§ κ²°μ |
BGGradient | 000000 308030 FFFFFF | κ·ΈλΌλ°μ΄μ λ°°κ²½νλ©΄μ μ΄μ©. 16μ§μ RGBκ°μΌλ‘ νν |
κΈ°λ³ΈμΈμλ off | topcolor bottomcolor captiontextcolor | notext | ||
MiscButtonText | "μ΄μ " "λ€μ" "μ·¨μ" "λ«κΈ°" | κ° λ²νΌλ€μ λν text μ€μ (μμλλ‘) |
InstallButtonText | "μ€μΉ | Install λ²νΌμ λν text μ μ€μ |
1.3. License Page - λΌμ΄μΌμ€ κ΄λ ¨ νμ΄μ§μ μ°μ΄λ μμ±λ€ ¶
attribute | parameter example | μ€λͺ |
LicenseText | "μΈμ€ν¨ νκΈ° μ μ΄ λ¬Έκ΅¬λ₯Ό μ½μ΄μ£Όμμμ€" "λμν©λλ€" | license text μμμ ꡬ체μ 문ꡬ |
μΈμλ text buttontext. buttontext κ° μμΌλ©΄ κΈ°λ³Έμ μΌλ‘ "I Agree" | ||
LicenseData | zp_license.txt | ν΄λΉ license 문ꡬ ν μ€νΈκ° λ΄κΈ΄ νμΌ |
1.4. Component Page - μ€μΉν νλͺ©μ μ ννλ νμ΄μ§μ μ°μ΄λ μμ±λ€ ¶
attribute | parameter example | μ€λͺ |
ComponentText | "ν΄λΉ μ»΄ν¬λνΈλ₯Ό 골λΌμ£ΌμΈμ" | κΈ°λ³ΈμΈμλ text subtext1 subtext2 |
component list κ΄λ ¨ νμλ ν μ€νΈ. | ||
InstType | "Full Install" | Install κ΄λ ¨ component type μ λν μ μ. μμλλ‘ 1,2,3,4...8 κΉμ§μ λ²νΈλ€μ΄ 맀겨μ§λ©°, μ΄λ μΆν SectionIn μμ ν΄λΉ component μ λν ν¬ν¨κ΄κ³μμ μ μ©λλ€. |
EnabledBitmap | enabled.bmp | component μ ν κ΄λ ¨ 체ν¬λ νλͺ© bitmap. 20*20*16 color bmp format. |
DisabledBitmap | disabled.bmp | component μ ν κ΄λ ¨ 체ν¬λμ§ μμ νλͺ© bitmap. 20*20*16 color bmp format. |
SpaceTexts | "νμμꡬμ©λ" "μ΄μ©κ°λ₯νμ©λ" | "Space required:", "Space available:" μ λν νν κ΄λ ¨ ν μ€νΈ |
1.5. Directory Page - μ€μΉν λλ ν 리λ₯Ό μ ννλ νμ΄μ§μ μ°μ΄λ μμ±λ€ ¶
attribute | parameter example | μ€λͺ |
DirShow | show | λλ ν 리 μ€μ νλ©΄ νμμ¬λΆ |
DirText | "μ€μΉν λλ ν 리λ₯Ό 골λΌμ£Όμμμ€" "μΈμ€ν¨ν λλ ν 리μ€μ " "ν΄λνμ" | λλ ν 리 μ ν νμ΄μ§μμμ κ°κ° 문ꡬλ€μ μ€μ . |
AllowRootDirInstall | false | 루νΈλλ ν 리μ μ€μΉν μ μλλ‘ νμ©ν κ²μΈμ§μ λν μ¬λΆ |
1.6. Install Page - μ€μ§μ μΈ Install νλ©΄μ νμνλ νμ΄μ§μ μ°μ΄λ μμ±λ€ ¶
attribute | parameter example | μ€λͺ |
InstallColors | FFFF00 000000 | foregroundcolor backgroundcolor. λλ /windows μ΅μ μ μ΄μ©κ°λ₯ |
InstProgressFlags | smooth colored | smooth, colored. colored λ₯Ό μ€μ μλ InstallColors μ μμΌλ‘ μ μ© |
AutoCloseWindow | false | μΈμ€ν¨ μλ£μ μλμΌλ‘ μΈμ€ν¨ μλμ°λ₯Ό λ«μκ²μΈμ§μ λν μ¬λΆ |
ShowInstDetails | show | hide | show | nevershow . install λλ νλ©΄μ 보μ¬μ€ κ²μΈμ§μ λν μ¬λΆ |
DetailsButtonText | "Show Details" | "Show details" λ²νΌμ text μ λν μ€μ |
CompletedText | "μλ£λμμ΅λλ€" | "Completed" 문ꡬ textμ λν μ€μ |
1.7. Uninstall ¶
Uninstall νλ©΄μ λν μ€μ λ€.
attribute | parameter | μ€λͺ |
UninstallText | text subtext | . |
UninstallIcon | path_to_icon.ico | 32*32*16 color icon |
UninstallCaption | caption | . |
UninstallSubCaption | page_number subcaption | 0: Confirmation, 1:Uninstalling Files, 2:Completed |
ShowUninstDetails | hide | show | nevershow | . |
UninstallButtonText | button text | . |
3. Section ¶
Section μ μ€μΉλ₯Ό μν μΌμ’
μ νλμ λͺ¨λ, μ»΄ν¬λνΈμ΄λ€. Section κ³Ό InstType μ λ€λ₯΄λ€.
InstType νλλΉ μ¬λ¬κ°μ Section λ¬ΆμμΌλ‘ λμ΄μλ κ²μ΄λ€. μ¬μ©μλ κ°κ°μ Section μ λν΄ νμ±/λΉνμ±ν ν¨μΌλ‘μ μ€μΉλ λͺ¨λλ€μ κ³ λ₯Ό μ μλ€.
InstType νλλΉ μ¬λ¬κ°μ Section λ¬ΆμμΌλ‘ λμ΄μλ κ²μ΄λ€. μ¬μ©μλ κ°κ°μ Section μ λν΄ νμ±/λΉνμ±ν ν¨μΌλ‘μ μ€μΉλ λͺ¨λλ€μ κ³ λ₯Ό μ μλ€.
λ¨, Uninstall Sectionμ μΈμΈμ€ν¨μ μν νΉμν Sectionμ΄λ€.
attribute | parameter example | μ€λͺ |
Section | "ZPTest Defaults Modules (required)" | Section μ μμμ μλ¦°λ€. Sectionμ μ΄λ¦μ μ€μ . λ§μΌ Sectionμ μ΄λ¦μ΄ λΉμ΄μκ±°λ '-'λ‘ μμλλ κ²½μ°μλ μ¬μ©μκ° μ νν μ μκ³ , λ³Ό μλ μλ€. (μ¦, λ°λμ νμν Sectionμ λν΄). κ·Έλ¦¬κ³ κ°μ₯ μ²μμΌλ‘ μ μΈλλ Sectionμ default Sectionμ΄ λλ©° μμ νμ Sectionμ΄ λλ€. |
SectionIn | 123 or 1-2-3 | μμ μ μ InstType μ ν¬ν¨λλ Typeμ λ²νΈλ₯Ό λ£λλ€. |
SectionEnd | Sectionμ λμ μ리λ attribute | |
SectionDivider | " additional utilities " | κ° Section κ° μ μ·¨μ . μ€κ°μ text λ£κΈ° κ°λ₯ |
AddSize | 1000 | kb λ¨μ. κ° SectionλΉ νμν μ©λμ λν΄ μ μ΄μ€λ€. |
4. Function (ν¨μ) ¶
ν¨μλ Sectionκ³Ό λΉμ·ν μν μ νλ€. νμ§λ§, λ€λ₯Έ μ μ΄λΌλ©΄ ν¨μλ installer μμ μ§μ μ ννμ¬ νΈμΆνλκ²μ΄ μλλΌ, Section μμ Call λͺ
λ Ήμ΄λ₯Ό ν΅ν΄ νΈμΆλμ΄ μΈμ€ν¨λ¬μ κΈ°λ₯μ μΌλΆλ€μ 보좩νλ μν μ νλ€. κ·Έλ¦¬κ³ νΉλ³ν κ²½μ°λ‘μ¨, Callback Functionλ€μ΄ μλ€.
4.1. μ μ μ¬ν ¶
ν¨μλ€μ Section μ΄λ Function μμμ μ μλλ©΄ μλλ€. | ν¨μλ€μ€ '.' μΌλ‘ μμλλ ν¨μλ€μ κΈ°λ³Έμ μΌλ‘ Callback functionμΌλ‘ μμ½λμ΄μλ€. | ν¨μμ€ 'un.' μΌλ‘ μμνλ κ²λ€μ μΌλ°μ μΌλ‘ Uninstallerλ₯Ό μν ν¨μλ€μ΄λ€. Uninstall Sectionμ΄ μ μλμ΄μμ§ μμ κ²½μ°, νΈμΆλμ§ μμ κ²μ΄λ€. | Function | function_name | νλΉ ν¨μμ΄λ¦μΌλ‘ ν¨μ μ μΈ |
FunctionEnd | ν¨μμ λμ μλ¦°λ€. |
5. Labels ¶
Labelμ Goto λͺ
λ Ήμ΄λ κΈ°ν 쑰건μ μ΄λ¬Έλ€ (IfErrors, MessageBox, IfFileExists, StrCmp λ±)μ μν΄ μ΄μ©νλ€.
Label μ λ°λμ Section μ΄λ Function λ΄μ μ‘΄μ¬ν΄μΌ νλ€. Label μ ν΄λΉ Section κ³Ό Function λ΄μμλ§ κ·Έ λ²μλ₯Ό κ°μ§λ€.
Label μ λ°λμ Section μ΄λ Function λ΄μ μ‘΄μ¬ν΄μΌ νλ€. Label μ ν΄λΉ Section κ³Ό Function λ΄μμλ§ κ·Έ λ²μλ₯Ό κ°μ§λ€.
μ μΈμ κ°λ¨νλ€.
~cpp MyLabel:
6.1. Basic ¶
Instruction | parameter | μ€λͺ |
SetOutPath | outpath | output pathλ₯Ό μ€μ νλ€ ($OUTDIR), λ§μΌ ν΄λΉ pathκ° μ‘΄μ¬νμ§ μμΌλ©΄ λ§λ λ€. λ°λμ full-pathname μ΄μ¬μΌ νλ©° μΌλ°μ μΌλ‘ $INSTDIR μ΄ μ΄μ©λλ€. |
File | (/r file|wildcard ...) | /oname=file.data infile.dat | ν΄λΉ output path ($OUTDIR)μ νμΌλ€μ μΆκ°νλ€. μμΌλμΉ΄λ (?, *) λ±μ μ΄μ©ν μ μλ€. λ§μΌ /r μ΅μ μ μ΄μ©ν κ²½μ°, ν΄λΉ νμΌλ€μ λλ ν 리λ€μ΄ μ¬κ·μ μΌλ‘ μΆκ°λλ€. (rm -rfμ 'r' μ΅μ μ μλ―Έλ₯Ό μκ°νκΈΈ) |
Exec | command | νΉμ νλ‘κ·Έλ¨μ μ€ννκ³ κ³μ λ€μμ§νμ νλ€. $OUTDIR μ μμ λλ ν λ¦¬λ‘ μ΄μ©λλ€. ex) Exec '"$INSTDIR\command.exe" parameters' |
ExecWait | command user_var(exit code) | νΉμ νλ‘κ·Έλ¨μ μ€νμν€κ³ , μ’ λ£λ λκΉμ§ κΈ°λ€λ¦°λ€. |
ExecShell | action command parameters SW_SHOWMAXIMIZED | SW_SHOWMINIMIZED | ShellExecuteλ₯Ό μ΄μ©, νλ‘κ·Έλ¨μ μ€νμν¨λ€. actionμ λ³΄ν΅ 'open', 'print' λ±μ λ§νλ€. $OUTDIR μ μμ λλ ν λ¦¬λ‘ μ΄μ©λλ€. |
Rename | /REBOOTOK source_file dest_file | νμΌμ΄λ¦μ λ³κ²½νλ€. (λλ Move νλ€.) |
Delete | /REBOOTOK file | νμΌμ μμ νλ€. μμΌλμΉ΄λ μ¬μ©κ°λ₯. |
RMDir | /r directory | ν΄λΉ λλ ν 리λ₯Ό μ§μ΄λ€. (full-pathμ¬μΌν¨) |
6.2. Registry/INI ¶
WriteRegStr | root_key subkey key_name value | λ μ§μ€νΈλ¦¬μ κΈ°λ‘. rootν€μ κ²½μ° λ€μμ΄ κ°λ₯. HKCR - HKEY_CLASSES_ROOT |
HKLM - HKEY_LOCAL_MACHINE | ||
HKCU - HKEY_CURRENT_USER | ||
HKU - HKEY_USERS | ||
HKCC - HKEY_CURRENT_CONFIG | ||
HKDD - HKEY_DYN_DATA | ||
HKPD - HKEY_PERFORMANCE_DATA | ||
WriteRegExpandStr | . | . |
WriteRegDWORD | . | . |
WriteRegBin | . | . |
WriteINIStr | ini_filename section_name entry_name value | ini νμΌμ κΈ°λ‘. section_name entry_name=value μμΌλ‘ μ μ₯λ¨ |
ReadRegStr | . | . |
ReadRegDWORD | . | . |
ReadINIStr | . | . |
ReadEnvStr | . | . |
ExpandEnvStrings | . | . |
DeleteRegValue | . | . |
DeleteRegKey | /ifempty root_key subkey | λ μ§μ€νΈλ¦¬ ν€ μμ |
EnumRegKey | . | . |
EnumRegValue | . | . |
DeleteINISec | . | . |
DeleteINIStr | . | . |
6.11. Uninstall ¶
- WriteUninstaller - uninstller νμΌμ΄λ¦ μ€μ . λ³΄ν΅ uninstall.exe λΌκ³ μ¨μ£Όλ©΄ λ¨. λ¨, λ μ§μ€νΈλ¦¬μ λ±λ‘μν€λ νμΌκ³Ό κ°μμΌ νλ€.
7.1. modifiable variables that are usable in Instructions ¶
- $INSTDIR - μΈμ€ν¨ λλ ν 리.
- $OUTDIR - νμ¬μ Output directory. SetOutPath λ‘ μ€μ κ°λ₯
- $0 ~ $9, $R0 ~ $R9 - μ¬μ©μ λ³μλ€. λ€λ₯Έ λͺ
λ Ήμ΄λ€μ κ²°κ³Όκ° λ±μ λ°μ λ μ΄μ©ν μ μλ€.
- $CMDLINE
7.2. constant variables that are usable in Instructions and InstallDir ¶
- $PROGRAMFILES - program files λλ ν 리. (λ³΄ν΅ C:\Program Files) μ€νμ νμλλ€.
- $DESKTOP - μλμ° λ°μ€νΈν± λλ ν 리 (λ³΄ν΅ C:\windows\desktop) μ€νμ νμλλ€.
- $EXEDIR - installer κ° μ€νλλ μμΉ
- $WINDIR - windows λλ ν 리 (λ³΄ν΅ C:\windows , C:\winnt) μ€νμ νμλλ€.
- $SYSDIR - windows system λλ ν 리 (λ³΄ν΅ C:\windows\system, C:\winnt\system32) μ€νμ νμλλ€.
- $TEMP - μμ€ν
μμ λλ ν 리 (λ³΄ν΅ C:\windows\temp) μ€νμ νμλ¨.
- $STARTMENU - μμλ©λ΄ folder. (CreateShortCut μ μ΄μ©, μμλ©λ΄μ λ±λ‘μ μ μ©νλ€.)
- $SMPROGRAMS - μμλ©λ΄ programs folder (λ³΄ν΅ $STARTMENU\Programs λμ μ΄μ©)
- $SMSTARTUP - μμλ©λ΄ programs/startup folder. μ¦, 'μμνλ‘κ·Έλ¨'
- $QUICKLAUNCH - IE4 μ΄μ. ν΅λ°μΉ
- $HWNDPARENT - parent windowμ HWND μ λν 10μ§μκ°.
- $$ - '$' ννμ..
8. Uninstall Section ¶
Section μ€ 'Uninstall' μ μ΄λ¦μ κ°μ§ Section μ uninstallerλ₯Ό μν Sectionμ΄λ€. μ΄ Section μμλ νμΌλ€, λ μ§μ€νΈλ¦¬ λ±μ μμ€ν
μΌλ‘λΆν° μ κ±°νλ μΌμ ν΄μΌνλ€.
ex)
ex)
~cpp Section "Uninstall" Delete $INSTDIR\Uninst.exe ; delete self (see explanation below why this works) Delete $INSTDIR\myApp.exe RMDir $INSTDIR DeleteRegKey HKLM SOFTWARE\myApp SectionEnd
uninstaller λ uninstallμ μν΄ μμ€ν
μμλλ ν 리μ μκΈ°μμ μ 볡μ¬νλ―λ‘, Uninstall Section μμλ λ°λμ Uninst.exeλ₯Ό μ§μμ€λ€.
9.1. Install callback ¶
μΈμ€ν¨ κ³Όμ μ€ λ°μνλ μ΄λ²€νΈμ λν callback function.
- .oninit
- .onUserAbout
- .onInstSuccess
- .onInstFailed
- .onVerifyInstDir
- .onNextPage
- .onPrevPage
9.2. Uninstall callback ¶
μΈμΈμ€ν¨ κ³Όμ μ€ λ°μνλ μ΄λ²€νΈμ λν callback function.
- un.onInit
- un.onUserAbout
- un.onUninstSuccess
- un.onUninstFailed
- un.onNextPage