출처 : http://blog.empas.com/bwangel/9314543


원문 : http://www.nullsoft.com/free/nsis/makensis.htm

주로 이용하는 것들 (NSIS/예제1, NSIS/예제2, NSIS/예제3 을 작성할 때 필요한 것 정도의 수준)위주로 정리. 좀 더 자세한 것에 대해서는 원문을 참조.
  1. Installer attributes
    1. General
    2. Install Directory
    3. License Page - 라이센스 관련 페이지에 쓰이는 속성들
    4. Component Page - 설치할 항목을 선택하는 페이지에 쓰이는 속성들
    5. Directory Page - 설치할 디렉토리를 선택하는 페이지에 쓰이는 속성들
    6. Install Page - 실질적인 Install 화면을 표시하는 페이지에 쓰이는 속성들
    7. Uninstall
  2. Compiler Flags
  3. Section
  4. Function (함수)
    1. 유의 사항
    2. attribute
  5. Labels
  6. Instructions
    1. Basic
    2. Registry/INI
    3. Advanced
    4. Branching/etc
    5. File/directory i/o
    6. Misc
    7. Strings
    8. Stack
    9. Integers
    10. Reboot
    11. Uninstall
  7. Variables
    1. modifiable variables that are usable in Instructions
    2. constant variables that are usable in Instructions and InstallDir
    3. usable anywhere in a string
  8. Uninstall Section
  9. Callback functions
    1. Install callback
    2. Uninstall callback
  10. Compiler utility commands
  11. Compiler defines / conditional compilation

Installer attributes

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 의 설정

Install Directory

attribute parameter example 설명
InstallDir? $PROGRAMFILESexample 기본 설치 디렉토리
InstallDirRegKey? . .

License Page - 라이센스 관련 페이지에 쓰이는 속성들

attribute parameter example 설명
LicenseText? "인스톨 하기 전 이 문구를 읽어주십시오" "동의합니다" license text 에서의 구체적 문구


인자는 text buttontext. buttontext 가 없으면 기본적으로 "I Agree"
LicenseData? zp_license.txt 해당 license 문구 텍스트가 담긴 화일

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:" 에 대한 표현 관련 텍스트

Directory Page - 설치할 디렉토리를 선택하는 페이지에 쓰이는 속성들

attribute parameter example 설명
DirShow? show 디렉토리 설정 화면 표시여부
DirText? "설치할 디렉토리를 골라주십시오" "인스톨할 디렉토리설정" "폴더탐색" 디렉토리 선택 페이지에서의 각각 문구들의 설정.
AllowRootDirInstall? false 루트디렉토리에 설치할 수 있도록 허용할것인지에 대한 여부

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에 대한 설정

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? .

Compiler Flags

Section

Section 은 설치를 위한 일종의 하나의 모듈, 컴포넌트이다. Section 과 InstType? 은 다르다.
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당 필요한 용량에 대해 적어준다.

Function (함수)

유의 사항

attribute

Function function_name 하당 함수이름으로 함수 선언
FunctionEnd?
함수의 끝을 알린다.

Labels

Label은 Goto 명령어나 기타 조건제어문들 (IfErrors?, MessageBox?, IfFileExists?, StrCmp? 등)을 위해 이용한다.
Label 은 반드시 Section 이나 Function 내에 존재해야 한다. Label 은 해당 Section 과 Function 내에서만 그 범위를 가진다.
선언은 간단하다.
MyLabel: 

Instructions

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 '"$INSTDIRcommand.exe" parameters'
ExecWait? command user_var(exit code)? 특정 프로그램을 실행시키고, 종료될 때까지 기다린다.
ExecShell? action command parameters? SW_SHOWNORMAL | SW_SHOWMAXIMIZED | SW_SHOWMINIMIZED? ShellExecute?를 이용, 프로그램을 실행시킨다. action은 보통 'open', 'print' 등을 말한다. $OUTDIR 은 작업디렉토리로 이용된다.
Rename /REBOOTOK? source_file dest_file 화일이름을 변경한다. (또는 Move 한다.)
Delete /REBOOTOK? file 화일을 삭제한다. 와일드카드 사용가능.
RMDir /r? directory 해당 디렉토리를 지운다. (full-path여야함)

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? . .
WriteReg?DWORD . .
WriteRegBin? . .
WriteINIStr ini_filename section_name entry_name value ini 화일에 기록. section_name? entry_name=value 식으로 저장됨
ReadRegStr? . .
ReadReg?DWORD . .
ReadINIStr . .
ReadEnvStr? . .
ExpandEnvStrings? . .
DeleteRegValue? . .
DeleteRegKey? /ifempty? root_key subkey 레지스트리 키 삭제
EnumRegKey? . .
EnumRegValue? . .
DeleteINISec . .
DeleteINIStr . .

