2023-12-15 15:41:40 -05:00
|
|
|
!include "MUI2.nsh"
|
|
|
|
!include "WinVer.nsh"
|
|
|
|
!include "nsDialogs.nsh"
|
|
|
|
|
|
|
|
; Constants
|
|
|
|
!define PRODUCT_NAME "t7x"
|
|
|
|
!define PRODUCT_DESCRIPTION "Call of Duty: Black Ops III Client"
|
2023-12-15 16:48:43 -05:00
|
|
|
!define COPYRIGHT "Created by Rim - This product is free and open source"
|
2023-12-15 15:41:40 -05:00
|
|
|
!define PRODUCT_VERSION "1.0.0.0"
|
|
|
|
!define SETUP_VERSION "1.0.0.0"
|
|
|
|
|
|
|
|
; Attributes
|
|
|
|
Name "${PRODUCT_NAME}"
|
2023-12-15 16:09:19 -05:00
|
|
|
OutFile "build\t7xInstaller.exe"
|
2023-12-15 15:41:40 -05:00
|
|
|
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
|
|
|
|
RequestExecutionLevel user ; Request user-level execution, not admin
|
|
|
|
|
|
|
|
; Version Info
|
|
|
|
VIProductVersion "${PRODUCT_VERSION}"
|
|
|
|
VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
|
|
|
|
VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
|
|
|
|
VIAddVersionKey "FileDescription" "${PRODUCT_DESCRIPTION}"
|
|
|
|
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
|
|
|
|
VIAddVersionKey "FileVersion" "${SETUP_VERSION}"
|
|
|
|
|
|
|
|
; Modern UI Appearance
|
|
|
|
!define MUI_ICON "Contrib\Graphics\Icons\icon.ico"
|
|
|
|
!define MUI_HEADERIMAGE
|
|
|
|
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
|
|
|
!define MUI_FINISHPAGE_RUN "$INSTDIR\t7x.exe"
|
|
|
|
!define MUI_FINISHPAGE_TEXT "Setup has finished installing ${PRODUCT_NAME} on your computer.$\n$\nClick Finish to close this wizard."
|
|
|
|
|
|
|
|
; Modern UI Settings
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
!define MUI_UNABORTWARNING
|
|
|
|
|
2023-12-15 16:48:43 -05:00
|
|
|
; Installer Images
|
|
|
|
!define MUI_WELCOMEFINISHPAGE_BITMAP "assets\logo-cropped.bmp"
|
|
|
|
!define MUI_HEADERIMAGE_BITMAP "assets\banner-t7x-title.bmp"
|
|
|
|
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "assets\logo-cropped.bmp" ; For uninstaller
|
|
|
|
|
2023-12-15 15:41:40 -05:00
|
|
|
; Pages
|
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
|
|
|
;!insertmacro MUI_PAGE_LICENSE "Readme.txt"
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
|
|
|
|
; Languages
|
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
|
|
|
|
; Sections
|
|
|
|
Section "Main Application" SecMain
|
|
|
|
SetOutPath $INSTDIR
|
|
|
|
File "t7x.exe"
|
2023-12-15 16:48:43 -05:00
|
|
|
File "base_game_dir\README.md"
|
|
|
|
File "base_game_dir\T7x_CP_Server.bat"
|
|
|
|
File "base_game_dir\T7x_MP_Server.bat"
|
|
|
|
File "base_game_dir\T7x_ZM_Server.bat"
|
2023-12-15 15:41:40 -05:00
|
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
|
|
SectionEnd
|
|
|
|
|
2023-12-15 16:48:43 -05:00
|
|
|
Section "Game Directory t7x Files" SecT7xData
|
|
|
|
SetOutPath $INSTDIR\t7x
|
|
|
|
File /r "base_game_dir\t7x\*.*"
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section "Game Directory zone Files" SecZoneData
|
|
|
|
SetOutPath $INSTDIR\zone
|
|
|
|
File /r "base_game_dir\zone\*.*"
|
|
|
|
SectionEnd
|
|
|
|
|
2023-12-15 15:41:40 -05:00
|
|
|
Section "LocalAppData Files" SecData
|
|
|
|
SetOutPath $LOCALAPPDATA\t7x
|
|
|
|
File /r "t7x\*.*"
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Var Checkbox
|
|
|
|
|
|
|
|
Function .onInit
|
|
|
|
; Initialize the checkbox value
|
|
|
|
StrCpy $Checkbox 1
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
; Uninstaller Sections
|
|
|
|
Section "Uninstall"
|
|
|
|
Delete $INSTDIR\t7x.exe
|
|
|
|
Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
|
2023-12-15 16:48:43 -05:00
|
|
|
Delete "$INSTDIR\README.md"
|
|
|
|
Delete "$INSTDIR\T7x_CP_Server.bat"
|
|
|
|
Delete "$INSTDIR\T7x_MP_Server.bat"
|
|
|
|
Delete "$INSTDIR\T7x_ZM_Server.bat"
|
|
|
|
|
|
|
|
Delete "$INSTDIR\zone\server.cfg"
|
|
|
|
Delete "$INSTDIR\zone\server_cp.cfg"
|
|
|
|
Delete "$INSTDIR\zone\server_zm.cfg"
|
|
|
|
|
|
|
|
RMDir /r $INSTDIR\t7x
|
2023-12-15 15:41:40 -05:00
|
|
|
RMDir /r $LOCALAPPDATA\t7x
|
2023-12-15 16:48:43 -05:00
|
|
|
|
2023-12-15 15:41:40 -05:00
|
|
|
Delete "$INSTDIR\Uninstall.exe"
|
|
|
|
RMDir $INSTDIR
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
; Create the desktop shortcut based on the checkbox state
|
|
|
|
Function .onInstSuccess
|
|
|
|
${If} $Checkbox == 1
|
|
|
|
SetOutPath "$INSTDIR"
|
|
|
|
CreateShortcut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\t7x.exe" "" "$INSTDIR"
|
|
|
|
${EndIf}
|
2023-12-15 16:48:43 -05:00
|
|
|
FunctionEnd
|