commit 72e5fd7b1da5137be6eecf3aec607b4bb30d81fe parent 57dc02485873122e1154d77995c83f83e2aca152 Author: Leayawi <lea.oualli@outlook.fr> Date: Mon, 2 Jun 2025 16:09:08 +0200 test upgrade with a launcher Diffstat:
| A | upgrade/taler-launcher.nsi | | | 51 | +++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 51 insertions(+), 0 deletions(-)
diff --git a/upgrade/taler-launcher.nsi b/upgrade/taler-launcher.nsi @@ -0,0 +1,51 @@ +; Taler-Merchant Launcher with Auto-Upgrade +; Author: Léa Oualli + +Unicode true +!include "MUI2.nsh" + +Name "Taler-Merchant Launcher" +Outfile "taler-launcher.exe" +RequestExecutionLevel admin + +Var /GLOBAL WSL_DISTRO + +Section "Launch or Upgrade Taler-Merchant" + + ; 1. Vérifier si Debian est installée dans WSL + nsExec::ExecToStack 'wsl -l -v' + Pop $0 + ${If} ${Errors} + MessageBox MB_OK "WSL does not seem to be installed. Please install Debian/WSL first." + Abort + ${EndIf} + ; Cherche "Debian" dans la sortie + StrCpy $WSL_DISTRO "" + ${IfThen} $0 =~ "Debian" ${|} StrCpy $WSL_DISTRO "Debian" ${|} + ${If} $WSL_DISTRO == "" + MessageBox MB_OK "Debian is not installed in WSL. Please install Debian first." + Abort + ${EndIf} + + ; 2. Vérifier la présence de taler-merchant + nsExec::ExecToStack 'wsl -d Debian -- bash -c "which taler-merchant"' + Pop $0 + ${If} ${Errors} + MessageBox MB_OK "Taler-Merchant is not installed yet. Please run the main installer first." + Abort + ${EndIf} + + ; 3. Proposer upgrade + MessageBox MB_YESNO|MB_ICONQUESTION "Taler-Merchant is installed.$\nDo you want to upgrade Taler and system packages now?" IDYES do_upgrade IDNO skip_upgrade + + do_upgrade: + nsExec::ExecToLog 'wsl -d Debian -- bash -c "sudo apt update && sudo apt upgrade -y && sudo apt install --only-upgrade taler-merchant taler-exchange -y"' + MessageBox MB_OK "Upgrade finished!" + Goto end_upgrade + + skip_upgrade: + DetailPrint "User skipped upgrade." + + end_upgrade: + +SectionEnd