2023-12-15 15:41:40 -05:00
!include "MUI2.nsh"
!include "WinVer.nsh"
!include "nsDialogs.nsh"
; Constants
!define PRODUCT_NAME "t7x"
2023-12-16 17:48:54 -05:00
!define PRODUCT_DESCRIPTION "Call of Duty Black Ops III Client"
2023-12-16 16:48:54 -05:00
!define COPYRIGHT "Created by Ahrimdon - 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-16 18:50:08 -05:00
InstallDir "$EXEDIR"
RequestExecutionLevel user ; Request user-level execution, not admin
2023-12-15 15:41:40 -05:00
; 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"
2023-12-16 15:41:34 -05:00
!define MUI_UNICON "Contrib\Graphics\Icons\icon.ico"
2023-12-15 15:41:40 -05:00
!define MUI_HEADERIMAGE
!define MUI_FINISHPAGE_NOAUTOCLOSE
2023-12-16 17:48:54 -05:00
; !define MUI_FINISHPAGE_RUN "$INSTDIR\t7x.exe"
2023-12-16 21:31:17 -05:00
!define MUI_FINISHPAGE_TEXT "Setup has finished installing ${PRODUCT_NAME} on your computer.$\nClick Finish to close this wizard.$\n$\nRun the t7x.exe application from within your Call of Duty Black Ops 3 game folder or use the Desktop shortcut."
2023-12-16 16:48:54 -05:00
2023-12-15 15:41:40 -05:00
; Modern UI Settings
!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING
2023-12-16 21:31:17 -05:00
!define MUI_FINISHPAGE_SHOWREADME ""
!define MUI_FINISHPAGE_SHOWREADME_CHECKED
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop Shortcut"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION finishpageaction
2023-12-16 16:48:54 -05:00
; Show details by default
ShowInstDetails show
2023-12-17 01:48:05 -05:00
ShowUninstDetails show
2023-12-16 16:48:54 -05:00
2023-12-15 16:48:43 -05:00
; Installer Images
!define MUI_WELCOMEFINISHPAGE_BITMAP "assets\logo-cropped.bmp"
2023-12-17 01:48:05 -05:00
!define MUI_HEADERIMAGE_BITMAP "assets\banner-t7x-title.bmp" ; For installer header
; Uninstaller Images
!define MUI_UNHEADERIMAGE_BITMAP "assets\banner-t7x-title.bmp" ; For uninstaller header
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "assets\logo-cropped.bmp" ; For uninstaller finish page
2023-12-15 16:48:43 -05:00
2023-12-15 15:41:40 -05:00
; Pages
!insertmacro MUI_PAGE_WELCOME
2023-12-16 21:31:17 -05:00
; !insertmacro MUI_PAGE_LICENSE "Readme.txt"
2023-12-15 15:41:40 -05:00
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
; Languages
!insertmacro MUI_LANGUAGE "English"
; Sections
Section "Main Application" SecMain
SetOutPath $INSTDIR
2023-12-16 15:41:34 -05:00
File "game\t7x.exe"
File "game\base_game_dir\README.md"
File "game\base_game_dir\T7x_CP_Server.bat"
File "game\base_game_dir\T7x_MP_Server.bat"
File "game\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
2023-12-16 15:41:34 -05:00
File /r "game\base_game_dir\t7x\*.*"
2023-12-15 16:48:43 -05:00
SectionEnd
Section "Game Directory zone Files" SecZoneData
SetOutPath $INSTDIR\zone
2023-12-16 15:41:34 -05:00
File /r "game\base_game_dir\zone\*.*"
2023-12-15 16:48:43 -05:00
SectionEnd
2023-12-15 15:41:40 -05:00
Section "LocalAppData Files" SecData
SetOutPath $LOCALAPPDATA\t7x
2023-12-16 15:41:34 -05:00
File /r "game\localappdata\t7x\*.*"
2023-12-15 15:41:40 -05:00
SectionEnd
2023-12-17 01:01:37 -05:00
Section "LocalAppData Cache Files" SecCache
SetOutPath $LOCALAPPDATA\cache
File "game\localappdata\cache\cache.bin"
File "game\localappdata\cache\data.bin"
SectionEnd
2023-12-16 21:31:17 -05:00
Function finishpageaction
2023-12-17 01:17:06 -05:00
SetOutPath $INSTDIR
CreateShortcut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\t7x.exe" "" "$INSTDIR\t7x.exe"
2023-12-15 15:41:40 -05:00
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"
2023-12-17 01:01:37 -05:00
Delete $LOCALAPPDATA\cache\cache.bin
Delete $LOCALAPPDATA\cache\data.bin
2023-12-15 16:48:43 -05:00
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
2023-12-16 21:31:17 -05:00
; Function .onInstSuccess
; FunctionEnd