U E D R , A S I H C RSS

NSIS/예제3



1. 실행화일


만들어진Installer - 실행가능.

2. nsi script


~cpp 

; tetris.nsi

 

; define 상수.. 버전 표시용.

!define VER_MAJOR 1

!define VER_MINOR 0

 

; 해당 인스톨러 이름

Name "Tetris"

 

; 인스톨러 화일 이름

OutFile "tetris.exe"

 

; titlebar caption

Caption "Tetris Install"

 

; Sub Caption

SubCaption 0 ": 라이센스기록"

SubCaption 1 ": 인스톨 옵션"

SubCaption 2 ": 인스톨할 폴더 선택"

SubCaption 3 ": 인스톨중인 화일들"

SubCaption 4 ": 완료되었습니다"

 

; 브랜딩 Text

BrandingText "ZeroPage Install v1.0"

 

; Installer 의 아이콘. 반드시 32 * 32 * 16 color 이여야 한다.

Icon "SETUP.ICO"

 

; 인스톨러 왼쪽 상단에 표시될 인스톨러 아이콘

WindowIcon on

 

; BGGradient

BGGradient 000000 308030 FFFFFF

 

; 버튼들에 대한 text

MiscButtonText "이전" "다음" "취소" "닫기"

 

; Install 버튼에 대한 text

InstallButtonText "설치"

 

; 기본 디렉토리 이름

InstallDir $PROGRAMFILES\zp_tetris

 

; 기본 인스톨 문구

ComponentText "Testing ver ${VER_MAJOR}.${VER_MINOR} 설치 합니다. 해당 컴포넌트를 골라주세요~"

 

; 라이센스 표시 관련

LicenseText "인스톨 하기 전 이 문구를 읽어주십시오" "동의합니다"

LicenseData f:\tetris\zp_license.txt

 

; Install 관련 Type 의 셋팅

InstType "Normal Install"

InstType "Full Install"

;InstType /NOCUSTOM

;InstType /COMPONENTSONLYONCUSTOM

 

AutoCloseWindow false

ShowInstDetails show

ShowUninstDetails show

 

; 디렉토리 선택시

DirText "설치할 디렉토리를 골라주십시오"

DirShow show

 

EnabledBitmap checked.bmp

DisabledBitmap unchecked.bmp

 

SpaceTexts "필요요구용량" "이용가능한용량"

 

SetOverwrite on

SetDateSave on

ShowInstDetails show

 

InstallColors FFFF00 000000

InstProgressFlags smooth colored

 

DetailsButtonText "Show Details"

CompletedText "완료되었습니다"

 

UninstallText "ZPTetris 를 언인스톨 합니다"

UninstallButtonText "언인스톨하기"

 

; Section 의 설정

 

Section "ProgramFiles"

 SectionIn 12

 AddSize 1590

 

 SetOutPath $INSTDIR

 File f:\tetris\execute\tetris.exe

 

 ; Uninstaller 설정 - 이건 기본적으로 nsis 에 포함된 것을 이용.

 WriteUninstaller "uninstall.exe"

 ; 윈도우 프로그램추가/삭제 관리자를 위한 Uninstall 관련 key를 레지스트리에 저장

 WriteRegStr HKLM SOFTWARE\ZPTetris "Install_Dir" "$INSTDIR"

 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ZPTetris" "DisplayName" "ZPTetris (remove only)"

 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ZPTetris" "UninstallString" '"$INSTDIR\uninstall.exe"'

 

SectionEnd

 

SectionDivider " Source Files "

 

Section "SourceFiles"

 SectionIn 2

 AddSize 3760

 

 SetOutPath $INSTDIR\Sources

 File /r f:\tetris\Sources\*.*

 SetOutPath $INSTDIR

SectionEnd

 

SectionDivider " Create StartMenu Shortcuts "

 

Section "Start Menu Shortcuts"

 SectionIn 12

 CreateDirectory "$SMPROGRAMS\ZPTetris"

 CreateShortCut "$SMPROGRAMS\ZPTetris\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0

 CreateShortCut "$SMPROGRAMS\ZPTetris\ZPTetris.lnk" "$INSTDIR\tetris.exe"

SectionEnd

 