Advanced

CreateDirectory? path_to_create 디렉토리 생성
CopyFiles? . .
SetFileAttributes? . .
CreateShortCut? . .
GetFullPathName? . .
SearchPath? . .
GetTempFileName? . .
CallInst?DLL . .
RegDLL . .
UnReg?DLL . .
GetDllVersion? . .
GetDLLVersionLocal? . .
GetFileTime? . .
GetFileTimeLocal? . .

Branching/etc

Goto . .
Call . .
Return . .
IfErrors? . .
ClearErrors? . .
SetErrors? . .
FindWindow? . .
SendMessage? . .
IsWindow? . .
IfFileExists? . .
MessageBox? . .
StrCmp? . .
IntCmp? . .
IntCmp?U . .
Abort . .
Quit . .
GetFunctionAddress? . .
GetLabelAddress? . .
GetCurrentAddress? . .

File/directory i/o

FindFirst? . .
FindNext? . .
FindClose? . .
FileOpen? . .
FileClose? . .
FileRead? . .
FileWrite? . .
FileReadByte? . .
FileWriteByte? . .
FileSeek? . .

Misc

SetDetailsView? . .
SetDetailsPrint? . .
SetAutoClose? . .
DetailPrint? . .
Sleep . .
BringToFront? . .
HideWindow? . .

Strings

StrCpy? . .
StrLen? . .

Stack

Push . .
Pop . .
Exch . .

Integers

IntOp? . .
IntFmt? . .

Reboot

Reboot . .
IfRebootFlag? . .
SetRebootFlag? . .

Uninstall

  • WriteUninstaller? - uninstller 화일이름 설정. 보통 uninstall.exe 라고 써주면 됨. 단, 레지스트리에 등록시키는 화일과 같아야 한다.

Variables

modifiable variables that are usable in Instructions

constant variables that are usable in Instructions and InstallDir?

  • $PROGRAMFILES - program files 디렉토리. (보통 C:Program Files) 실행시 탐색된다.
  • $DESKTOP - 윈도우 데스트톱 디렉토리 (보통 C:windowsdesktop) 실행시 탐색된다.
  • $EXEDIR - installer 가 실행되는 위치
  • $WINDIR - windows 디렉토리 (보통 C:windows , C:winnt) 실행시 탐색된다.
  • $SYSDIR - windows system 디렉토리 (보통 C:windowssystem, C:winntsystem32) 실행시 탐색된다.
  • $TEMP - 시스템 임시 디렉토리 (보통 C:windowstemp) 실행시 탐색됨.
  • $STARTMENU - 시작메뉴 folder. (CreateShortCut? 을 이용, 시작메뉴에 등록시 유용하다.)
  • $SMPROGRAMS - 시작메뉴 programs folder (보통 $STARTMENUPrograms 대신 이용)
  • $SMSTARTUP - 시작메뉴 programs/startup folder. 즉, '시작프로그램'
  • $QUICKLAUNCH - IE4 이상. 퀵런치
  • $HWNDPARENT - parent window의 HWND 에 대한 10진수값.
  • $$ - '$' 표현시..

usable anywhere in a string

Uninstall Section

        Section "Uninstall" 
Delete $INSTDIRUninst.exe ; delete self (see explanation below why this works)
Delete $INSTDIRmyApp.exe
RMDir $INSTDIR
DeleteRegKey HKLM SOFTWAREmyApp
SectionEnd

Callback functions

Install callback

Uninstall callback

Compiler utility commands

Compiler defines / conditional compilation


Posted by 나비:D
:
BLOG main image
by 나비:D

공지사항

카테고리

분류 전체보기 (278)
Programming? (0)
---------------------------.. (0)
나비의삽질 (5)
Application (177)
SQL (51)
Web (27)
etc. (14)
Omnia (0)
---------------------------.. (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

달력

«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Total :
Today : Yesterday :