Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions src/addons.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Settings]
NumFields=7
NumFields=8

[Field 1]
Type=Label
Expand All @@ -13,15 +13,15 @@ Text=Please select which addons to install. Click Next to continue.
Type=GroupBox
Top=12
Left=0
Right=145
Right=140
Bottom=48
Text=Modifications

[Field 3]
Type=CheckBox
Top=22
Left=10
Right=135
Right=140
Bottom=32
Text=Team Fortress
State=1
Expand All @@ -30,32 +30,42 @@ State=1
Type=CheckBox
Top=32
Left=10
Right=135
Right=140
Bottom=42
Text=Clan Arena
State=1

[Field 5]
Type=GroupBox
Top=12
Left=155
Left=150
Right=300
Bottom=59
Text=Addons
Text=Textures

[Field 6]
Type=CheckBox
Type=RadioButton
Top=22
Left=165
Left=160
Right=290
Bottom=32
Text=High resolution textures
Text=No extra textures
State=0

[Field 7]
Type=Label
Top=36
Left=165
Type=RadioButton
Top=32
Left=160
Right=290
Bottom=42
Text=QRP textures LQ
State=1

[Field 8]
Type=RadioButton
Top=42
Left=160
Right=290
Bottom=54
Text=Replaces the lossy low resolution jpeg textures in nQuake.
Bottom=52
Text=QRP textures HQ
State=0
61 changes: 37 additions & 24 deletions src/nquake-installer_source.nsi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
;nQuake NSIS Online Installer Script
;By Empezar 2007-05-31; Last modified 2016-07-028
;By Empezar 2007-05-31; Last modified 2026-04-025

!define VERSION "2.9"
!define SHORTVERSION "29"
!define VERSION "2.9.1"
!define SHORTVERSION "291"

Name "nQuake"
OutFile "nquake_installer-latest.exe"
Expand Down Expand Up @@ -42,6 +42,7 @@ InstallDirRegKey HKCU "Software\nQuake" "Setup_Dir"
Var ADDON_CLANARENA
Var ADDON_FORTRESS
Var ADDON_TEXTURES
Var ADDON_TEXTURES_HQ
Var ASSOCIATE_FILES
Var CONFIG_NAME
Var CONFIG_INVERT
Expand Down Expand Up @@ -181,7 +182,8 @@ Section "" # Prepare installation
!insertmacro MUI_INSTALLOPTIONS_READ $CONFIG_JUMP "config.ini" "Field 17" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ADDON_FORTRESS "addons.ini" "Field 3" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ADDON_CLANARENA "addons.ini" "Field 4" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ADDON_TEXTURES "addons.ini" "Field 6" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ADDON_TEXTURES "addons.ini" "Field 7" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ADDON_TEXTURES_HQ "addons.ini" "Field 8" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ASSOCIATE_FILES "association.ini" "Field 3" "State"

# Create distfiles folder if it doesn't already exist
Expand All @@ -200,8 +202,6 @@ Section "" # Prepare installation
IntOp $INSTSIZE $INSTSIZE + $0
ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "non-gpl.zip"
IntOp $INSTSIZE $INSTSIZE + $0
ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "textures.zip"
IntOp $INSTSIZE $INSTSIZE + $0
${If} $ADDON_FORTRESS == 1
ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "addon-fortress.zip"
IntOp $INSTSIZE $INSTSIZE + $0
Expand All @@ -210,7 +210,11 @@ Section "" # Prepare installation
ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "addon-clanarena.zip"
IntOp $INSTSIZE $INSTSIZE + $0
${EndIf}
${If} $ADDON_TEXTURES == 1
${If} $ADDON_TEXTURES == 1
ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "textures.zip"
IntOp $INSTSIZE $INSTSIZE + $0
${EndIf}
${If} $ADDON_TEXTURES_HQ == 1
ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "addon-textures.zip"
IntOp $INSTSIZE $INSTSIZE + $0
${EndIf}
Expand Down Expand Up @@ -360,16 +364,6 @@ Section "nQuake" NQUAKE
IntOp $0 $0 / $INSTSIZE
RealProgress::SetProgress /NOUNLOAD $0

