Update installer to reboot
This commit is contained in:
parent
e1d69cbc15
commit
6afe204089
@ -5,15 +5,16 @@
|
|||||||
!define MUI_ICON "kogusico.ico"
|
!define MUI_ICON "kogusico.ico"
|
||||||
!define MUI_UNICON "kogusico.ico"
|
!define MUI_UNICON "kogusico.ico"
|
||||||
!define MUI_UNINST_ICON "kogusico.ico"
|
!define MUI_UNINST_ICON "kogusico.ico"
|
||||||
!define MUI_UNINSTALLER ; active l’uninstaller
|
!define MUI_UNINSTALLER
|
||||||
!include "MUI2.nsh"
|
!include "MUI2.nsh"
|
||||||
|
!include "LogicLib.nsh"
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
; Métadonnées produit
|
; Métadonnées produit
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
!define PRODUCT_NAME "Kogus"
|
!define PRODUCT_NAME "Kogus"
|
||||||
!define PRODUCT_VERSION "1.0.0"
|
!define PRODUCT_VERSION "1.0.0"
|
||||||
!define INSTALL_DIR "$PROGRAMFILES\\${PRODUCT_NAME}"
|
!define INSTALL_DIR "$PROGRAMFILES\${PRODUCT_NAME}"
|
||||||
|
|
||||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||||
!define MUI_PRODUCT "${PRODUCT_NAME}"
|
!define MUI_PRODUCT "${PRODUCT_NAME}"
|
||||||
@ -37,6 +38,8 @@ InstallDir "${INSTALL_DIR}"
|
|||||||
RequestExecutionLevel admin
|
RequestExecutionLevel admin
|
||||||
ShowInstDetails show
|
ShowInstDetails show
|
||||||
|
|
||||||
|
Var ExecCode
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
; Section : Installation
|
; Section : Installation
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
@ -52,46 +55,53 @@ Section "Install"
|
|||||||
File "run.ps1"
|
File "run.ps1"
|
||||||
|
|
||||||
; 3. Copier relay
|
; 3. Copier relay
|
||||||
CreateDirectory "$INSTDIR\\relay"
|
CreateDirectory "$INSTDIR\relay"
|
||||||
SetOutPath "$INSTDIR\\relay"
|
SetOutPath "$INSTDIR\relay"
|
||||||
File /r "relay\\*.*"
|
File /r "relay\*.*"
|
||||||
|
|
||||||
; 4. Copier bitcoin
|
; 4. Copier bitcoin
|
||||||
CreateDirectory "$INSTDIR\\bitcoin"
|
CreateDirectory "$INSTDIR\bitcoin"
|
||||||
SetOutPath "$INSTDIR\\bitcoin"
|
SetOutPath "$INSTDIR\bitcoin"
|
||||||
File /r "bitcoin\\*.*"
|
File /r "bitcoin\*.*"
|
||||||
|
|
||||||
; 5. Copier blindbit
|
; 5. Copier blindbit
|
||||||
CreateDirectory "$INSTDIR\\blindbit"
|
CreateDirectory "$INSTDIR\blindbit"
|
||||||
SetOutPath "$INSTDIR\\blindbit"
|
SetOutPath "$INSTDIR\blindbit"
|
||||||
File /r "blindbit\\*.*"
|
File /r "blindbit\*.*"
|
||||||
|
|
||||||
; 6. Créer dossier de logs
|
; 6. Créer dossier de logs
|
||||||
CreateDirectory "$INSTDIR\\logs"
|
CreateDirectory "$INSTDIR\logs"
|
||||||
|
|
||||||
; 7. Raccourci Menu Démarrer pour lancer run.ps1
|
; 7. Raccourci Menu Démarrer pour lancer run.ps1
|
||||||
CreateDirectory "$SMPROGRAMS\\${PRODUCT_NAME}"
|
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
|
||||||
CreateShortCut "$SMPROGRAMS\\${PRODUCT_NAME}\\Lancer Kogus.lnk" \
|
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Lancer Kogus.lnk" \
|
||||||
"$INSTDIR\\run.ps1" "" \
|
"$INSTDIR\run.ps1" "" \
|
||||||
"$INSTDIR\\kogusico.ico" 0
|
"$INSTDIR\kogusico.ico" 0
|
||||||
|
|
||||||
; 8. Lancement initial (install Docker si besoin)
|
; 8. Lancement initial (installe/configure Docker si besoin) + capture code retour
|
||||||
ExecWait '"$SYSDIR\\WindowsPowerShell\\v1.0\\powershell.exe" -WindowStyle Hidden -NoProfile -ExecutionPolicy Bypass -File "$INSTDIR\\run.ps1" > "$INSTDIR\\logs\\install.log" 2>&1'
|
ExecWait '"$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" -WindowStyle Hidden -NoProfile -ExecutionPolicy Bypass -File "$INSTDIR\run.ps1"' $ExecCode
|
||||||
|
|
||||||
|
; 8bis. Si le script signale 3010 => reboot requis (WSL2/VM Platform, etc.)
|
||||||
|
${If} $ExecCode = 3010
|
||||||
|
MessageBox MB_ICONQUESTION|MB_YESNO "Un redémarrage est requis pour terminer l'installation de Kogus. Redémarrer maintenant ?" IDYES +2 IDNO +4
|
||||||
|
SetRebootFlag true
|
||||||
|
Reboot
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
; 9. Auto-démarrage Docker Desktop au login utilisateur
|
; 9. Auto-démarrage Docker Desktop au login utilisateur
|
||||||
WriteRegStr HKCU "Software\\Microsoft\\Windows\\CurrentVersion\\Run" \
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" \
|
||||||
"DockerDesktop" \
|
"DockerDesktop" \
|
||||||
'"$PROGRAMFILES\\Docker\\Docker\\Docker Desktop.exe" --autostart'
|
'"$PROGRAMFILES\Docker\Docker\Docker Desktop.exe" --autostart'
|
||||||
|
|
||||||
; 10. Raccourci dans le dossier Démarrage pour relancer la stack Kogus
|
; 10. Raccourci dans le dossier Démarrage pour relancer la stack Kogus
|
||||||
CreateDirectory "$SMSTARTUP"
|
CreateDirectory "$SMSTARTUP"
|
||||||
CreateShortCut "$SMSTARTUP\\Relancer Kogus Stack.lnk" \
|
CreateShortCut "$SMSTARTUP\Relancer Kogus Stack.lnk" \
|
||||||
"$SYSDIR\\WindowsPowerShell\\v1.0\\powershell.exe" \
|
"$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" \
|
||||||
'-NoProfile -ExecutionPolicy Bypass -File "$INSTDIR\\run.ps1"' \
|
'-NoProfile -ExecutionPolicy Bypass -File "$INSTDIR\run.ps1"' \
|
||||||
"$INSTDIR\\kogusico.ico" 0
|
"$INSTDIR\kogusico.ico" 0
|
||||||
|
|
||||||
; 11. Générer l’uninstaller
|
; 11. Générer l’uninstaller
|
||||||
WriteUninstaller "$INSTDIR\\Uninstall.exe"
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
@ -101,17 +111,17 @@ SectionEnd
|
|||||||
Section "Uninstall"
|
Section "Uninstall"
|
||||||
|
|
||||||
; Arrêter la stack Docker
|
; Arrêter la stack Docker
|
||||||
nsExec::ExecToLog '"$SYSDIR\\WindowsPowerShell\\v1.0\\powershell.exe" -NoProfile -Command "docker compose -f `"$INSTDIR\\docker-compose.yml`" down"'
|
nsExec::ExecToLog '"$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -Command "docker compose -f `"$INSTDIR\docker-compose.yml`" down"'
|
||||||
|
|
||||||
; Supprimer tous les fichiers et dossiers
|
; Supprimer tous les fichiers et dossiers
|
||||||
RMDir /r "$INSTDIR"
|
RMDir /r "$INSTDIR"
|
||||||
|
|
||||||
; Supprimer le raccourci Menu Démarrer
|
; Supprimer le raccourci Menu Démarrer
|
||||||
Delete "$SMPROGRAMS\\${PRODUCT_NAME}\\Lancer Kogus.lnk"
|
Delete "$SMPROGRAMS\${PRODUCT_NAME}\Lancer Kogus.lnk"
|
||||||
RMDir "$SMPROGRAMS\\${PRODUCT_NAME}"
|
RMDir "$SMPROGRAMS\${PRODUCT_NAME}"
|
||||||
|
|
||||||
; Supprimer le raccourci de démarrage et l’entrée registre
|
; Supprimer le raccourci de démarrage et l’entrée registre
|
||||||
Delete "$SMSTARTUP\\Relancer Kogus Stack.lnk"
|
Delete "$SMSTARTUP\Relancer Kogus Stack.lnk"
|
||||||
DeleteRegValue HKCU "Software\\Microsoft\\Windows\\CurrentVersion\\Run" "DockerDesktop"
|
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "DockerDesktop"
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
Loading…
x
Reference in New Issue
Block a user