Compare commits
No commits in common. "2f1f0784ad78bf26ce2020034dce8029084fd695" and "dc1c78e4b4e6dc5009b114699e54338ea136984c" have entirely different histories.
2f1f0784ad
...
dc1c78e4b4
14
README.md
14
README.md
@ -1,19 +1,17 @@
|
||||
# NSIS Installer for PolyMC instances
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Warning
|
||||
*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)_
|
||||
|
||||
### Functionnalities
|
||||
*Fonctionnalities*
|
||||
|
||||
- Ask for previous installation _(can be bypassed or uninstalled silently)_
|
||||
- Create uninstaller
|
||||
@ -21,12 +19,6 @@
|
||||
|
||||
## 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
|
||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
SETLOCAL
|
||||
REM 2024-04-15
|
||||
REM 2024-04-08
|
||||
cls
|
||||
|
||||
REM Define locale paths
|
||||
|
121
mods.nsi
121
mods.nsi
@ -1,10 +1,4 @@
|
||||
;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)
|
||||
;2024-04-14
|
||||
|
||||
;Define installer compression method and level
|
||||
SetCompressor /SOLID LZMA
|
||||
@ -12,17 +6,11 @@ SetCompressor /SOLID LZMA
|
||||
;Activate CRC check
|
||||
CRCCheck on
|
||||
|
||||
;Active XP style
|
||||
XPStyle on
|
||||
|
||||
;--------------------------------------------------------------------------------
|
||||
;Constants
|
||||
|
||||
!define PRODUCT_YEAR "2024"
|
||||
!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_VERSION "${PRODUCT_YEAR}.04.14.0"
|
||||
!define PRODUCT_UUID "1e626553-03f9-47e1-a0cd-858e8effe76e" ;Change for each new product
|
||||
!define PRODUCT_BRAND "Zogg"
|
||||
!define PRODUCT_NAME "Mods"
|
||||
@ -34,9 +22,6 @@ XPStyle 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"
|
||||
|
||||
@ -58,10 +43,7 @@ XPStyle on
|
||||
!include "Library.nsh"
|
||||
!include "x64.nsh"
|
||||
!include "WinVer.nsh"
|
||||
!include "Locate.nsh"
|
||||
!include "LogicLib.nsh"
|
||||
!include "Sections.nsh"
|
||||
!include "StrFunc.nsh"
|
||||
|
||||
|
||||
;--------------------------------------------------------------------------------
|
||||
;Macros
|
||||
@ -213,7 +195,7 @@ XPStyle on
|
||||
;Translations
|
||||
|
||||
!insertmacro MUI_LANGUAGE "French"
|
||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||
|
||||
|
||||
;--------------------------------------------------------------------------------
|
||||
;Version Tab (in the )Properties of the file)
|
||||
@ -240,19 +222,18 @@ XPStyle on
|
||||
;Set output path to the installation directory
|
||||
SetOutPath $INSTDIR
|
||||
|
||||
;process content (download and uncompress)
|
||||
call proceedContent
|
||||
;Copy a file to the current SetOutPath directory
|
||||
File /r "files\*.*"
|
||||
|
||||
;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
|
||||
@ -360,7 +341,6 @@ FunctionEnd
|
||||
;Execute specific shell script
|
||||
Function runCommandBatch
|
||||
|
||||
DetailPrint "Mise en place..."
|
||||
nsExec::ExecToLog /OEM '"$INSTDIR\install.cmd"'
|
||||
Pop $0
|
||||
|
||||
@ -394,13 +374,6 @@ 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
|
||||
|
||||
@ -415,79 +388,3 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user