From 5e8c9d0c6adad0813a7d688a53e7396cb54c6858 Mon Sep 17 00:00:00 2001 From: hemostick Date: Sun, 26 Apr 2026 17:20:00 +0200 Subject: [PATCH] Make texture packs optional, as in the scripts. - Adds an option for no textures - Makes options radiobuttons - Fixed downloading both packs when addon-textures selected (addon-textures.zip contains the same files as textures.zip, in higher quality. There is no need to download both. The scripts already knew this.) - Bump installer version. This isn't worthy of a 3.0, and not sure whether to 2.9->2.10 or 2.9->2.9.1. So 2.9.1 it is. --- src/addons.ini | 38 ++++++++++++-------- src/nquake-installer_source.nsi | 61 ++++++++++++++++++++------------- 2 files changed, 61 insertions(+), 38 deletions(-) diff --git a/src/addons.ini b/src/addons.ini index c7e26cb..c0d130b 100644 --- a/src/addons.ini +++ b/src/addons.ini @@ -1,5 +1,5 @@ [Settings] -NumFields=7 +NumFields=8 [Field 1] Type=Label @@ -13,7 +13,7 @@ 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 @@ -21,7 +21,7 @@ Text=Modifications Type=CheckBox Top=22 Left=10 -Right=135 +Right=140 Bottom=32 Text=Team Fortress State=1 @@ -30,7 +30,7 @@ State=1 Type=CheckBox Top=32 Left=10 -Right=135 +Right=140 Bottom=42 Text=Clan Arena State=1 @@ -38,24 +38,34 @@ 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. \ No newline at end of file +Bottom=52 +Text=QRP textures HQ +State=0 diff --git a/src/nquake-installer_source.nsi b/src/nquake-installer_source.nsi index 6db6e2d..dd466a1 100644 --- a/src/nquake-installer_source.nsi +++ b/src/nquake-installer_source.nsi @@ -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" @@ -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 @@ -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 @@ -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 @@ -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} @@ -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" @@ -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 @@ -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 @@ -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 @@ -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 @@ -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}