!define SERVICE_TYPE "R_KOREA_SERVICE" !define SERVICE_BINARYNAME "_R_KOREA_SERVICE" !define PRODUCT_NAME "TTFServer - ${SERVICE_TYPE}" !define PRODUCT_VERSION "${__DATE__} ${__TIME__}" !define PRODUCT_PUBLISHER "www.npteam.net, Inc." !define PRODUCT_WEB_SITE "http://www.npteam.net" ; BrandName BrandingText "${PRODUCT_NAME}" ; MUI 1.67 compatible ------ !include "MUI.nsh" ; MUI Settings !define MUI_ABORTWARNING !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico" ; Welcome page !insertmacro MUI_PAGE_WELCOME ; Directory page !insertmacro MUI_PAGE_DIRECTORY ; Instfiles page !insertmacro MUI_PAGE_INSTFILES ; Finish page ;!define MUI_FINISHPAGE_RUN "$INSTDIR\TTFServer${SERVICE_BINARYNAME}.exe" !insertmacro MUI_PAGE_FINISH ; Language files !insertmacro MUI_LANGUAGE "Korean" ; MUI end ------ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" OutFile "Installer\Server-${SERVICE_TYPE}.exe" InstallDir "D:\TTFServer" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails show Function .onInit InitPluginsDir ; TTFServer_Process Find And Kill TTFServer_Process: Processes::FindProcess "TTFServer${SERVICE_BINARYNAME}" ${If} $R0 == "1" MessageBox MB_YESNO|MB_ICONSTOP "TTFServer${SERVICE_BINARYNAME}가 실행중입니다. 종료하시겠습니까?" IDNO Final Processes::KillProcess "TTFServer${SERVICE_BINARYNAME}" ${If} $R0 == "1" Goto TTFServer_Process ${Else} MessageBox MB_OK "TTFServer${SERVICE_BINARYNAME} 종료에 실패하였습니다. 설치를 중단합니다." Abort ${EndIf} ${EndIf} Final: FunctionEnd Section "ServerBin" SEC01 SetOutPath "$INSTDIR" File "bin\TTFServer${SERVICE_BINARYNAME}.exe" File "bin\TTFServer${SERVICE_BINARYNAME}.pdb" RMDir /r "$INSTDIR\Data" SetOutPath "$INSTDIR\Data" File /r "bin\Data\" SectionEnd Section "Delete Extra Folder" SEC02 RMDir /r "$INSTDIR\Data\Extra" CreateDirectory "$INSTDIR\Data\Extra" SectionEnd Section "Firewall Setting" SEC03 ; TTFServer${SERVICE_BINARYNAME}.exe, RemoteIP - any ExecWait 'netsh advfirewall firewall delete rule name="TTFServer${SERVICE_BINARYNAME}.exe"' ExecWait 'netsh advfirewall firewall add rule name="TTFServer${SERVICE_BINARYNAME}.exe" program="$INSTDIR\TTFServer${SERVICE_BINARYNAME}.exe" protocol=TCP remoteip=any dir=in security=notrequired action=allow' SectionEnd Section "VS_RedistributePackage" SEC04 SetOutPath "$INSTDIR" File "D:\VS2008\VS2008SP1_RedistributePackage\vcredist_x86.exe" ExecWait "$INSTDIR\vcredist_x86.exe /q" SectionEnd Section -Post SectionEnd
[NSIS] 서버 프로그램 빌드 스크립트 예제
프로그래밍
2011/03/29 02:13
덧글을 달아 주세요