Section "Uninstall"

  ; 언인스톨을 위해 써 넣었었던 레지스트리 키 제거

  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ZPTetris"

  DeleteRegKey HKLM SOFTWARE\ZPTetris

  

  ; 반드시! unstaller 도 제거할 것.

  Delete $INSTDIR\uninstall.exe

 

  ; 화일들 제거

  Delete $INSTDIR\tetris.exe

 

  ; shortcut 제거.

  Delete "$SMPROGRAMS\ZPTetris\*.*"

 

  ; 사용했던 디렉토리들 제거.

  RMDir "$SMPROGRAMS\ZPTetris"

  RMDir /r "$INSTDIR"

SectionEnd




3. compile


~cpp 

---------- makensis ----------

MakeNSIS v1.95 - Copyright 1999-2001 Nullsoft, Inc.

 

Portions Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler (zlib).

Contributors: nnop@newmail.ru, Ryan Geiss, Andras Varga, Drew Davidson, Peter Windridge, Dave Laundon, Robert Rainwater, Yaroslav Faybishenko, et al.

 

 

 

Processing config:

 

 

Processing script file: "test1.nsi"

!define: "VER_MAJOR"="1"

!define: "VER_MINOR"="0"

Name: "Tetris"

OutFile: "tetris.exe"

Caption: "Tetris Install"

SubCaption: page:0, text=: 라이센스기록

SubCaption: page:1, text=: 인스톨 옵션

SubCaption: page:2, text=: 인스톨할 폴더 선택

SubCaption: page:3, text=: 인스톨중인 화일들

SubCaption: page:4, text=: 완료되었습니다

BrandingText: "ZeroPage Install v1.0"

Icon: "SETUP.ICO"

WindowIcon: on

BGGradient: 000000->308030 (text=16777215)

MiscButtonText: back="이전" next="다음" cancel="취소" close="닫기"

InstallButtonText: "설치"

InstallDir: "$PROGRAMFILES\zp_tetris"

ComponentText: "Testing ver 1.0 설치 합니다. 해당 컴포넌트를 골라주세요~" "" ""

LicenseText: "인스톨 하기 전 이 문구를 읽어주십시오" "동의합니다"

LicenseData: "f:\tetris\zp_license.txt"

InstType: 1="Normal Install"

InstType: 2="Full Install"

AutoCloseWindow: false

ShowInstDetails: show

ShowUninstDetails: show

DirText: "설치할 디렉토리를 골라주십시오" "" ""

DirShow: show

EnabledBitmap: "checked.bmp"

DisabledBitmap: "unchecked.bmp"

SpaceTexts: required="필요요구용량" available="이용가능한용량"

SetOverwrite: on

SetDateSave: on

ShowInstDetails: show

InstallColors: fg=FFFF00 bg=000000

InstProgressFlags: 3 (smooth=1,colored=1)

DetailsButtonText: "Show Details"

CompletedText: "완료되었습니다"

UninstallText: "ZPTetris 를 언인스톨 합니다" ""

UninstButtonText: "언인스톨하기"

Section: "ProgramFiles"

SectionIn: [0] [1]

AddSize: 9046795 kb

SetOutPath: "$INSTDIR"

File: "Tetris.exe" [compress] 101234/1675339 bytes

WriteUninstaller: "uninstall.exe"

WriteRegStr: HKLM\SOFTWARE\ZPTetris\Install_Dir=$INSTDIR

WriteRegStr: HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\ZPTetris\DisplayName=ZPTetris (remove only)

WriteRegStr: HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\ZPTetris\UninstallString="$INSTDIR\uninstall.exe"

SectionEnd

SectionDivider " Source Files "

Section: "SourceFiles"

SectionIn: [1]

AddSize: 9046795 kb

SetOutPath: "$INSTDIR\Sources"

File: "TetrisWnd.h" [compress] 978/2443 bytes

File: "CH_Global.h" [compress] 357/1272 bytes

File: "CH_Packet.h" [compress] 513/1002 bytes

File: "DataSocket.cpp" [compress] 1010/2426 bytes

File: "DataSocket.h" [compress] 671/1519 bytes

File: "DBLMode.cpp" [compress] 2972/10766 bytes

File: "DBLMode.h" [compress] 866/2037 bytes

File: "EnemyWnd.cpp" [compress] 1207/3263 bytes

File: "EnemyWnd.h" [compress] 685/1514 bytes

File: "GamePanelDlg.cpp" [compress] 2001/6224 bytes