# Download and install textures
!insertmacro InstallSection textures.zip "nQuake textures"
# Add to installed size
ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "textures.zip"
IntOp $INSTALLED $INSTALLED + $0
# Set progress bar
IntOp $0 $INSTALLED * 100
IntOp $0 $0 / $INSTSIZE
RealProgress::SetProgress /NOUNLOAD $0

# Download and install Team Fortress if selected
${If} $ADDON_FORTRESS == 1
!insertmacro InstallSection addon-fortress.zip "Team Fortress"
Expand All @@ -394,9 +388,20 @@ Section "nQuake" NQUAKE
RealProgress::SetProgress /NOUNLOAD $0
${EndIf}

# Download and install high resolution textures if selected
# Download and install QRP textures if selected
${If} $ADDON_TEXTURES == 1
!insertmacro InstallSection addon-textures.zip "High resolution textures"
!insertmacro InstallSection textures.zip "QRP textures Low quality"
# Add to installed size
ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "textures.zip"
IntOp $INSTALLED $INSTALLED + $0
# Set progress bar
IntOp $0 $INSTALLED * 100
IntOp $0 $0 / $INSTSIZE
RealProgress::SetProgress /NOUNLOAD $0
${EndIf}
# QRP textures - uncompressed
${If} $ADDON_TEXTURES_HQ == 1
!insertmacro InstallSection addon-textures.zip "QRP textures High quality"
# Add to installed size
ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "addon-textures.zip"
IntOp $INSTALLED $INSTALLED + $0
Expand Down Expand Up @@ -740,9 +745,12 @@ Function ADDONS
!insertmacro DetermineSectionSize addon-clanarena.zip
IntOp $1 $SIZE / 1000
!insertmacro MUI_INSTALLOPTIONS_WRITE "addons.ini" "Field 4" "Text" "Clan Arena ($1 MB)"
!insertmacro DetermineSectionSize textures.zip
IntOp $1 $SIZE / 1000
!insertmacro MUI_INSTALLOPTIONS_WRITE "addons.ini" "Field 7" "Text" "QRP textures, low quality ($1 MB)"
!insertmacro DetermineSectionSize addon-textures.zip
IntOp $1 $SIZE / 1000
!insertmacro MUI_INSTALLOPTIONS_WRITE "addons.ini" "Field 6" "Text" "High resolution textures ($1 MB)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "addons.ini" "Field 8" "Text" "QRP textures, high quality ($1 MB)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "addons.ini"

FunctionEnd
Expand Down Expand Up @@ -839,7 +847,8 @@ FunctionEnd
Function SetSize
!insertmacro MUI_INSTALLOPTIONS_READ $ADDON_FORTRESS "addons.ini" "Field 3" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ADDON_CLANARENA "addons.ini" "Field 4" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ADDON_TEXTURES "addons.ini" "Field 6" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ADDON_TEXTURES "addons.ini" "Field 7" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ADDON_TEXTURES_HQ "addons.ini" "Field 8" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $DISTFILES_PATH "download.ini" "Field 3" "State"
# Only add shareware if pak0.pak doesn't exist
IntOp $1 0 + 0
Expand All @@ -861,8 +870,6 @@ Function SetSize
IntOp $1 $1 + $SIZE
!insertmacro DetermineSectionSize non-gpl.zip
IntOp $1 $1 + $SIZE
!insertmacro DetermineSectionSize textures.zip
IntOp $1 $1 + $SIZE
${If} $ADDON_FORTRESS == 1
!insertmacro DetermineSectionSize addon-fortress.zip
IntOp $1 $1 + $SIZE
Expand All @@ -871,7 +878,13 @@ Function SetSize
!insertmacro DetermineSectionSize addon-clanarena.zip
IntOp $1 $1 + $SIZE
${EndIf}
${If} $ADDON_TEXTURES == 1
# Only pull the selected texture zip.
# addon-textures has the same files as textures, but higher quality.
${If} $ADDON_TEXTURES == 1
!insertmacro DetermineSectionSize textures.zip
IntOp $1 $1 + $SIZE
${EndIf}
${If} $ADDON_TEXTURES_HQ == 1
!insertmacro DetermineSectionSize addon-textures.zip
IntOp $1 $1 + $SIZE
${EndIf}
Expand Down