commit c8aba714b758921c15b720101c7cf5d28b09bf9b parent 0594995c4c59174c32a9c4af72a4b237d6b14958 Author: Leayawi <lea.oualli@outlook.fr> Date: Mon, 26 May 2025 16:54:13 +0200 check https Diffstat:
| A | .gitignore | | | 12 | ++++++++++++ |
| D | Merchant client/install-talerV1.bat | | | 16 | ---------------- |
| D | NSIS/GNU-Taler-Minimal-Setup.exe | | | 0 | |
| D | NSIS/GNU-Taler-Minimal.exe | | | 0 | |
| D | NSIS/GNU-Taler-Test.exe | | | 0 | |
| D | NSIS/Install_taler_design.nsi | | | 69 | --------------------------------------------------------------------- |
| D | NSIS/Install_taler_postgress.nsi | | | 132 | ------------------------------------------------------------------------------- |
| D | NSIS/Install_taler_postgressV2.nsi | | | 48 | ------------------------------------------------ |
| D | NSIS/Install_taler_proxy.nsi | | | 177 | ------------------------------------------------------------------------------- |
| D | NSIS/Minimal-Taler-Installer.exe | | | 0 | |
| D | NSIS/Taler-Minimal-Setup.exe | | | 0 | |
| D | NSIS/TalerMinimalInstaller.exe | | | 0 | |
| D | NSIS/install_talerV1.nsi | | | 24 | ------------------------ |
| D | NSIS/install_taler_before-design.nsi | | | 24 | ------------------------ |
| D | NSIS/logo-header.bmp | | | 0 | |
| D | NSIS/logo-welcome.bmp | | | 0 | |
| D | NSIS_test/hello.nsi | | | 18 | ------------------ |
| D | NSIS_test/hello.txt | | | 1 | - |
| D | Procedure/README.md | | | 63 | --------------------------------------------------------------- |
| M | install-taler-from-apt.sh | | | 131 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------- |
| A | logo-header.bmp | | | 0 | |
| R | NSIS/logo-header.ico -> logo-header.ico | | | 0 | |
| A | logo-welcome.bmp | | | 0 | |
| M | run-admin.bat | | | 16 | ++++++++++++++++ |
| M | setup-wsl-debian.bat | | | 179 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------- |
| D | source/install-taler-basic.sh | | | 83 | ------------------------------------------------------------------------------- |
| D | source/install-taler.sh | | | 51 | --------------------------------------------------- |
| D | source/install-talerV1.sh | | | 35 | ----------------------------------- |
| D | source/logs/install.log | | | 94 | ------------------------------------------------------------------------------- |
| D | source/setup_postgresql.sh | | | 50 | -------------------------------------------------- |
| M | taler-installer-taler.nsi | | | 307 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- |
| M | taler-installer.exe | | | 0 | |
| D | taler-installer.nsi | | | 14 | -------------- |
33 files changed, 582 insertions(+), 962 deletions(-)
diff --git a/.gitignore b/.gitignore @@ -0,0 +1,12 @@ +# Ignorer les fichiers binaires générés +*.exe +*.log + +# Fichiers NSIS temporaires +*.nsi~ +*.old + +# Répertoires inutiles +__pycache__/ +tmp/ +build/ diff --git a/Merchant client/install-talerV1.bat b/Merchant client/install-talerV1.bat @@ -1,16 +0,0 @@ -@echo off -<<<<<<< HEAD -setlocal - -echo === Lancement de l'installation de GNU Taler via WSL === - - -wsl -d Debian -- bash /mnt/c/Users/%USERNAME%/taler-windows/source/install-taler.sh - -echo. -echo ✅ Script terminé. Vérifie les messages dans la console. -======= -echo === GNU Taler Installer - Lancement manuel === -wsl -d Debian bash "/mnt/c/Program Files (x86)/Taler_Merchant/source/install-talerV1.sh" ->>>>>>> d43d770 (Ajout du script NSIS + installeur automatique) -pause diff --git a/NSIS/GNU-Taler-Minimal-Setup.exe b/NSIS/GNU-Taler-Minimal-Setup.exe Binary files differ. diff --git a/NSIS/GNU-Taler-Minimal.exe b/NSIS/GNU-Taler-Minimal.exe Binary files differ. diff --git a/NSIS/GNU-Taler-Test.exe b/NSIS/GNU-Taler-Test.exe Binary files differ. diff --git a/NSIS/Install_taler_design.nsi b/NSIS/Install_taler_design.nsi @@ -1,69 +0,0 @@ -Unicode true -XPStyle on -RequestExecutionLevel admin -InstallDir "$PROGRAMFILES\Taler_Merchant" - -!include "MUI2.nsh" - -; Définir les variables nécessaires pour l'interface utilisateur -!define MUI_LANGDLL_DISPLAY -!define MUI_LANGDLL_ALWAYS_SHOW -!define MUI_LANGDLL_REGISTRY_ROOT "HKCU" -!define MUI_LANGDLL_REGISTRY_KEY "Software\GNU_Taler_Installer" -!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" - -!define APPNAME "GNU Taler Installer" -!define COMPANY "Taler Systems SA" -!define DESCRIPTION "Installeur GNU Taler via WSL" -!define VERSION "1.0" - -!define MUI_ICON "logo-header.ico" -!define MUI_HEADERIMAGE -!define MUI_HEADERIMAGE_RIGHT -!define MUI_HEADERIMAGE_BITMAP "logo-header.bmp" -!define MUI_WELCOMEFINISHPAGE_BITMAP "logo-welcome.bmp" -!define MUI_FINISHPAGE_NOAUTOCLOSE - -Name "${APPNAME}" -OutFile "${APPNAME}-Setup.exe" - -; Pages de l'installateur -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_DIRECTORY -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH - -!insertmacro MUI_LANGUAGE "French" -!insertmacro MUI_LANGUAGE "English" - -Section "Installation de ${APPNAME}" - - ; Lire la langue à partir du registre - ReadRegStr $0 ${MUI_LANGDLL_REGISTRY_ROOT} "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}" - - ; Vérifier si la clé existe - StrCmp $0 "" 0 +2 - MessageBox MB_ICONEXCLAMATION|MB_OK "La clé de registre n'a pas été trouvée. L'installation continue avec les paramètres par défaut." - - ; Afficher la langue du programme - MessageBox MB_ICONINFORMATION|MB_OK "Langue du programme : $0" - - ; Définir le répertoire d'installation - SetOutPath "$INSTDIR" - - ; Copier le script d'installation - File "..\source\install-talerV1.sh" - - ; Exécuter l'installation via WSL - nsExec::ExecToLog '"C:\Windows\System32\wsl.exe" -d Debian bash /mnt/c/Users/%USERNAME%/Desktop/taler-windows/source/install-talerV1.sh' - - ; Créer un raccourci sur le bureau - CreateShortCut "$DESKTOP\Lancer ${APPNAME}.lnk" "$INSTDIR\install-talerV1.sh" - - ; Message de succès - MessageBox MB_ICONINFORMATION|MB_OK "${APPNAME} a été installé avec succès !" - -ExecWait '"$INSTDIR\Taler_Merchant.exe"' - - -SectionEnd diff --git a/NSIS/Install_taler_postgress.nsi b/NSIS/Install_taler_postgress.nsi @@ -1,132 +0,0 @@ -; ============================= -; GNU Taler Installer -; ============================= - -!include "MUI2.nsh" -!include "nsDialogs.nsh" -!include "LogicLib.nsh" -!include "FileFunc.nsh" -!include "x64.nsh" - -Unicode true -RequestExecutionLevel admin -XPStyle on - -InstallDir "$PROGRAMFILES\Taler_Merchant" - -!define APPNAME "GNU Taler Installer" -!define MUI_ICON "logo-header.ico" -!define MUI_HEADERIMAGE_BITMAP "logo-header.bmp" -!define MUI_WELCOMEFINISHPAGE_BITMAP "logo-welcome.bmp" - -Name "${APPNAME}" -OutFile "${APPNAME}-Setup.exe" - -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_DIRECTORY -Page custom dbPageCreate dbPageLeave -Page custom credentialsPageCreate credentialsPageLeave -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH -!insertmacro MUI_LANGUAGE "French" - -Var DB_EXISTING -Var DB_USER -Var DB_PASS -Var DB_NAME -Var DB_PATH - -; =============== Page choix DB =================== -Function dbPageCreate - nsDialogs::Create 1018 - Pop $0 - ${NSD_CreateLabel} 0 0 100% 12u "Avez-vous déjà une base PostgreSQL existante ?" - Pop $1 - ${NSD_CreateRadioButton} 0 15u 100% 10u "Oui, j’ai déjà une base" - Pop $2 - ${NSD_SetState} $2 0 - ${NSD_CreateRadioButton} 0 30u 100% 10u "Non, créer une nouvelle base" - Pop $3 - ${NSD_SetState} $3 1 - ${NSD_OnClick} $2 SetDB_EXISTING_True - ${NSD_OnClick} $3 SetDB_EXISTING_False - nsDialogs::Show -FunctionEnd - -Function SetDB_EXISTING_True - StrCpy $DB_EXISTING "1" -FunctionEnd - -Function SetDB_EXISTING_False - StrCpy $DB_EXISTING "0" -FunctionEnd - -Function dbPageLeave -FunctionEnd - -; =============== Page données PostgreSQL =================== -Function credentialsPageCreate - nsDialogs::Create 1018 - Pop $0 - ${If} $DB_EXISTING == "1" - ${NSD_CreateLabel} 0 0 100% 12u "Chemin d'accès à votre base PostgreSQL existante :" - Pop $1 - ${NSD_CreateText} 0 15u 100% 12u "" - Pop $DB_PATH - ${Else} - ${NSD_CreateLabel} 0 0 100% 12u "Nom d'utilisateur PostgreSQL :" - Pop $1 - ${NSD_CreateText} 0 15u 100% 12u "taleruser" - Pop $DB_USER - ${NSD_CreateLabel} 0 30u 100% 12u "Mot de passe PostgreSQL :" - Pop $2 - ${NSD_CreatePassword} 0 45u 100% 12u "" - Pop $DB_PASS - ${NSD_CreateLabel} 0 60u 100% 12u "Nom de la base PostgreSQL :" - Pop $3 - ${NSD_CreateText} 0 75u 100% 12u "talerdb" - Pop $DB_NAME - ${EndIf} - nsDialogs::Show -FunctionEnd - -Function credentialsPageLeave - ${If} $DB_EXISTING == "0" - FileOpen $0 "$INSTDIR\pgvars.txt" "w" - FileWrite $0 "$DB_USER$\n$DB_PASS$\n$DB_NAME$\n" - FileClose $0 - ${EndIf} -FunctionEnd - -; =================== Section Installation ====================== -Section "Installation de ${APPNAME}" - SetOutPath "$INSTDIR" - DetailPrint "Étape 1/5 : Copie des fichiers" - File "..\Merchant client\install-talerV1.bat" - File "..\source\install-talerV1.sh" - File "..\source\setup_postgresql.sh" - DetailPrint "Étape 2/5 : Vérification WSL" -nsExec::ExecToStack "$WINDIR\Sysnative\wsl.exe --version" -Pop $0 -${If} $0 != 0 - MessageBox MB_ICONSTOP "❌ WSL non reconnu, installation annulée." - Abort -${EndIf} - ${If} $DB_EXISTING == "1" - DetailPrint "Étape 3/5 : Base existante à $DB_PATH" - ${Else} - DetailPrint "Étape 3/5 : Installation PostgreSQL" - nsExec::ExecToStack 'wsl -d Debian bash "$INSTDIR/setup_postgresql.sh"' - ${EndIf} - DetailPrint "Étape 4/5 : Installation GNU Taler" -nsExec::ExecToStack '"$INSTDIR\install-talerV1.bat"' -Pop $1 - -DetailPrint "Étape 5/5 : Finalisation" -${If} $1 == 0 - MessageBox MB_ICONINFORMATION "✅ GNU Taler installé avec succès !" -${Else} - MessageBox MB_ICONSTOP "❌ Erreur pendant l'installation (code $1)." -${EndIf} -SectionEnd - diff --git a/NSIS/Install_taler_postgressV2.nsi b/NSIS/Install_taler_postgressV2.nsi @@ -1,48 +0,0 @@ -!include "MUI2.nsh" -!include "nsDialogs.nsh" -!include "FileFunc.nsh" -!include "LogicLib.nsh" - -Unicode true -RequestExecutionLevel admin -OutFile "GNU-Taler-Minimal.exe" -InstallDir "$LOCALAPPDATA\Taler_Merchant" -Name "GNU Taler Minimal Installer" -ShowInstDetails show - -Var LINUX_DIR - -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_DIRECTORY -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH -!insertmacro MUI_LANGUAGE "French" - -Section "Installation minimale" - - SetOutPath "$INSTDIR" - DetailPrint "1/4 : Copie du script" - File "..\source\install-talerV1.sh" - - DetailPrint "2/4 : Conversion en format UNIX" - nsExec::ExecToStack 'wsl -d Debian dos2unix "$INSTDIR/install-talerV1.sh"' - - DetailPrint "3/4 : Conversion du chemin Windows en chemin WSL" - nsExec::ExecToStack 'wsl -d Debian wslpath "$INSTDIR"' - Pop $0 - StrCpy $LINUX_DIR $0 - - DetailPrint "4/4 : Exécution du script sous WSL" - nsExec::ExecToStack "wsl -d Debian bash '$LINUX_DIR/install-talerV1.sh'" - Pop $1 - Pop $0 - - DetailPrint "Code retour : $0 - Sortie : $1" - - ${If} $0 == 0 - MessageBox MB_ICONINFORMATION "✅ Script exécuté avec succès." - ${Else} - MessageBox MB_ICONSTOP "❌ Erreur pendant l'exécution du script (code $0)." - ${EndIf} - -SectionEnd diff --git a/NSIS/Install_taler_proxy.nsi b/NSIS/Install_taler_proxy.nsi @@ -1,177 +0,0 @@ -; ============================= -; GNU Taler Installer avec support Proxy -; (corrigé - final et robuste) -; ============================= - -!include "MUI2.nsh" -!include "nsDialogs.nsh" -!include "LogicLib.nsh" -!include "FileFunc.nsh" -!include "x64.nsh" - -Unicode true -RequestExecutionLevel admin -XPStyle on - -InstallDir "$PROGRAMFILES\Taler_Merchant" - -Function .onInit - ${If} ${RunningX64} - StrCpy $INSTDIR "$PROGRAMFILES64\Taler_Merchant" - ${Else} - StrCpy $INSTDIR "$PROGRAMFILES\Taler_Merchant" - ${EndIf} -FunctionEnd - - -!define APPNAME "GNU Taler Installer" -!define MUI_ICON "logo-header.ico" -!define MUI_HEADERIMAGE_BITMAP "logo-header.bmp" -!define MUI_WELCOMEFINISHPAGE_BITMAP "logo-welcome.bmp" - -Name "${APPNAME}" -OutFile "${APPNAME}-Setup.exe" - -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_DIRECTORY -Page custom dbPageCreate dbPageLeave -Page custom credentialsPageCreate credentialsPageLeave -Page custom proxyPageCreate proxyPageLeave -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH -!insertmacro MUI_LANGUAGE "French" - -Var DB_EXISTING -Var DB_USER -Var DB_PASS -Var DB_NAME -Var DB_PATH -Var PROXY_NEEDED -Var PROXY_URL - -Function dbPageCreate - nsDialogs::Create 1018 - Pop $0 - ${NSD_CreateLabel} 0 0 100% 12u "Avez-vous déjà une base PostgreSQL existante ?" - Pop $1 - ${NSD_CreateRadioButton} 0 15u 100% 10u "Oui, j’ai déjà une base" - Pop $2 - ${NSD_SetState} $2 0 - ${NSD_CreateRadioButton} 0 30u 100% 10u "Non, créer une nouvelle base" - Pop $3 - ${NSD_SetState} $3 1 - ${NSD_OnClick} $2 SetDB_EXISTING_True - ${NSD_OnClick} $3 SetDB_EXISTING_False - nsDialogs::Show -FunctionEnd - -Function SetDB_EXISTING_True - StrCpy $DB_EXISTING "1" -FunctionEnd - -Function SetDB_EXISTING_False - StrCpy $DB_EXISTING "0" -FunctionEnd - -Function dbPageLeave -FunctionEnd - -Function credentialsPageCreate - nsDialogs::Create 1018 - Pop $0 - ${If} $DB_EXISTING == "1" - ${NSD_CreateLabel} 0 0 100% 12u "Chemin d'accès à votre base PostgreSQL existante :" - Pop $1 - ${NSD_CreateText} 0 15u 100% 12u "" - Pop $DB_PATH - ${Else} - ${NSD_CreateLabel} 0 0 100% 12u "Nom d'utilisateur PostgreSQL :" - Pop $1 - ${NSD_CreateText} 0 15u 100% 12u "taleruser" - Pop $DB_USER - ${NSD_CreateLabel} 0 30u 100% 12u "Mot de passe PostgreSQL :" - Pop $2 - ${NSD_CreatePassword} 0 45u 100% 12u "" - Pop $DB_PASS - ${NSD_CreateLabel} 0 60u 100% 12u "Nom de la base PostgreSQL :" - Pop $3 - ${NSD_CreateText} 0 75u 100% 12u "talerdb" - Pop $DB_NAME - ${EndIf} - nsDialogs::Show -FunctionEnd - -Function credentialsPageLeave - ${If} $DB_EXISTING == "0" - FileOpen $0 "$INSTDIR\pgvars.txt" "w" - FileWrite $0 "$DB_USER$\n$DB_PASS$\n$DB_NAME$\n" - FileClose $0 - ${EndIf} -FunctionEnd - -Function proxyPageCreate - nsDialogs::Create 1018 - Pop $0 - ${NSD_CreateLabel} 0 0 100% 12u "Votre connexion passe-t-elle par un proxy ?" - Pop $1 - ${NSD_CreateRadioButton} 0 15u 100% 10u "Oui" - Pop $2 - ${NSD_SetState} $2 0 - ${NSD_CreateRadioButton} 0 30u 100% 10u "Non" - Pop $3 - ${NSD_SetState} $3 1 - ${NSD_OnClick} $2 SetProxyNeeded_True - ${NSD_OnClick} $3 SetProxyNeeded_False - ${NSD_CreateLabel} 0 50u 100% 12u "URL du proxy :" - Pop $4 - ${NSD_CreateText} 0 65u 100% 12u "" - Pop $PROXY_URL - nsDialogs::Show -FunctionEnd - -Function SetProxyNeeded_True - StrCpy $PROXY_NEEDED "1" -FunctionEnd - -Function SetProxyNeeded_False - StrCpy $PROXY_NEEDED "0" -FunctionEnd - -Function proxyPageLeave -FunctionEnd - -Section "Installation de ${APPNAME}" - SetOutPath "$INSTDIR" - File "..\Merchant client\install-talerV1.bat" - File "..\source\install-talerV1.sh" - File "..\source\setup_postgresql.sh" - - ${If} $PROXY_NEEDED == "1" - FileOpen $0 "$INSTDIR\proxy.txt" "w" - FileWrite $0 "$PROXY_URL$\n" - FileClose $0 - ${EndIf} - - DetailPrint "Vérification WSL" - nsExec::ExecToStack "$WINDIR\System32\wsl.exe --version" - Pop $0 - ${If} $0 != 0 - MessageBox MB_ICONSTOP "WSL non reconnu." - Abort - ${EndIf} - - DetailPrint "Installation GNU Taler" - ; (corrected for spaces) - ${If} $PROXY_NEEDED == "1" - nsExec::ExecToStack 'wsl -d Debian bash -c "bash \"$(wslpath \"$INSTDIR/install-talerV1.sh\")\" \"$(wslpath \"$INSTDIR/proxy.txt\")\" > \"$(wslpath \"$INSTDIR/install.log\")\" 2>&1"' - ${Else} - nsExec::ExecToStack 'wsl -d Debian bash -c "bash \"$(wslpath \"$INSTDIR/install-talerV1.sh\")\" > \"$(wslpath \"$INSTDIR/install.log\")\" 2>&1"' - ${EndIf} - Pop $1 - - ${If} $1 == 0 - MessageBox MB_ICONINFORMATION "✅ GNU Taler installé." - ${Else} - MessageBox MB_ICONSTOP "❌ Erreur : voir install.log." - ${EndIf} -SectionEnd diff --git a/NSIS/Minimal-Taler-Installer.exe b/NSIS/Minimal-Taler-Installer.exe Binary files differ. diff --git a/NSIS/Taler-Minimal-Setup.exe b/NSIS/Taler-Minimal-Setup.exe Binary files differ. diff --git a/NSIS/TalerMinimalInstaller.exe b/NSIS/TalerMinimalInstaller.exe Binary files differ. diff --git a/NSIS/install_talerV1.nsi b/NSIS/install_talerV1.nsi @@ -1,24 +0,0 @@ -!define APPNAME "GNU Taler Installer" -OutFile "GNU-Taler-Installer.exe" -InstallDir "$PROGRAMFILES\Taler" -RequestExecutionLevel admin - -Page directory -Page instfiles - -Section "Installation de GNU Taler" - SetOutPath "$INSTDIR" - - ; Copie les deux scripts depuis le dossier d'installation NSIS - File "..\Merchant client\install-taler.bat" - File "..\source\install-taler.sh" - - ; Lancer le .bat en silencieux - nsExec::ExecToLog '"$INSTDIR\install-taler.bat"' - - ; Message de fin - MessageBox MB_ICONINFORMATION|MB_OK "GNU Taler a ete installe avec succes." - - ; Raccourci sur le bureau - CreateShortCut "$DESKTOP\Lancer GNU Taler.lnk" "$INSTDIR\install-taler.bat" -SectionEnd diff --git a/NSIS/install_taler_before-design.nsi b/NSIS/install_taler_before-design.nsi @@ -1,24 +0,0 @@ -!define APPNAME "GNU Taler Installer" -OutFile "GNU-Taler-Installer.exe" -InstallDir "$PROGRAMFILES\Taler" -RequestExecutionLevel admin - -Page directory -Page instfiles - -Section "Installation de GNU Taler" - SetOutPath "$INSTDIR" - - ; Copie les deux scripts dans le dossier d'installation NSIS - File "..\Merchant client\install-talerV1.bat" - File "..\source\install-talerV1.sh" - - ; Lancer le .bat en silencieux - nsExec::ExecToLog '"$INSTDIR\install-talerV1.bat"' - - ; Message de fin - MessageBox MB_ICONINFORMATION|MB_OK "GNU Taler a été installé avec succès." - - ; Raccourci sur le bureau - CreateShortCut "$DESKTOP\Lancer GNU Taler.lnk" "$INSTDIR\install-talerV1.bat" -SectionEnd diff --git a/NSIS/logo-header.bmp b/NSIS/logo-header.bmp Binary files differ. diff --git a/NSIS/logo-welcome.bmp b/NSIS/logo-welcome.bmp Binary files differ. diff --git a/NSIS_test/hello.nsi b/NSIS_test/hello.nsi @@ -1,18 +0,0 @@ -# Nom du programme -OutFile "HelloInstaller.exe" - -# Dossier d'installation (par défaut dans Program Files) -InstallDir "$PROGRAMFILES\HelloApp" - -# Privilèges administrateur requis -RequestExecutionLevel admin - -# Pages à afficher -Page directory -Page instfiles - -# Début de l'installation -Section "Installer HelloApp" - SetOutPath "$INSTDIR" ; Dossier d'installation - File "hello.txt" ; Fichier à copier -SectionEnd diff --git a/NSIS_test/hello.txt b/NSIS_test/hello.txt @@ -1 +0,0 @@ -un petit test bonjour. 🎉 diff --git a/Procedure/README.md b/Procedure/README.md @@ -1,63 +0,0 @@ -"# Projet Taler Windows" -🧠 GNU Taler - Installeur Windows (avec WSL + Proxy support) -============================================================ - -Ce projet fournit un installeur NSIS qui permet d’installer automatiquement GNU Taler (merchant) -et PostgreSQL sous Windows via WSL (Debian), avec gestion optionnelle d’un proxy réseau. - -📦 Contenu ---------- -- Install_taler_postgress.nsi – Le script NSIS principal. -- install-talerV1.sh – Script bash qui installe GNU Taler côté WSL. -- setup_postgresql.sh – Script de configuration initiale de la base PostgreSQL. -- install-talerV1.bat *(optionnel)* – Lance le .sh manuellement (peut être remplacé par l’appel NSIS). -- proxy.txt *(généré automatiquement si besoin)* – Contient l’URL du proxy saisi par l’utilisateur. - -🧩 Fonctionnement ------------------ -1. Lancement de l’installeur NSIS : - - Choix du répertoire d’installation - - Déclaration d’une base PostgreSQL existante ou non - - Configuration utilisateur PostgreSQL - - 🔐 Demande si un proxy est nécessaire - - Si oui : saisie de l’URL (ex: http://proxy.monentreprise.fr:8080) - - Cette URL est stockée dans proxy.txt - -2. Installation automatique via WSL : - - install-talerV1.sh est exécuté dans Debian - - Il lit proxy.txt si présent et exporte les variables : - export http_proxy=... - export https_proxy=... - - Il fait : - 1. apt update - 2. install des outils - 3. ajout du dépôt GNU Taler - 4. installation de taler-merchant et postgresql - 5. configuration PostgreSQL via setup_postgresql.sh - -⚠️ Prérequis ------------- -- WSL activé sur Windows -- Debian installé et défini par défaut : - wsl --set-default Debian - -💡 Remarques ------------- -- Ce projet est universel : proxy ou non, base existante ou nouvelle. -- En cas de réseau restreint, le proxy est une solution efficace. - -📂 Exemple de structure du dossier ----------------------------------- -taler-windows/ -│ -├── Merchant client/ -│ └── install-talerV1.bat -│ -├── source/ -│ ├── install-talerV1.sh -│ └── setup_postgresql.sh -│ -├── NSIS/ -│ └── Install_taler_postgress.nsi -│ -└── logo-header.ico / .bmp ... diff --git a/install-taler-from-apt.sh b/install-taler-from-apt.sh @@ -1,38 +1,127 @@ #!/bin/bash +# This file is part of GNU Taler. +# Copyright (C) 2025 Taler Systems SA +# +# TALER is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free Software +# Foundation; either version 2.1, or (at your option) any later version. +# +# TALER is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License along with +# TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +# +# Author: Léa Oualli + set -e set -x +trap 'echo "Error occurred on line $LINENO." >&2' ERR exec > >(tee -a /tmp/install-output.log) 2>&1 -# Préparer l'environnement APT -sudo apt update -sudo apt install -y gnupg wget lsb-release apt-transport-https ca-certificates +WSL_USER="taleruser" +TALER_DB_USER="taler-merchant-httpd" -# Créer le dossier keyrings si besoin -sudo mkdir -p /etc/apt/keyrings +############################################# +# -------- HTTPS / Reverse Proxy -----------# +############################################# +# Si le script est appelé avec "8" et un domaine, on ne fait QUE la config HTTPS/proxy : +if [ "$1" = "8" ] && [ -n "$2" ]; then + DOMAIN="$2" + echo "Configuring HTTPS reverse proxy for domain: $DOMAIN" + if ! sudo taler-merchant-rproxy-setup --acme --merchant-url="https://$DOMAIN:8888/"; then + echo "WARNING: Impossible d’obtenir un certificat HTTPS valide pour $DOMAIN (vérifie le DNS, les ports 80/443, et Internet)" | tee -a "/home/$WSL_USER/taler-installer/install.log" + # On ne bloque pas toute l'install, on log juste le problème + exit 0 + fi + echo "HTTPS reverse proxy configured for $DOMAIN" | tee -a "/home/$WSL_USER/taler-installer/install.log" + exit 0 +fi +############################################# + +# Vérification de l'utilisateur système +if ! id "$WSL_USER" &>/dev/null; then + echo "System user $WSL_USER not found. Please create it." >&2 + exit 1 +fi + +echo "Adding user $WSL_USER to www-data group..." +sudo usermod -aG www-data $WSL_USER || { + echo "Failed to add $WSL_USER to www-data group." >&2 + exit 1 +} + +sudo apt-get update +sudo apt-get install -y gnupg wget curl lsb-release apt-transport-https ca-certificates || { + echo "Base dependencies installation failed." >&2 + exit 1 +} + +sudo apt-get install -y postgresql || { + echo "PostgreSQL installation failed." >&2 + exit 1 +} -# Ajouter le dépôt officiel de Taler -echo "deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/debian bookworm main" | sudo tee /etc/apt/sources.list.d/taler.list +sudo systemctl enable postgresql +sudo systemctl start postgresql + +echo "Creating PostgreSQL user $WSL_USER..." +sudo -u postgres createuser --createdb "$WSL_USER" || echo "User $WSL_USER already exists, continuing..." + +echo "Creating PostgreSQL user $TALER_DB_USER..." +sudo -u postgres createuser --createdb "$TALER_DB_USER" || echo "User $TALER_DB_USER already exists, continuing..." + +echo "Adding GNU Taler repository..." + +# --- DÉTECTION DE LA DISTRIBUTION ET AJOUT DU BON DÉPÔT --- +DISTRO="$(lsb_release -is 2>/dev/null || echo Debian)" +CODENAME="$(lsb_release -cs 2>/dev/null || echo bookworm)" +sudo mkdir -p /etc/apt/keyrings -# Importer la clé publique de Taler Systems -sudo wget -O /etc/apt/keyrings/taler-systems.gpg https://taler.net/taler-systems.gpg +# Importe la clé +curl -fsSL https://taler.net/taler-systems.gpg | gpg --dearmor | sudo tee /etc/apt/keyrings/taler-systems.gpg > /dev/null -# Mettre à jour les paquets -sudo apt update +if [ "$DISTRO" = "Ubuntu" ]; then + echo "deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/ubuntu/ $CODENAME main" \ + | sudo tee /etc/apt/sources.list.d/taler.list +else + echo "deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/debian/ $CODENAME main" \ + | sudo tee /etc/apt/sources.list.d/taler.list +fi -# Installer taler-merchant -sudo apt install -y taler-merchant +# --------------------------------------------------------- -echo "✅ GNU Taler installé avec succès !" | tee ~/taler-installer/install.log +sudo apt-get update +sudo apt-get install -y taler-merchant || { + echo "GNU Taler installation failed." >&2 + exit 1 +} -echo "🔧 Activation du service taler-merchant-httpd..." -sudo systemctl enable taler-merchant-httpd -sudo systemctl enable taler-merchant-httpd.socket +echo "Creating /etc/taler/merchant.conf..." +sudo mkdir -p /etc/taler +echo "[merchant] +PORT = 8888 +UNIX_DOMAIN_SOCKETS = NO" | sudo tee /etc/taler-merchant/taler-merchant.conf -echo "🚀 Démarrage du socket taler-merchant..." -sudo systemctl start taler-merchant-httpd.socket +echo "Initializing database with taler-merchant-dbconfig..." +if ! sudo taler-merchant-dbconfig; then + echo "Error during taler-merchant-dbconfig" >&2 + exit 1 +fi -echo "📋 Statut du service taler-merchant-httpd :" -sudo systemctl status taler-merchant-httpd --no-pager | tee -a ~/taler-installer/install.log +echo "Enabling taler-merchant.target..." +sudo systemctl enable taler-merchant.target +sudo systemctl restart taler-merchant.target +echo "Also enabling TCP service on port 8888..." +sudo systemctl enable taler-merchant-httpd.service +sudo systemctl restart taler-merchant-httpd.service +echo "Checking taler-merchant status..." +sudo systemctl status taler-merchant-httpd.service --no-pager || true +sudo systemctl status taler-merchant-httpd.socket --no-pager || true +mkdir -p "/home/$WSL_USER/taler-installer" +sudo chown -R "$WSL_USER:$WSL_USER" "/home/$WSL_USER/taler-installer" +echo "GNU Taler-Merchant installed successfully via system config" | tee "/home/$WSL_USER/taler-installer/install.log" diff --git a/logo-header.bmp b/logo-header.bmp Binary files differ. diff --git a/NSIS/logo-header.ico b/logo-header.ico Binary files differ. diff --git a/logo-welcome.bmp b/logo-welcome.bmp Binary files differ. diff --git a/run-admin.bat b/run-admin.bat @@ -1,2 +1,18 @@ @echo off +:: This file is part of GNU Taler. +:: Copyright (C) 2025 Taler Systems SA +:: +:: TALER is free software; you can redistribute it and/or modify it under the +:: terms of the GNU Lesser General Public License as published by the Free Software +:: Foundation; either version 2.1, or (at your option) any later version. +:: +:: TALER is distributed in the hope that it will be useful, but WITHOUT ANY +:: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +:: A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +:: +:: You should have received a copy of the GNU Lesser General Public License along with +:: TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +:: +:: Author: Léa Oualli + powershell -Command "Start-Process cmd.exe -ArgumentList '/c \"%~dp0setup-wsl-debian.bat\"' -Verb RunAs" diff --git a/setup-wsl-debian.bat b/setup-wsl-debian.bat @@ -1,47 +1,168 @@ @echo off -setlocal enabledelayedexpansion +:: This file is part of GNU Taler. +:: Copyright (C) 2025 Taler Systems SA +:: +:: TALER is free software; you can redistribute it and/or modify it under the +:: terms of the GNU Lesser General Public License as published by the Free Software +:: Foundation; either version 2.1, or (at your option) any later version. +:: +:: TALER is distributed in the hope that it will be useful, but WITHOUT ANY +:: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +:: A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +:: +:: You should have received a copy of the GNU Lesser General Public License along with +:: TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +:: +:: Author: Léa Oualli +setlocal enabledelayedexpansion set WSL=%WINDIR%\Sysnative\wsl.exe set WSL_USER=taleruser +set STEP=%1 +set DOMAIN=%2 +set DISTRO=%3 +set PROXY_MODE=%4 + +if "%STEP%"=="" ( + set STEP=ALL +) + +if "%DISTRO%"=="" ( + set DISTRO=Debian +) + +if "%STEP%"=="1" goto step1 +if "%STEP%"=="2" goto step2 +if "%STEP%"=="3" goto step3 +if "%STEP%"=="4" goto step4 +if "%STEP%"=="5" goto step5 +if "%STEP%"=="6" goto step6 +if "%STEP%"=="7" goto step7 +if "%STEP%"=="8" goto step8 + +:step1 +echo [1/8] Checking if WSL and VirtualMachinePlatform are enabled... + +:: Check if WSL is enabled +powershell -Command "(Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux).State" | find /I "Enabled" >nul +set WSL_ENABLED=%errorlevel% +:: Check if VirtualMachinePlatform is enabled +powershell -Command "(Get-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform).State" | find /I "Enabled" >nul +set VMP_ENABLED=%errorlevel% + +if %WSL_ENABLED% equ 0 ( + echo WSL is already enabled. +) else ( + echo Enabling WSL feature... + powershell.exe -Command "Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart" + set NEED_REBOOT=1 +) + +if %VMP_ENABLED% equ 0 ( + echo VirtualMachinePlatform is already enabled. +) else ( + echo Enabling VirtualMachinePlatform feature... + powershell.exe -Command "Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart" + set NEED_REBOOT=1 +) + +if defined NEED_REBOOT ( + echo. + echo [INFO] A restart is required to finish enabling WSL features. Please restart your computer and run the installer again. + pause + exit /b 1 +) else ( + echo [INFO] WSL and VirtualMachinePlatform are ready. +) -echo [1/6] Activation de WSL... -powershell.exe -Command "Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart" -powershell.exe -Command "Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart" +if not "%STEP%"=="ALL" exit /b -echo [2/6] Installation de Debian... -%WSL% --install -d Debian +echo [INFO] Updating WSL to the latest version if needed... +echo [INFO] If a black window appears, please press any key when prompted, then wait until the window closes automatically. +echo [INFO] The installation will continue automatically after the update. +timeout /t 3 /nobreak -echo Attente de l'installation complète... +:: Use start /wait to ensure the script waits for the update to finish (including if user has to press a key) +start /wait "" %WSL% --update + +if not "%STEP%"=="ALL" exit /b + +:step2 +echo [2/8] Installing %DISTRO%... +%WSL% --install -d %DISTRO% timeout /t 20 /nobreak -echo [3/6] Création de l'utilisateur Debian: %WSL_USER%... -%WSL% -d Debian -u root bash -c "id -u %WSL_USER% > /dev/null 2>&1 || (useradd -m %WSL_USER% && echo '%WSL_USER% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers)" +echo Initializing %DISTRO% first launch... +%WSL% -d %DISTRO% -- bash -c "echo %DISTRO% ready" +if not "%STEP%"=="ALL" exit /b + +:step3 +echo [3/8] Creating %DISTRO% user if needed... +%WSL% -d %DISTRO% -- bash -c "id %WSL_USER% >/dev/null 2>&1 || (sudo useradd -m %WSL_USER% && echo '%WSL_USER% ALL=(ALL) NOPASSWD:ALL' | sudo tee -a /etc/sudoers)" +if not "%STEP%"=="ALL" exit /b -:: Copie du script dans le dossier temporaire Windows -echo [4/6] Préparation du script d'installation... +:step4 +echo [4/8] Adding user to www-data group... +%WSL% -d %DISTRO% -- bash -c "sudo usermod -aG www-data %WSL_USER% || echo 'Warning: Could not add user to www-data (might already be a member)'" +if not "%STEP%"=="ALL" exit /b + +:step5 +echo [5/8] Copying installer script... copy /Y "%~dp0install-taler-from-apt.sh" "%TEMP%\install-taler-from-apt.sh" +%WSL% -d %DISTRO% -- bash -c "sudo mkdir -p /home/%WSL_USER%/taler-installer" +%WSL% -d %DISTRO% -- bash -c "sudo rm -f /home/%WSL_USER%/taler-installer/install-taler-from-apt.sh" +type "%TEMP%\install-taler-from-apt.sh" | %WSL% -d %DISTRO% -- bash -c "sudo tee /home/%WSL_USER%/taler-installer/install-taler-from-apt.sh >nul" +if not "%STEP%"=="ALL" exit /b -:: Copie dans WSL -%WSL% -d Debian -u root bash -c "mkdir -p /home/%WSL_USER%/taler-installer" -%WSL% -d Debian -u root bash -c "rm -f /home/%WSL_USER%/taler-installer/install-taler-from-apt.sh" -type "%TEMP%\install-taler-from-apt.sh" | %WSL% -d Debian -u root bash -c "cat > /home/%WSL_USER%/taler-installer/install-taler-from-apt.sh" +:step6 +echo [6/8] Converting script format and setting permissions... +%WSL% -d %DISTRO% -- bash -c "sudo apt-get update && sudo apt-get install -y dos2unix" +%WSL% -d %DISTRO% -- bash -c "sudo dos2unix /home/%WSL_USER%/taler-installer/install-taler-from-apt.sh" +%WSL% -d %DISTRO% -- bash -c "sudo chmod +x /home/%WSL_USER%/taler-installer/install-taler-from-apt.sh" +if not "%STEP%"=="ALL" exit /b -:: Mise à jour et installation de dos2unix -echo [5/6] Conversion et permissions... -%WSL% -d Debian -u %WSL_USER% -- bash -c "sudo apt update && sudo apt install -y dos2unix" -%WSL% -d Debian -u %WSL_USER% -- bash -c "sudo dos2unix /home/%WSL_USER%/taler-installer/install-taler-from-apt.sh" -%WSL% -d Debian -u %WSL_USER% -- bash -c "sudo chmod +x /home/%WSL_USER%/taler-installer/install-taler-from-apt.sh" +:step7 +echo [7/8] Restarting WSL... +%WSL% --shutdown +timeout /t 3 -:: Exécution du script avec log -echo [6/6] Exécution finale... -%WSL% -d Debian -u %WSL_USER% -- bash -c "bash ~/taler-installer/install-taler-from-apt.sh | tee ~/taler-installer/install.log" +echo Running final installation script... +%WSL% -d %DISTRO% -- bash -c "sudo -u %WSL_USER% bash /home/%WSL_USER%/taler-installer/install-taler-from-apt.sh | tee /home/%WSL_USER%/taler-installer/install.log" +%WSL% -d %DISTRO% -- bash -c "sudo cp /home/%WSL_USER%/taler-installer/install.log /mnt/c/Users/Public/install.log" +if not "%STEP%"=="ALL" exit /b -:: Copie du log sur Windows -%WSL% -d Debian -u %WSL_USER% -- bash -c "cp ~/taler-installer/install.log /mnt/c/Users/Public/install.log" +:step8 +echo [8/8] Configuring reverse proxy... -echo ✅ GNU Taler installé avec succès ! +if "%DOMAIN%"=="" ( + set DOMAIN=localhost +) -:: Garde la fenêtre ouverte pour voir les messages -pause -exit /b +if /I "%PROXY_MODE%"=="HTTPS" ( + echo Setting up HTTPS with Let's Encrypt for %DOMAIN% ... + %WSL% -d %DISTRO% -- bash -c "sudo taler-merchant-rproxy-setup --acme --merchant-url='https://%DOMAIN%:8888/'" + set CERT_STATUS=%errorlevel% + if not %CERT_STATUS%==0 ( + echo [ERREUR] Impossible d’obtenir un certificat HTTPS valide pour %DOMAIN%. + echo [ERREUR] Veuillez vérifier que le domaine pointe bien sur cette machine et soit accessible publiquement. + timeout /t 5 /nobreak + ) +) else ( + echo Setting up HTTP only for %DOMAIN% ... + %WSL% -d %DISTRO% -- bash -c "sudo taler-merchant-rproxy-setup --domain %DOMAIN% --httponly" +) +echo. +echo Verifying domain configured in Apache... +%WSL% -d %DISTRO% -- bash -c "grep 'ServerName' /etc/apache2/sites-available/taler-merchant.conf || echo 'ServerName not found!'" + +REM Start Apache service +%WSL% -d %DISTRO% -- bash -c "sudo service apache2 start" + +REM Scheduled task (on next boot): Apache will start automatically +powershell -Command "Register-ScheduledTask -Action (New-ScheduledTaskAction -Execute '%WINDIR%\System32\wsl.exe' -Argument '-d %DISTRO% -- bash -c \"sudo service apache2 start && while true; do sleep 3600; done\"') -Trigger (New-ScheduledTaskTrigger -AtLogOn) -TaskName 'StartTalerApacheWSL' -User '$env:USERNAME' -RunLevel Highest -Force" + +echo. +echo GNU Taler-Merchant installed successfully! +timeout /t 5 /nobreak >nul +exit /b diff --git a/source/install-taler-basic.sh b/source/install-taler-basic.sh @@ -1,83 +0,0 @@ -#!/bin/bash -set -e -set -x - -# ✅ Mise à jour et installation des dépendances -sudo apt update -sudo apt install -y \ - build-essential \ - git \ - wget \ - pkg-config \ - libqrencode-dev \ - libsqlite3-dev \ - libltdl-dev \ - libunistring-dev \ - libsodium-dev \ - libargon2-dev \ - libcurl4-gnutls-dev \ - libgcrypt20-dev \ - libjansson-dev \ - libpq-dev \ - libmicrohttpd-dev \ - python3-jinja2 \ - postgresql \ - python3-pip \ - python3-sphinx-rtd-theme \ - autoconf \ - libtool \ - automake \ - dos2unix - -echo "✅ Dépendances installées" - -# 📁 Crée le dossier des sources -mkdir -p ~/taler-src && cd ~/taler-src - -# === 🌀 GNUnet === -wget https://ftp.gnu.org/gnu/gnunet/gnunet-0.21.0.tar.gz -tar -xzf gnunet-0.21.0.tar.gz -cd gnunet-0.21.0 -./configure --prefix=/usr/local -make -j$(nproc) -sudo make install -sudo ldconfig -cd .. - -# === 💰 taler-exchange === -wget https://ftp.gnu.org/gnu/taler/taler-exchange-0.14.5.tar.gz -tar -xzf taler-exchange-0.14.5.tar.gz -cd taler-exchange-0.14.5 -./configure --prefix=/usr/local --with-gnunet=/usr/local -make -j$(nproc) -sudo make install -sudo ldconfig -cd .. - -# === 🛍️ taler-merchant === -wget https://ftp.gnu.org/gnu/taler/taler-merchant-0.14.5.tar.gz -tar -xzf taler-merchant-0.14.5.tar.gz -cd taler-merchant-0.14.5 - -# ✅ Important : exporter les chemins vers les libs locales -export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig -export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH - -./configure --prefix=/usr/local --with-gnunet=/usr/local --with-exchange=/usr/local -make -j$(nproc) -sudo make install -cd .. - -# 📦 Rendez l'export LD_LIBRARY_PATH permanent -echo "✅ Mise à jour du LD_LIBRARY_PATH pour inclure /usr/local/lib" -if ! grep -q "LD_LIBRARY_PATH" ~/.bashrc; then - echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc -fi - -export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH -source ~/.bashrc - -# 🔄 Recharge le cache des bibliothèques -sudo ldconfig - -echo "🎉 GNU Taler (merchant, exchange, GNUnet) installé depuis les sources avec succès !" diff --git a/source/install-taler.sh b/source/install-taler.sh @@ -1,51 +0,0 @@ -#!/bin/bash - -set -e -set -x - -LOG_DIR="$PWD/logs" -mkdir -p "$LOG_DIR" -LOG_FILE="$LOG_DIR/install.log" -exec > "$LOG_FILE" 2>&1 - -PGURL_FILE="$PWD/pgurl.txt" -if [ ! -f "$PGURL_FILE" ]; then - echo "❌ Erreur : pgurl.txt introuvable" - exit 1 -fi - -PG_URL=$(cat "$PGURL_FILE") - -echo "📝 URL PostgreSQL : $PG_URL" - -echo "🔧 Configuration des miroirs Debian..." -sudo tee /etc/apt/sources.list > /dev/null <<EOF -deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware -deb http://security.debian.org/debian-security bookworm-security main -deb http://deb.debian.org/debian bookworm-updates main -EOF - -sudo apt update -sudo apt install -y wget gnupg lsb-release apt-transport-https ca-certificates postgresql - -echo "🔧 Ajout du dépôt GNU Taler..." -echo "deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/debian bookworm main" | sudo tee /etc/apt/sources.list.d/taler.list -sudo mkdir -p /etc/apt/keyrings -sudo wget -O /etc/apt/keyrings/taler-systems.gpg https://www.taler.net/taler-systems.gpg - -sudo apt update -sudo apt install -y taler-merchant - -echo "✅ Création du fichier merchant.conf" -mkdir -p ~/.config/taler -cat > ~/.config/taler/merchant.conf <<EOF -[merchantdb-postgres] -config = postgres - -[merchant] -MASTER_PUBLIC_KEY = TODO_GENERATE_THIS -DB = postgres -DB_POSTGRES_CONFIG = $PG_URL -EOF - -echo "🎉 Installation terminée avec succès." diff --git a/source/install-talerV1.sh b/source/install-talerV1.sh @@ -1,35 +0,0 @@ -#!/bin/bash -<<<<<<< HEAD - -set -e - -echo "=== GNU Taler Installer (merchant backend) ===" - -sudo mkdir -p /etc/apt/keyrings - -echo "Ajout du dépôt GNU Taler..." -echo "deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/debian bookworm main" | \ - sudo tee /etc/apt/sources.list.d/taler.list > /dev/null - -echo "Import de la clé de signature..." -sudo wget -O /etc/apt/keyrings/taler-systems.gpg https://taler.net/taler-systems.gpg - -echo "Mise à jour de la liste des paquets..." -sudo apt update - -echo "Installation de taler-merchant..." -sudo apt install -y taler-merchant - -echo "✅ Installation terminée." - -======= -set -e - -echo "==============================" -echo "✅ Script bien exécuté !" -echo "==============================" - -echo "Installation en cours..." -sleep 1 -echo "☑️ Tout s'est bien passé." ->>>>>>> d43d770 (Ajout du script NSIS + installeur automatique) diff --git a/source/logs/install.log b/source/logs/install.log @@ -1,94 +0,0 @@ -+ echo '=== Étape 0 : Configuration des miroirs Debian ===' -=== Étape 0 : Configuration des miroirs Debian === -+ sudo tee /etc/apt/sources.list -+ echo '=== Étape 1/5 : Mise à jour des paquets ===' -=== Étape 1/5 : Mise à jour des paquets === -+ sudo apt update - -WARNING: apt does not have a stable CLI interface. Use with caution in scripts. - -Hit:1 http://security.debian.org/debian-security bookworm-security InRelease -Hit:2 http://deb.debian.org/debian bookworm InRelease -Hit:3 http://deb.debian.org/debian bookworm-updates InRelease -Get:4 https://deb.taler.net/apt/debian bookworm InRelease [1,639 B] -Fetched 1,639 B in 0s (4,033 B/s) -Reading package lists... -Building dependency tree... -Reading state information... -4 packages can be upgraded. Run 'apt list --upgradable' to see them. -+ echo '=== Étape 2/5 : Installation des outils GNU Taler ===' -=== Étape 2/5 : Installation des outils GNU Taler === -+ sudo apt install -y wget gnupg lsb-release apt-transport-https ca-certificates - -WARNING: apt does not have a stable CLI interface. Use with caution in scripts. - -Reading package lists... -Building dependency tree... -Reading state information... -wget is already the newest version (1.21.3-1+deb12u1). -gnupg is already the newest version (2.2.40-1.1). -lsb-release is already the newest version (12.0-1). -apt-transport-https is already the newest version (2.6.1). -ca-certificates is already the newest version (20230311). -0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. -+ sudo mkdir -p /etc/apt/keyrings -+ echo 'Ajout du dépôt GNU Taler...' -Ajout du dépôt GNU Taler... -+ echo 'deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/debian bookworm main' -+ sudo tee /etc/apt/sources.list.d/taler.list -+ echo 'Import de la clé de signature...' -Import de la clé de signature... -+ sudo wget -O /etc/apt/keyrings/taler-systems.gpg https://taler.net/taler-systems.gpg ---2025-04-14 15:16:18-- https://taler.net/taler-systems.gpg -Resolving taler.net (taler.net)... 193.5.87.218, 193.5.87.219, 2001:620:500:464::218, ... -Connecting to taler.net (taler.net)|193.5.87.218|:443... connected. -HTTP request sent, awaiting response... 301 Moved Permanently -Location: https://www.taler.net/taler-systems.gpg [following] ---2025-04-14 15:16:18-- https://www.taler.net/taler-systems.gpg -Resolving www.taler.net (www.taler.net)... 193.5.87.218, 193.5.87.219, 2001:620:500:464::218, ... -Connecting to www.taler.net (www.taler.net)|193.5.87.218|:443... connected. -HTTP request sent, awaiting response... 200 OK -Length: 1756 (1.7K) [application/octet-stream] -Saving to: ‘/etc/apt/keyrings/taler-systems.gpg’ - - 0K . 100% 20.8M=0s - -2025-04-14 15:16:18 (20.8 MB/s) - ‘/etc/apt/keyrings/taler-systems.gpg’ saved [1756/1756] - -+ echo '=== Étape 3/5 : Mise à jour après ajout du dépôt ===' -=== Étape 3/5 : Mise à jour après ajout du dépôt === -+ sudo apt update - -WARNING: apt does not have a stable CLI interface. Use with caution in scripts. - -Hit:1 http://deb.debian.org/debian bookworm InRelease -Hit:2 http://security.debian.org/debian-security bookworm-security InRelease -Hit:3 http://deb.debian.org/debian bookworm-updates InRelease -Get:4 https://deb.taler.net/apt/debian bookworm InRelease [1,639 B] -Fetched 1,639 B in 0s (4,421 B/s) -Reading package lists... -Building dependency tree... -Reading state information... -4 packages can be upgraded. Run 'apt list --upgradable' to see them. -+ echo '=== Étape 4/5 : Installation de GNU Taler (merchant) et PostgreSQL ===' -=== Étape 4/5 : Installation de GNU Taler (merchant) et PostgreSQL === -+ sudo apt install -y postgresql taler-merchant - -WARNING: apt does not have a stable CLI interface. Use with caution in scripts. - -Reading package lists... -Building dependency tree... -Reading state information... -postgresql is already the newest version (15+248). -taler-merchant is already the newest version (0.14.9). -0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. -+ echo '=== Étape 5/5 : Configuration de PostgreSQL ===' -=== Étape 5/5 : Configuration de PostgreSQL === -+ SCRIPT_PATH=/mnt/c/Users/Lea_w/Desktop/taler-windows/source/setup_postgresql.sh -+ '[' -f /mnt/c/Users/Lea_w/Desktop/taler-windows/source/setup_postgresql.sh ']' -+ bash /mnt/c/Users/Lea_w/Desktop/taler-windows/source/setup_postgresql.sh -+ VARS_FILE=/mnt/c/Users/Lea_w/AppData/Local/Taler_Merchant/pgvars.txt -+ '[' '!' -f /mnt/c/Users/Lea_w/AppData/Local/Taler_Merchant/pgvars.txt ']' -+ echo '❌ Erreur : Fichier pgvars.txt introuvable à l'\''emplacement attendu : /mnt/c/Users/Lea_w/AppData/Local/Taler_Merchant/pgvars.txt' -❌ Erreur : Fichier pgvars.txt introuvable à l'emplacement attendu : /mnt/c/Users/Lea_w/AppData/Local/Taler_Merchant/pgvars.txt -+ exit 1 diff --git a/source/setup_postgresql.sh b/source/setup_postgresql.sh @@ -1,50 +0,0 @@ -Var DB_URL -Var LINUX_DIR - -Page custom dbURLPageCreate dbURLPageLeave - -Function dbURLPageCreate - nsDialogs::Create 1018 - Pop $0 - ${NSD_CreateLabel} 0 0 100% 12u "Entrez votre URL de connexion PostgreSQL (ex: postgresql://user:pass@localhost:5432/dbname) :" - Pop $1 - ${NSD_CreateText} 0 15u 100% 12u "" - Pop $DB_URL - nsDialogs::Show -FunctionEnd - -Function dbURLPageLeave - SetOutPath "$INSTDIR" - FileOpen $0 "$INSTDIR\pgurl.txt" "w" - FileWrite $0 "$DB_URL$\n" - FileClose $0 - DetailPrint "✅ URL PostgreSQL enregistrée dans pgurl.txt" -FunctionEnd - -Section "Installation GNU Taler" - SetOutPath "$INSTDIR" - File "..\source\install-talerV1.sh" - - nsExec::ExecToStack 'wsl -d Debian dos2unix /mnt/c/Users/Lea_w/Desktop/taler-windows/source/install-talerV1.sh' - nsExec::ExecToStack 'wsl -d Debian wslpath "$INSTDIR"' - Pop $0 - StrCpy $LINUX_DIR $0 - - nsExec::ExecToStack '"$WINDIR\Sysnative\wsl.exe" -d Debian echo OK' - Pop $0 - ${If} $0 != 0 - MessageBox MB_ICONSTOP "❌ WSL non reconnu, installation annulée." - Abort - ${EndIf} - - DetailPrint "➡️ Lancement installation avec URL personnalisée..." - nsExec::ExecToStack 'wsl -d Debian bash "$LINUX_DIR/install-talerV1.sh"' - Pop $1 - Pop $0 - - ${If} $0 == 0 - MessageBox MB_ICONINFORMATION "✅ Installation réussie !" - ${Else} - MessageBox MB_ICONSTOP "❌ Erreur pendant l’installation. Code : $0" - ${EndIf} -SectionEnd diff --git a/taler-installer-taler.nsi b/taler-installer-taler.nsi @@ -1,21 +1,302 @@ -!define APP_NAME "GNU Taler Installer" +; This file is part of GNU Taler. +; Copyright (C) 2025 Taler Systems SA +; +; TALER is free software; you can redistribute it and/or modify it under the +; terms of the GNU Lesser General Public License as published by the Free Software +; Foundation; either version 2.1, or (at your option) any later version. +; +; TALER is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +; A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +; +; You should have received a copy of the GNU Lesser General Public License along with +; TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +; +; Author: Léa Oualli + +Unicode true + +!include "MUI2.nsh" +!include "LogicLib.nsh" +!include "FileFunc.nsh" +!include "WinMessages.nsh" +!include "nsDialogs.nsh" + +!define MUI_ABORTWARNING +!define MUI_LANGDLL_DISPLAY +!define MUI_LANGDLL_REGISTRY_ROOT "HKCU" +!define MUI_LANGDLL_REGISTRY_KEY "Software\TalerInstaller" +!define MUI_LANGDLL_REGISTRY_VALUENAME "InstallerLanguage" + +Name "Taler-Merchant backend" Outfile "taler-installer.exe" -InstallDir "$PROGRAMFILES\TalerInstaller" +InstallDir "$PROGRAMFILES\TalerMerchant" RequestExecutionLevel admin -Page directory -Page instfiles +Icon "logo-header.ico" +!define MUI_ICON "logo-header.ico" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_RIGHT +!define MUI_HEADERIMAGE_BITMAP "logo-header.bmp" +!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH +!define MUI_WELCOMEFINISHPAGE_BITMAP "logo-welcome.bmp" + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_DIRECTORY +Page custom DistroPage DistroPageLeave +Page custom DomainPage DomainPageLeave +Page custom ReverseProxyPage ReverseProxyPageLeave +!insertmacro MUI_PAGE_INSTFILES + +; -------- LangString FINISH_LINK ici, UNE SEULE FOIS ------------ +LangString MSG_FINISH_LINK 1033 "Open merchant web interface after installation" +LangString MSG_FINISH_LINK 1036 "Ouvrir l'interface web du marchand apres l'installation" + +!define MUI_FINISHPAGE_SHOWREADME +!define MUI_FINISHPAGE_SHOWREADME_FUNCTION OpenBrowser +!define MUI_FINISHPAGE_SHOWREADME_TEXT "$(MSG_FINISH_LINK)" +!insertmacro MUI_PAGE_FINISH +; --------------------------------------------------------------- + +!insertmacro MUI_LANGUAGE "English" +!insertmacro MUI_LANGUAGE "French" + +Var /GLOBAL HWND_PROGRESS_LABEL +Var /GLOBAL DOMAIN_INPUT +Var /GLOBAL WSL_DISTRO +Var /GLOBAL RADIO_DEBIAN +Var /GLOBAL RADIO_UBUNTU +Var /GLOBAL REVERSE_PROXY_MODE +Var /GLOBAL RADIO_HTTP_ONLY +Var /GLOBAL RADIO_HTTPS + +LangString MSG_WELCOME_TITLE ${LANG_ENGLISH} "GNU Taler-Merchant backend for Windows" +LangString MSG_WELCOME_TITLE ${LANG_FRENCH} "Backend GNU Taler-Merchant pour Windows" + +LangString MSG_WELCOME_TEXT ${LANG_ENGLISH} "This wizard will install GNU Taler-Merchant using WSL and Debian or Ubuntu." +LangString MSG_WELCOME_TEXT ${LANG_FRENCH} "Cet assistant va installer GNU Taler-Merchant avec WSL et Debian ou Ubuntu." + +LangString ENTER_DOMAIN ${LANG_ENGLISH} "Enter the domain name:" +LangString ENTER_DOMAIN ${LANG_FRENCH} "Entrez le nom de domaine :" + +LangString MSG_DOMAIN_REQUIRED ${LANG_ENGLISH} "Please enter a domain name." +LangString MSG_DOMAIN_REQUIRED ${LANG_FRENCH} "Veuillez saisir un nom de domaine." + +LangString MSG_LOCALHOST_WARN ${LANG_ENGLISH} "Warning: using 'localhost' means your merchant will not be publicly accessible." +LangString MSG_LOCALHOST_WARN ${LANG_FRENCH} "Attention : utiliser 'localhost' signifie que votre marchand ne sera pas accessible publiquement." + +LangString MSG_STEP1 ${LANG_ENGLISH} "Step 1: Enabling WSL and VirtualMachinePlatform.$\r$\n$\r$\nThis is the slowest step and can take several minutes (up to 10 minutes on some computers).$\r$\n$\r$\nPlease DO NOT close the installer. You will see the progress bar freeze during this step.$\r$\n$\r$\nThe installation will continue automatically once this step is done." +LangString MSG_STEP1 ${LANG_FRENCH} "Etape 1 : Activation de WSL et VirtualMachinePlatform.$\r$\n$\r$\nC'est l'etape la plus lente et cela peut prendre plusieurs minutes (jusqu'a 10 minutes sur certains ordinateurs).$\r$\n$\r$\nVeuillez NE PAS fermer l'installateur. La barre de progression peut sembler bloquee.$\r$\n$\r$\nL'installation continuera automatiquement des que cette etape sera terminee." + +LangString MSG_NEED_REBOOT ${LANG_ENGLISH} "WSL features have just been enabled. You must restart your computer NOW to continue the installation. Please run this installer again after reboot." +LangString MSG_NEED_REBOOT ${LANG_FRENCH} "Les fonctionnalites WSL viennent d'etre activees. Vous devez redemarrer votre ordinateur MAINTENANT pour poursuivre l'installation. Relancez cet installateur apres redemarrage." + +LangString MSG_UPDATE_WSL ${LANG_ENGLISH} "A Windows update window will now appear to update WSL. Please follow the instructions in the black window and press any key if prompted. Click OK to continue." +LangString MSG_UPDATE_WSL ${LANG_FRENCH} "Une fenetre de mise a jour Windows va apparaitre pour mettre a jour WSL. Suivez les instructions et appuyez sur une touche si demande. Cliquez sur OK pour continuer." + +LangString MSG_INSTALL_FAILED ${LANG_ENGLISH} "Installation failed. Opening install.log..." +LangString MSG_INSTALL_FAILED ${LANG_FRENCH} "L'installation a echoue. Ouverture du fichier install.log..." + +; Reverse proxy (HTTPS/HTTP) texts +LangString MSG_REVERSE_PROXY_TITLE ${LANG_ENGLISH} "Select reverse proxy mode:" +LangString MSG_REVERSE_PROXY_TITLE ${LANG_FRENCH} "Choisissez le mode du reverse proxy :" + +LangString MSG_HTTP_ONLY ${LANG_ENGLISH} "HTTP only" +LangString MSG_HTTP_ONLY ${LANG_FRENCH} "HTTP uniquement" + +LangString MSG_HTTPS ${LANG_ENGLISH} "HTTPS with Let's Encrypt " +LangString MSG_HTTPS ${LANG_FRENCH} "HTTPS avec Let's Encrypt " + +; ----------- NE PAS REMETTRE MSG_FINISH_LINK ICI ! ------------- + +Function DistroPage + nsDialogs::Create 1018 + Pop $0 + ${If} $0 == error + Abort + ${EndIf} + ${NSD_CreateLabel} 0 10u 100% 12u "Choose the WSL Linux distribution to install:" + Pop $0 + ${NSD_CreateRadioButton} 0 30u 100% 12u "Debian" + Pop $RADIO_DEBIAN + ${NSD_CreateRadioButton} 0 45u 100% 12u "Ubuntu" + Pop $RADIO_UBUNTU + ; Debian par défaut sélectionné + ${NSD_SetState} $RADIO_DEBIAN 1 + nsDialogs::Show +FunctionEnd + +Function DistroPageLeave + ${NSD_GetState} $RADIO_DEBIAN $0 + ${If} $0 == 1 + StrCpy $WSL_DISTRO "Debian" + ${EndIf} + ${NSD_GetState} $RADIO_UBUNTU $0 + ${If} $0 == 1 + StrCpy $WSL_DISTRO "Ubuntu" + ${EndIf} + ${If} $WSL_DISTRO == "" + StrCpy $WSL_DISTRO "Debian" + ${EndIf} +FunctionEnd -Section "Install GNU Taler via WSL" - SetOutPath "$INSTDIR" +Function DomainPage + nsDialogs::Create 1018 + Pop $0 + ${If} $0 == error + Abort + ${EndIf} + ${NSD_CreateLabel} 0 10u 100% 12u $(ENTER_DOMAIN) + Pop $0 + ${NSD_CreateText} 0 25u 100% 12u "" + Pop $DOMAIN_INPUT + nsDialogs::Show +FunctionEnd - ; Copie les fichiers nécessaires - File "setup-wsl-debian.bat" - File "install-taler-from-apt.sh" +Function DomainPageLeave + ${NSD_GetText} $DOMAIN_INPUT $0 + ${If} $0 == "" + MessageBox MB_OK|MB_ICONEXCLAMATION $(MSG_DOMAIN_REQUIRED) + Abort + ${EndIf} + ${If} $0 == "localhost" + MessageBox MB_OK $(MSG_LOCALHOST_WARN) + ${EndIf} + StrCpy $DOMAIN_INPUT $0 +FunctionEnd - ; Lance le script BAT qui gère tout (WSL, Debian, script .sh) - ExecWait '"$INSTDIR\setup-wsl-debian.bat"' +Function ReverseProxyPage + nsDialogs::Create 1018 + Pop $0 + ${If} $0 == error + Abort + ${EndIf} + ${NSD_CreateLabel} 0 10u 100% 12u $(MSG_REVERSE_PROXY_TITLE) + Pop $0 + ${NSD_CreateRadioButton} 0 30u 100% 12u $(MSG_HTTP_ONLY) + Pop $RADIO_HTTP_ONLY + ${NSD_CreateRadioButton} 0 45u 100% 12u $(MSG_HTTPS) + Pop $RADIO_HTTPS + ${NSD_SetState} $RADIO_HTTPS 1 + nsDialogs::Show +FunctionEnd - ; Affiche un message de fin - MessageBox MB_ICONINFORMATION|MB_OK "🎉 GNU Taler a été installé avec succès ! Consultez le fichier C:\Users\Public\install.log pour les détails." +Function ReverseProxyPageLeave + ${NSD_GetState} $RADIO_HTTP_ONLY $0 + ${If} $0 == 1 + StrCpy $REVERSE_PROXY_MODE "HTTP" + ${EndIf} + ${NSD_GetState} $RADIO_HTTPS $0 + ${If} $0 == 1 + StrCpy $REVERSE_PROXY_MODE "HTTPS" + ${EndIf} + ${If} $REVERSE_PROXY_MODE == "" + StrCpy $REVERSE_PROXY_MODE "HTTPS" + ${EndIf} +FunctionEnd + +Section "Install Taler-Merchant" + SetOutPath "$INSTDIR" + SetDetailsView show + File "setup-wsl-debian.bat" + File "install-taler-from-apt.sh" + + FindWindow $0 "#32770" "" $HWNDPARENT + GetDlgItem $HWND_PROGRESS_LABEL $0 1006 + + DetailPrint "---------------------------------------------------------" + DetailPrint "[1/8] Enabling WSL and VirtualMachinePlatform..." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 5%" + Sleep 2000 + + MessageBox MB_OK|MB_ICONINFORMATION $(MSG_STEP1) + + DetailPrint "[INFO] This is the slowest step. Please be patient." + DetailPrint "[INFO] Enabling Windows features can take several minutes (up to 5-10 minutes on some computers)." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 8%" + Sleep 5000 + + DetailPrint "[INFO] Do NOT close the installer. The process will continue automatically." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 12%" + Sleep 5000 + + DetailPrint "[INFO] Windows is still enabling the required features..." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 16%" + Sleep 5000 + + DetailPrint "[INFO] This is normal. Please wait, your system is working in the background." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 20%" + Sleep 5000 + + nsExec::ExecToLog '"$INSTDIR\setup-wsl-debian.bat" 1 "" $WSL_DISTRO' + Pop $0 + ${If} $0 != 0 + MessageBox MB_OK $(MSG_NEED_REBOOT) + Quit + ${EndIf} + + MessageBox MB_OK $(MSG_UPDATE_WSL) + + DetailPrint "[INFO] WSL and VirtualMachinePlatform are enabled. Checking for WSL updates..." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 30%" + DetailPrint "NOTICE: A black window may appear for the WSL update. If it does, simply press any key when prompted." + Sleep 1000 + + DetailPrint "[2/8] Installing $WSL_DISTRO..." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 35%" + Sleep 1000 + + DetailPrint "[3/8] Creating $WSL_DISTRO user..." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 45%" + Sleep 1000 + + DetailPrint "[4/8] Adding user to www-data group..." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 55%" + Sleep 1000 + + DetailPrint "[5/8] Copying installer script..." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 60%" + Sleep 1000 + + DetailPrint "[6/8] Converting script format and setting permissions..." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 65%" + Sleep 1000 + + DetailPrint "[7/8] Restarting WSL and launching installation..." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 70%" + nsExec::ExecToLog '"$INSTDIR\setup-wsl-debian.bat" ALL "" $WSL_DISTRO' + + DetailPrint "[8/8] Configuring reverse proxy for $DOMAIN_INPUT in $REVERSE_PROXY_MODE mode..." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 80%" + nsExec::ExecToLog '"$INSTDIR\setup-wsl-debian.bat" 8 $DOMAIN_INPUT $WSL_DISTRO $REVERSE_PROXY_MODE' + + DetailPrint "Testing access to merchant reverse proxy..." + nsExec::ExecToLog 'wsl -d $WSL_DISTRO -- bash -c "curl -v http://localhost"' + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 85%" + Sleep 2000 + + DetailPrint "Checking passed domain in $WSL_DISTRO..." + nsExec::ExecToLog 'wsl -d $WSL_DISTRO -- bash -c "echo Received domain: '\''$DOMAIN_INPUT'\''"' + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 90%" + Sleep 2000 + + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 99%" + Sleep 1000 + DetailPrint "Installation complete." + SendMessage $HWND_PROGRESS_LABEL ${WM_SETTEXT} 0 "STR:Progress: 100%" + + CreateShortCut "$SMPROGRAMS\Taler-Merchant.lnk" "$INSTDIR\taler-installer.exe" SectionEnd + +Function OpenBrowser + ${If} $REVERSE_PROXY_MODE == "HTTPS" + ExecShell "open" "https://$DOMAIN_INPUT" + ${Else} + ExecShell "open" "http://$DOMAIN_INPUT" + ${EndIf} +FunctionEnd + +Function .onInstFailed + MessageBox MB_OK $(MSG_INSTALL_FAILED) + ExecShell "open" "C:\Users\Public\install.log" +FunctionEnd diff --git a/taler-installer.exe b/taler-installer.exe Binary files differ. diff --git a/taler-installer.nsi b/taler-installer.nsi @@ -1,14 +0,0 @@ -!define APP_NAME "GNU Taler Installer" -Outfile "taler-installer.exe" -InstallDir "$PROGRAMFILES\TalerInstaller" -RequestExecutionLevel admin - -Page directory -Page instfiles - -Section "Install WSL & Debian" - SetOutPath "$INSTDIR" - File "setup-wsl-debian.bat" - ExecWait '"$INSTDIR\setup-wsl-debian.bat"' - MessageBox MB_ICONINFORMATION|MB_OK "Installation WSL Debian terminée avec succès !" -SectionEnd