PageCallbacks 라는 기능을 알아 보도록 하겠다.
PageCallbacks는 PageEx ~ PageExEnd 사이에서만 쓸 수 있는 기능으로 문법은 다음과 같다.
-
([creator_function] [leave_function]) | ([pre_function] [show_function] [leave_function])
위에 보는 것과 같이 두 개의 함수 이름을 쓰면 creator와 leave 함수를 사용하겠다는 것이고, 세 개의 함수 이름을 쓰면 Page에 들어 가기 전에 실행되고 실제 보여 주는 함수 그리고 페이지를 벗어날 때 함수 이다. 말로 하면 좀 어려우니 예제를 보면서 한 번 해보자.
-
# set the name of the installer
-
outfile "pages.exe"
-
-
Var ANOTHER_DIR
-
-
InstallDir "$PROGRAMFILES\testing"
-
-
LicenseText "라이센스 동의해 주세요~~~ " "동의"
-
# set license data file
-
LicenseData ".\license.txt"
-
LicenseForceSelection checkbox "위 라이센스에 동의 합니다."
-
-
ComponentText "필요한 컴포넌트를 인스톨 합니다." \
-
"내부적인 소제목입니다." "인스톨 하는 설명을 자세하게 여기에 씁니다."
-
DirText "인스톨 할 디렉토리 선택 창입니다." "본 프로그램을 인스톨 할 디렉토리를 선택해 주십시오." \
-
"클릭해줘!" "디렉토리 선택하는 다이얼로그 설명입니다."
-
PageEx License
-
PageCallbacks li_cre li_leave
-
PageExEnd
-
Page Components
-
PageEx directory
-
DirVar $ANOTHER_DIR
-
PageExEnd
-
PageEx instfiles
-
DetailsButtonText "자세히 보여줘~~"
-
CompletedText "끝났당~~"
-
PageExEnd
-
function .onInit
-
StrCpy $ANOTHER_DIR "$WINDIR"
-
functionEnd
-
-
function li_cre
-
MessageBox MB_OK "License creator pagecallbacks"
-
functionEnd
-
-
function li_leave
-
MessageBox MB_OK "License leave pagecallbacks"
-
functionEnd
-
# create a default section.
-
section
-
-
MessageBox MB_OK "$INSTDIR, $ANOTHER_DIR"
-
-
sectionEnd
-
-
section "Component1"
-
MessageBox MB_OK "You select component1"
-
SectionEnd
-
-
Section "Component2"
-
MessageBox MB_OK "You select component2"
-
SectionEnd
위 코드는 앞에 적은 글에서 몇 가지 부분만 수정된 것이다. 첫 번째로 17번째 줄인 PageEx License 아래에 PageCallbacks를 적었다. 함수를 두 개만 적었으니 실행되는 것을 알 수 있다. 위 코드를 실행 시키면 생각과 다르게 li_leave 함수가 실제로 라이센스를 보여 주는 화면 보다 먼저 나온다. 즉 아래와 같은 화면들이 나오고 나서 라이센스를 보는 화면이 나온다.
![]() |
![]() |
-
# set the name of the installer
-
outfile "pages.exe"
-
-
Var ANOTHER_DIR
-
-
InstallDir "$PROGRAMFILES\testing"
-
-
LicenseText "라이센스 동의해 주세요~~~ " "동의"
-
# set license data file
-
LicenseData ".\license.txt"
-
LicenseForceSelection checkbox "위 라이센스에 동의 합니다."
-
-
ComponentText "필요한 컴포넌트를 인스톨 합니다." \
-
"내부적인 소제목입니다." "인스톨 하는 설명을 자세하게 여기에 씁니다."
-
DirText "인스톨 할 디렉토리 선택 창입니다." "본 프로그램을 인스톨 할 디렉토리를 선택해 주십시오." \
-
"클릭해줘!" "디렉토리 선택하는 다이얼로그 설명입니다."
-
PageEx License
-
PageCallbacks li_cre li_show li_leave
-
PageExEnd
-
Page Components
-
PageEx directory
-
DirVar $ANOTHER_DIR
-
PageExEnd
-
PageEx instfiles
-
DetailsButtonText "자세히 보여줘~~"
-
CompletedText "끝났당~~"
-
PageExEnd
-
function .onInit
-
StrCpy $ANOTHER_DIR "$WINDIR"
-
functionEnd
-
-
function li_cre
-
MessageBox MB_OK "License creator pagecallbacks"
-
functionEnd
-
-
function li_show
-
MessageBox MB_OK "License show pagecallbacks"
-
functionEnd
-
-
function li_leave
-
MessageBox MB_OK "License leave pagecallbacks"
-
functionEnd
-
# create a default section.
-
section
-
-
MessageBox MB_OK "$INSTDIR, $ANOTHER_DIR"
-
-
sectionEnd
-
-
section "Component1"
-
MessageBox MB_OK "You select component1"
-
SectionEnd
-
-
Section "Component2"
-
MessageBox MB_OK "You select component2"
-
SectionEnd