File: "GamePanelDlg.h" [compress] 880/2014 bytes

File: "IPDialog.cpp" [compress] 553/1321 bytes

File: "IPDialog.h" [compress] 594/1223 bytes

File: "ItemList.cpp" [compress] 817/2245 bytes

File: "ItemList.h" [compress] 616/1175 bytes

File: "ListenSocket.cpp" [compress] 435/952 bytes

File: "ListenSocket.h" [compress] 559/1288 bytes

File: "MainFrame.cpp" [compress] 620/1365 bytes

File: "MainFrame.h" [compress] 603/1342 bytes

File: "ReadMe.txt" [compress] 1322/3579 bytes

File: "resource.h" [compress] 490/1457 bytes

File: "StdAfx.cpp" [compress] 136/208 bytes

File: "StdAfx.h" [compress] 548/1128 bytes

File: "Tetris.aps" [compress] 90867/1632388 bytes

File: "Tetris.clw" [compress] 877/3063 bytes

File: "Tetris.cpp" [compress] 831/1862 bytes

File: "Tetris.dsp" [compress] 1325/5803 bytes

File: "Tetris.dsw" [compress] 206/535 bytes

File: "Tetris.h" [compress] 617/1324 bytes

File: "Tetris.ncb" [compress] 139655/549888 bytes

File: "Tetris.opt" [compress] 3776/55808 bytes

File: "Tetris.plg" [compress] 634/1715 bytes

File: "Tetris.rc" [compress] 1974/7113 bytes

File: "TetrisDlg.cpp" [compress] 1617/4110 bytes

File: "TetrisDlg.h" [compress] 666/1342 bytes

File: "TetrisWnd.cpp" [compress] 4463/17499 bytes

File: Descending to: "f:\tetris\Sources\res" -> "$INSTDIR\Sources\res"

File: "Tetris.ico" [compress] 340/1078 bytes

File: "Tetris.rc2" [compress] 171/398 bytes

File: "Tetris_bitmap.bmp" [compress] 1009/2870 bytes

File: "TETRIS_ITEM.BMP" [compress] 3550/6968 bytes

File: "DLGBACKGROUND.bmp" [compress] 6499/264460 bytes

File: "enemy_background.bmp" [compress] 3388/184376 bytes

File: "My_background.bmp" [compress] 4025/184376 bytes

File: "DBLMODEBACK.bmp" [compress] 61447/966056 bytes

File: Returning to: "f:\tetris\Sources" -> "$INSTDIR\Sources"

SetOutPath: "$INSTDIR"

SectionEnd

SectionDivider " Create StartMenu Shortcuts "

Section: "Start Menu Shortcuts"

SectionIn: [0] [1]

CreateDirectory: "$SMPROGRAMS\ZPTetris"

CreateShortCut: "$SMPROGRAMS\ZPTetris\Uninstall.lnk"->"$INSTDIR\uninstall.exe" icon:$INSTDIR\uninstall.exe,0, showmode=0x0, hotkey=0x0

CreateShortCut: "$SMPROGRAMS\ZPTetris\ZPTetris.lnk"->"$INSTDIR\tetris.exe" icon:,0, showmode=0x0, hotkey=0x0

SectionEnd

Section: "Uninstall"

DeleteRegKey: HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\ZPTetris

DeleteRegKey: HKLM\SOFTWARE\ZPTetris

Delete: "$INSTDIR\uninstall.exe"

Delete: "$INSTDIR\tetris.exe"

Delete: "$SMPROGRAMS\ZPTetris\*.*"

RMDir: "$SMPROGRAMS\ZPTetris"

RMDir: /r "$INSTDIR"

SectionEnd

 

Processed 1 file, writing output:

 

Output: "F:\NSIS\tetris.exe"

Install: 5 sections (1 required).

Install: 62 instructions (1488 bytes), 1669 byte string table.

Uninstall: 8 instructions (192 bytes), 328 byte string table.

 

EXE header size: 35328 / 35328 bytes

Install code+strings: 1779 / 3525 bytes

Install data: 448784 / 5620324 bytes

Uninstall code+data+strings: 637 / 1119 bytes

CRC (0x639D4540): 4 / 4 bytes

 

Total size: 486532 / 5660300 bytes (8.6%)

Normal Termination

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:50
Processing time 0.0128 sec