scriptable-client-installers/T7x/t7x_Installer.nsi

82 lines
2.2 KiB
Plaintext
Raw Normal View History

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"
!define COPYRIGHT "Created by Rim - Open Source"
!define PRODUCT_VERSION "1.0.0.0"
!define SETUP_VERSION "1.0.0.0"
; Attributes
Name "${PRODUCT_NAME}"
OutFile "t7xInstaller.exe"
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
; 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"
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
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"
RMDir /r $LOCALAPPDATA\t7x
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}
FunctionEnd