diff --git a/README.md b/README.md index 4f40634..ca35978 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,19 @@ # NSIS Installer for PolyMC instances -*Warning* +## Prerequisites + +### Warning - Only for PolyMC Minecraft installation! - There are destructive operations into PolyMC data folders! - Overrides instances defined in PolyMC! -*Notice* +### Notice - Using NSIS installer for packaging - Using CMD for batch installation _(trapped into NSIS)_ -*Fonctionnalities* +### Functionnalities - Ask for previous installation _(can be bypassed or uninstalled silently)_ - Create uninstaller @@ -19,6 +21,12 @@ ## Changelog +### 2024-04-15 + +- Moved content to external 7zip file _(with download & extract during install process)_ +- Fixes in registry keys +- Minor fixes in logic + ### 2024-04-14 - Initial release diff --git a/files/PolyMC/instances/common/mods/AmbientSounds_FABRIC_v5.3.5_mc1.20.4.jar b/files/PolyMC/instances/common/mods/AmbientSounds_FABRIC_v5.3.5_mc1.20.4.jar new file mode 100644 index 0000000..f1c82a5 Binary files /dev/null and b/files/PolyMC/instances/common/mods/AmbientSounds_FABRIC_v5.3.5_mc1.20.4.jar differ diff --git a/files/PolyMC/instances/common/mods/BetterF3-9.0.2-Fabric-1.20.4.jar b/files/PolyMC/instances/common/mods/BetterF3-9.0.2-Fabric-1.20.4.jar new file mode 100644 index 0000000..3b3116d Binary files /dev/null and b/files/PolyMC/instances/common/mods/BetterF3-9.0.2-Fabric-1.20.4.jar differ diff --git a/files/PolyMC/instances/common/mods/ChatNotify-Fabric-1.20.4-1.2.0.jar b/files/PolyMC/instances/common/mods/ChatNotify-Fabric-1.20.4-1.2.0.jar new file mode 100644 index 0000000..1e4e748 Binary files /dev/null and b/files/PolyMC/instances/common/mods/ChatNotify-Fabric-1.20.4-1.2.0.jar differ diff --git a/files/PolyMC/instances/common/mods/CreativeCore_FABRIC_v2.11.16_mc1.20.4.jar b/files/PolyMC/instances/common/mods/CreativeCore_FABRIC_v2.11.16_mc1.20.4.jar new file mode 100644 index 0000000..70ea6c1 Binary files /dev/null and b/files/PolyMC/instances/common/mods/CreativeCore_FABRIC_v2.11.16_mc1.20.4.jar differ diff --git a/files/PolyMC/instances/common/mods/DynamicSoundFilters-1.4.0+1.20.4.jar b/files/PolyMC/instances/common/mods/DynamicSoundFilters-1.4.0+1.20.4.jar new file mode 100644 index 0000000..1afb482 Binary files /dev/null and b/files/PolyMC/instances/common/mods/DynamicSoundFilters-1.4.0+1.20.4.jar differ diff --git a/files/PolyMC/instances/common/mods/ExplorersCompass-1.20.4-2.2.3-fabric.jar b/files/PolyMC/instances/common/mods/ExplorersCompass-1.20.4-2.2.3-fabric.jar new file mode 100644 index 0000000..8a27ea1 Binary files /dev/null and b/files/PolyMC/instances/common/mods/ExplorersCompass-1.20.4-2.2.3-fabric.jar differ diff --git a/files/PolyMC/instances/common/mods/ImmediatelyFast-Fabric-1.2.11+1.20.4.jar b/files/PolyMC/instances/common/mods/ImmediatelyFast-Fabric-1.2.11+1.20.4.jar new file mode 100644 index 0000000..5d39a25 Binary files /dev/null and b/files/PolyMC/instances/common/mods/ImmediatelyFast-Fabric-1.2.11+1.20.4.jar differ diff --git a/files/PolyMC/instances/common/mods/Jade-1.20.4-fabric-13.3.1.jar b/files/PolyMC/instances/common/mods/Jade-1.20.4-fabric-13.3.1.jar new file mode 100644 index 0000000..44d404a Binary files /dev/null and b/files/PolyMC/instances/common/mods/Jade-1.20.4-fabric-13.3.1.jar differ diff --git a/files/PolyMC/instances/common/mods/NaturesCompass-1.20.4-2.2.3-fabric.jar b/files/PolyMC/instances/common/mods/NaturesCompass-1.20.4-2.2.3-fabric.jar new file mode 100644 index 0000000..c33d279 Binary files /dev/null and b/files/PolyMC/instances/common/mods/NaturesCompass-1.20.4-2.2.3-fabric.jar differ diff --git a/files/PolyMC/instances/common/mods/PresenceFootsteps-1.11.3.jar b/files/PolyMC/instances/common/mods/PresenceFootsteps-1.11.3.jar new file mode 100644 index 0000000..1c41420 Binary files /dev/null and b/files/PolyMC/instances/common/mods/PresenceFootsteps-1.11.3.jar differ diff --git a/files/PolyMC/instances/common/mods/RailOptimization1.1-1.20.4.jar b/files/PolyMC/instances/common/mods/RailOptimization1.1-1.20.4.jar new file mode 100644 index 0000000..da3b503 Binary files /dev/null and b/files/PolyMC/instances/common/mods/RailOptimization1.1-1.20.4.jar differ diff --git a/files/PolyMC/instances/common/mods/WorldEditCUI-1.20.3+01.jar b/files/PolyMC/instances/common/mods/WorldEditCUI-1.20.3+01.jar new file mode 100644 index 0000000..4a48dc8 Binary files /dev/null and b/files/PolyMC/instances/common/mods/WorldEditCUI-1.20.3+01.jar differ diff --git a/files/PolyMC/instances/common/mods/balm-fabric-1.20.4-9.0.6.jar b/files/PolyMC/instances/common/mods/balm-fabric-1.20.4-9.0.6.jar new file mode 100644 index 0000000..f158c48 Binary files /dev/null and b/files/PolyMC/instances/common/mods/balm-fabric-1.20.4-9.0.6.jar differ diff --git a/files/PolyMC/instances/common/mods/chunkloaders-1.2.8a-fabric-mc1.20.4.jar b/files/PolyMC/instances/common/mods/chunkloaders-1.2.8a-fabric-mc1.20.4.jar new file mode 100644 index 0000000..6ea8e0c Binary files /dev/null and b/files/PolyMC/instances/common/mods/chunkloaders-1.2.8a-fabric-mc1.20.4.jar differ diff --git a/files/PolyMC/instances/common/mods/continuity-3.0.0-beta.4+1.20.2.jar b/files/PolyMC/instances/common/mods/continuity-3.0.0-beta.4+1.20.2.jar new file mode 100644 index 0000000..0015d81 Binary files /dev/null and b/files/PolyMC/instances/common/mods/continuity-3.0.0-beta.4+1.20.2.jar differ diff --git a/files/PolyMC/instances/common/mods/entityculling-fabric-1.6.4-mc1.20.4.jar b/files/PolyMC/instances/common/mods/entityculling-fabric-1.6.4-mc1.20.4.jar new file mode 100644 index 0000000..309544c Binary files /dev/null and b/files/PolyMC/instances/common/mods/entityculling-fabric-1.6.4-mc1.20.4.jar differ diff --git a/files/PolyMC/instances/common/mods/indium-1.0.30+mc1.20.4.jar b/files/PolyMC/instances/common/mods/indium-1.0.30+mc1.20.4.jar new file mode 100644 index 0000000..86082ab Binary files /dev/null and b/files/PolyMC/instances/common/mods/indium-1.0.30+mc1.20.4.jar differ diff --git a/files/PolyMC/instances/common/mods/iris-mc1.20.4-1.6.17.jar b/files/PolyMC/instances/common/mods/iris-mc1.20.4-1.6.17.jar new file mode 100644 index 0000000..a2977ec Binary files /dev/null and b/files/PolyMC/instances/common/mods/iris-mc1.20.4-1.6.17.jar differ diff --git a/files/PolyMC/instances/common/mods/journeymap-1.20.4-5.9.24-fabric.jar b/files/PolyMC/instances/common/mods/journeymap-1.20.4-5.9.24-fabric.jar new file mode 100644 index 0000000..15c2682 Binary files /dev/null and b/files/PolyMC/instances/common/mods/journeymap-1.20.4-5.9.24-fabric.jar differ diff --git a/files/PolyMC/instances/common/mods/lithium-fabric-mc1.20.4-0.12.1.jar b/files/PolyMC/instances/common/mods/lithium-fabric-mc1.20.4-0.12.1.jar new file mode 100644 index 0000000..a0620ee Binary files /dev/null and b/files/PolyMC/instances/common/mods/lithium-fabric-mc1.20.4-0.12.1.jar differ diff --git a/files/PolyMC/instances/common/mods/malilib-fabric-1.20.4-0.18.1.jar b/files/PolyMC/instances/common/mods/malilib-fabric-1.20.4-0.18.1.jar new file mode 100644 index 0000000..6d88a2e Binary files /dev/null and b/files/PolyMC/instances/common/mods/malilib-fabric-1.20.4-0.18.1.jar differ diff --git a/files/PolyMC/instances/common/mods/minihud-fabric-1.20.4-0.30.2.jar b/files/PolyMC/instances/common/mods/minihud-fabric-1.20.4-0.30.2.jar new file mode 100644 index 0000000..4aee373 Binary files /dev/null and b/files/PolyMC/instances/common/mods/minihud-fabric-1.20.4-0.30.2.jar differ diff --git a/files/PolyMC/instances/common/mods/modmenu-9.1.0-beta.1.jar b/files/PolyMC/instances/common/mods/modmenu-9.1.0-beta.1.jar new file mode 100644 index 0000000..b526744 Binary files /dev/null and b/files/PolyMC/instances/common/mods/modmenu-9.1.0-beta.1.jar differ diff --git a/files/PolyMC/instances/common/mods/moreculling-1.20.4-0.22.1.jar b/files/PolyMC/instances/common/mods/moreculling-1.20.4-0.22.1.jar new file mode 100644 index 0000000..a8dd299 Binary files /dev/null and b/files/PolyMC/instances/common/mods/moreculling-1.20.4-0.22.1.jar differ diff --git a/files/PolyMC/instances/common/mods/no-resource-pack-warnings-1.3.0.jar b/files/PolyMC/instances/common/mods/no-resource-pack-warnings-1.3.0.jar new file mode 100644 index 0000000..3c238da Binary files /dev/null and b/files/PolyMC/instances/common/mods/no-resource-pack-warnings-1.3.0.jar differ diff --git a/files/PolyMC/instances/common/mods/no-telemetry-1.8.0.jar b/files/PolyMC/instances/common/mods/no-telemetry-1.8.0.jar new file mode 100644 index 0000000..55b0471 Binary files /dev/null and b/files/PolyMC/instances/common/mods/no-telemetry-1.8.0.jar differ diff --git a/files/PolyMC/instances/common/mods/owo-lib-0.12.6+1.20.3.jar b/files/PolyMC/instances/common/mods/owo-lib-0.12.6+1.20.3.jar new file mode 100644 index 0000000..fc06b1e Binary files /dev/null and b/files/PolyMC/instances/common/mods/owo-lib-0.12.6+1.20.3.jar differ diff --git a/files/PolyMC/instances/common/mods/reeses_sodium_options-1.7.2+mc1.20.4-build.102.jar b/files/PolyMC/instances/common/mods/reeses_sodium_options-1.7.2+mc1.20.4-build.102.jar new file mode 100644 index 0000000..2001f03 Binary files /dev/null and b/files/PolyMC/instances/common/mods/reeses_sodium_options-1.7.2+mc1.20.4-build.102.jar differ diff --git a/files/PolyMC/instances/common/mods/sodium-extra-0.5.4+mc1.20.4-build.116.jar b/files/PolyMC/instances/common/mods/sodium-extra-0.5.4+mc1.20.4-build.116.jar new file mode 100644 index 0000000..2edaebd Binary files /dev/null and b/files/PolyMC/instances/common/mods/sodium-extra-0.5.4+mc1.20.4-build.116.jar differ diff --git a/files/PolyMC/instances/common/mods/sodium-fabric-0.5.8+mc1.20.4.jar b/files/PolyMC/instances/common/mods/sodium-fabric-0.5.8+mc1.20.4.jar new file mode 100644 index 0000000..a9c6987 Binary files /dev/null and b/files/PolyMC/instances/common/mods/sodium-fabric-0.5.8+mc1.20.4.jar differ diff --git a/files/PolyMC/instances/common/mods/sound-physics-remastered-fabric-1.20.4-1.3.1.jar b/files/PolyMC/instances/common/mods/sound-physics-remastered-fabric-1.20.4-1.3.1.jar new file mode 100644 index 0000000..1b4c4bb Binary files /dev/null and b/files/PolyMC/instances/common/mods/sound-physics-remastered-fabric-1.20.4-1.3.1.jar differ diff --git a/files/PolyMC/instances/common/mods/supermartijn642configlib-1.1.8a-fabric-mc1.20.2.jar b/files/PolyMC/instances/common/mods/supermartijn642configlib-1.1.8a-fabric-mc1.20.2.jar new file mode 100644 index 0000000..53af649 Binary files /dev/null and b/files/PolyMC/instances/common/mods/supermartijn642configlib-1.1.8a-fabric-mc1.20.2.jar differ diff --git a/files/PolyMC/instances/common/mods/supermartijn642corelib-1.1.17-fabric-mc1.20.3.jar b/files/PolyMC/instances/common/mods/supermartijn642corelib-1.1.17-fabric-mc1.20.3.jar new file mode 100644 index 0000000..04756d0 Binary files /dev/null and b/files/PolyMC/instances/common/mods/supermartijn642corelib-1.1.17-fabric-mc1.20.3.jar differ diff --git a/files/PolyMC/instances/common/mods/tesseract-1.0.35-fabric-mc1.20.2.jar b/files/PolyMC/instances/common/mods/tesseract-1.0.35-fabric-mc1.20.2.jar new file mode 100644 index 0000000..e9a998f Binary files /dev/null and b/files/PolyMC/instances/common/mods/tesseract-1.0.35-fabric-mc1.20.2.jar differ diff --git a/files/PolyMC/instances/common/mods/tweakeroo-fabric-1.20.4-0.19.2.jar b/files/PolyMC/instances/common/mods/tweakeroo-fabric-1.20.4-0.19.2.jar new file mode 100644 index 0000000..d717d90 Binary files /dev/null and b/files/PolyMC/instances/common/mods/tweakeroo-fabric-1.20.4-0.19.2.jar differ diff --git a/files/PolyMC/instances/common/mods/waystones-fabric-1.20.4-16.0.4.jar b/files/PolyMC/instances/common/mods/waystones-fabric-1.20.4-16.0.4.jar new file mode 100644 index 0000000..30f70fa Binary files /dev/null and b/files/PolyMC/instances/common/mods/waystones-fabric-1.20.4-16.0.4.jar differ diff --git a/files/PolyMC/instances/common/mods/yet-another-config-lib-fabric-3.3.2+1.20.4.jar b/files/PolyMC/instances/common/mods/yet-another-config-lib-fabric-3.3.2+1.20.4.jar new file mode 100644 index 0000000..22870ad Binary files /dev/null and b/files/PolyMC/instances/common/mods/yet-another-config-lib-fabric-3.3.2+1.20.4.jar differ diff --git a/files/PolyMC/instances/common/resourcepacks/XrayUltimate.zip b/files/PolyMC/instances/common/resourcepacks/XrayUltimate.zip new file mode 100644 index 0000000..3d5c9c1 Binary files /dev/null and b/files/PolyMC/instances/common/resourcepacks/XrayUltimate.zip differ diff --git a/files/install.cmd b/files/install.cmd index 4cc632f..81d1262 100644 --- a/files/install.cmd +++ b/files/install.cmd @@ -1,6 +1,6 @@ @echo off SETLOCAL -REM 2024-04-08 +REM 2024-04-15 cls REM Define locale paths diff --git a/mods.nsi b/mods.nsi index f68adf3..a8e123a 100644 --- a/mods.nsi +++ b/mods.nsi @@ -1,4 +1,10 @@ -;2024-04-14 +;2024-04-15 + +;Used NSIS Plug-ins +; https://github.com/negrutiu/nsis-nsxfer +; https://nsis.sourceforge.io/Locate_plugin +; https://nsis.sourceforge.io/Nsis7z_plug-in +; (https://nsis.sourceforge.io/PassDialog_plug-in) ;Define installer compression method and level SetCompressor /SOLID LZMA @@ -6,11 +12,17 @@ SetCompressor /SOLID LZMA ;Activate CRC check CRCCheck on +;Active XP style +XPStyle on + ;-------------------------------------------------------------------------------- ;Constants !define PRODUCT_YEAR "2024" -!define PRODUCT_VERSION "${PRODUCT_YEAR}.04.14.0" +!define PRODUCT_MONTH "04" +!define PRODUCT_DAY "15" +!define PRODUCT_ITERATION "1" +!define PRODUCT_VERSION "${PRODUCT_YEAR}.${PRODUCT_MONTH}.${PRODUCT_DAY}.${PRODUCT_ITERATION}" !define PRODUCT_UUID "1e626553-03f9-47e1-a0cd-858e8effe76e" ;Change for each new product !define PRODUCT_BRAND "Zogg" !define PRODUCT_NAME "Mods" @@ -22,6 +34,9 @@ CRCCheck on !define PRODUCT_TITLE "${PRODUCT_BRAND} ${PRODUCT_NAME}" !define PRODUCT_COMPONENTS "Fabric mods, Ressources Packs & Shaders" +!define PRODUCT_BASEURL "https://dl.zogg.fr/files/minecraft" +!define PRODUCT_CONTENTFILE "mods.7z" + !define PRODUCT_DEST "$LOCALAPPDATA" !define PRODUCT_SMDIR "NSIS:StartMenuDir" @@ -43,7 +58,10 @@ CRCCheck on !include "Library.nsh" !include "x64.nsh" !include "WinVer.nsh" - + !include "Locate.nsh" + !include "LogicLib.nsh" + !include "Sections.nsh" + !include "StrFunc.nsh" ;-------------------------------------------------------------------------------- ;Macros @@ -195,7 +213,7 @@ CRCCheck on ;Translations !insertmacro MUI_LANGUAGE "French" - + !insertmacro MUI_RESERVEFILE_LANGDLL ;-------------------------------------------------------------------------------- ;Version Tab (in the )Properties of the file) @@ -222,18 +240,19 @@ CRCCheck on ;Set output path to the installation directory SetOutPath $INSTDIR - ;Copy a file to the current SetOutPath directory - File /r "files\*.*" + ;process content (download and uncompress) + call proceedContent + ;Execute specific shell script + call runCommandBatch + + ;Make uninstall call addRegistryUninstall WriteUninstaller "${PRODUCT_UNINSTALLER}" ; Add Start Menu entries call addStartMenu - ;Execute specific shell script - call runCommandBatch - SectionEnd ;Uninstall component @@ -341,6 +360,7 @@ FunctionEnd ;Execute specific shell script Function runCommandBatch + DetailPrint "Mise en place..." nsExec::ExecToLog /OEM '"$INSTDIR\install.cmd"' Pop $0 @@ -374,6 +394,13 @@ Function checkForPolyMC Done: FunctionEnd +;Open url on error, then quit application +Function errorOpenUrl + MessageBox MB_OK "Une erreur est survenue !" + call openProductUrl + Quit +FunctionEnd + ;Check for previous installed version Function checkForPrevious @@ -388,3 +415,79 @@ Function checkForPrevious ${EndIf} FunctionEnd + +;Download content to temps +Function downloadContent + + Retry: + NSxfer::Transfer /URL "${PRODUCT_BASEURL}/${PRODUCT_CONTENTFILE}" /LOCAL "$TEMP\${PRODUCT_CONTENTFILE}" /MODE Page /ABORT "Annuler" "Etes-vous sur ?" /END + Pop $0 + ${If} $0 != "OK" + MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_SETFOREGROUND|MB_USERICON "Erreur de telechargement !$\r$\nVoulez-vous recommencer ?" IDYES true IDNO false + true: + goto Retry + false: + goto Exit + ${Else} + goto Done + ${EndIf} + + Exit: + call errorOpenUrl + + Done: +FunctionEnd + +;Uncompress content to $INSTDIR +Function uncompressContent + + locate::_GetSize /NOUNLOAD "$TEMP\${PRODUCT_CONTENTFILE}" "/G=0" + Pop $5 + + Retry: + ClearErrors + SetOutPath $INSTDIR + GetFunctionAddress $R9 extractCallbackTest + Nsis7z::ExtractWithCallback "$TEMP\${PRODUCT_CONTENTFILE}" $R9 + Pop $6 + + ;Check if extracted size <> content file size + ${If} $6 != $5 + MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_SETFOREGROUND|MB_USERICON "Erreur de decompression !$\r$\nVoulez-vous recommencer ?" IDYES true IDNO false + true: + goto Retry + false: + goto Exit + ${Else} + goto Done + ${EndIf} + + Exit: + Delete "$TEMP\${PRODUCT_CONTENTFILE}" + call errorOpenUrl + + Done: + Delete "$TEMP\${PRODUCT_CONTENTFILE}" +FunctionEnd + +;Download content to installation folder +Function proceedContent + + call downloadContent + call uncompressContent + +FunctionEnd + +;Progression callback for extraction +Function extractCallbackTest + + Pop $R8 ;current + Pop $R9 ;total + + Math::Script "R5 = $R8 * 100 / $R9" + + SetDetailsPrint textonly + DetailPrint "Extraction $R5%" + SetDetailsPrint both + +FunctionEnd