commit 0594995c4c59174c32a9c4af72a4b237d6b14958 parent 243e3c2d7fac82a53e99daf9961049ea2495b859 Author: Lea <lea.oualli@outlook.fr> Date: Tue, 22 Apr 2025 18:16:02 +0200 Ajout du script NSIS + installeur automatique Diffstat:
| M | Merchant client/install-talerV1.bat | | | 5 | +++++ |
| A | NSIS/GNU-Taler-Minimal-Setup.exe | | | 0 | |
| A | NSIS/GNU-Taler-Minimal.exe | | | 0 | |
| A | NSIS/GNU-Taler-Test.exe | | | 0 | |
| A | NSIS/Install_taler_design.nsi | | | 69 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | NSIS/Install_taler_postgress.nsi | | | 132 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | NSIS/Install_taler_postgressV2.nsi | | | 48 | ++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | NSIS/Install_taler_proxy.nsi | | | 177 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | NSIS/Minimal-Taler-Installer.exe | | | 0 | |
| A | NSIS/Taler-Minimal-Setup.exe | | | 0 | |
| A | NSIS/TalerMinimalInstaller.exe | | | 0 | |
| A | NSIS/install_taler_before-design.nsi | | | 24 | ++++++++++++++++++++++++ |
| A | NSIS/logo-header.bmp | | | 0 | |
| A | NSIS/logo-header.ico | | | 0 | |
| A | NSIS/logo-welcome.bmp | | | 0 | |
| M | Procedure/README.md | | | 62 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | install-taler-from-apt.sh | | | 38 | ++++++++++++++++++++++++++++++++++++++ |
| A | run-admin.bat | | | 2 | ++ |
| A | setup-wsl-debian.bat | | | 47 | +++++++++++++++++++++++++++++++++++++++++++++++ |
| A | source/install-taler-basic.sh | | | 83 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | source/install-taler.sh | | | 51 | +++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | source/install-talerV1.sh | | | 12 | ++++++++++++ |
| A | source/logs/install.log | | | 94 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | source/setup_postgresql.sh | | | 50 | ++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | taler-installer-taler.nsi | | | 21 | +++++++++++++++++++++ |
| A | taler-installer.exe | | | 0 | |
| A | taler-installer.nsi | | | 14 | ++++++++++++++ |
27 files changed, 929 insertions(+), 0 deletions(-)
diff --git a/Merchant client/install-talerV1.bat b/Merchant client/install-talerV1.bat @@ -1,4 +1,5 @@ @echo off +<<<<<<< HEAD setlocal echo === Lancement de l'installation de GNU Taler via WSL === @@ -8,4 +9,8 @@ wsl -d Debian -- bash /mnt/c/Users/%USERNAME%/taler-windows/source/install-taler 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 @@ -0,0 +1,69 @@ +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 @@ -0,0 +1,132 @@ +; ============================= +; 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 @@ -0,0 +1,48 @@ +!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 @@ -0,0 +1,177 @@ +; ============================= +; 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_taler_before-design.nsi b/NSIS/install_taler_before-design.nsi @@ -0,0 +1,24 @@ +!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-header.ico b/NSIS/logo-header.ico Binary files differ. diff --git a/NSIS/logo-welcome.bmp b/NSIS/logo-welcome.bmp Binary files differ. diff --git a/Procedure/README.md b/Procedure/README.md @@ -1 +1,63 @@ "# 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 @@ -0,0 +1,38 @@ +#!/bin/bash +set -e +set -x +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 + +# Créer le dossier keyrings si besoin +sudo mkdir -p /etc/apt/keyrings + +# 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 + +# Importer la clé publique de Taler Systems +sudo wget -O /etc/apt/keyrings/taler-systems.gpg https://taler.net/taler-systems.gpg + +# Mettre à jour les paquets +sudo apt update + +# Installer taler-merchant +sudo apt install -y taler-merchant + +echo "✅ GNU Taler installé avec succès !" | tee ~/taler-installer/install.log + +echo "🔧 Activation du service taler-merchant-httpd..." +sudo systemctl enable taler-merchant-httpd +sudo systemctl enable taler-merchant-httpd.socket + +echo "🚀 Démarrage du socket taler-merchant..." +sudo systemctl start taler-merchant-httpd.socket + +echo "📋 Statut du service taler-merchant-httpd :" +sudo systemctl status taler-merchant-httpd --no-pager | tee -a ~/taler-installer/install.log + + + diff --git a/run-admin.bat b/run-admin.bat @@ -0,0 +1,2 @@ +@echo off +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 @@ -0,0 +1,47 @@ +@echo off +setlocal enabledelayedexpansion + +set WSL=%WINDIR%\Sysnative\wsl.exe +set WSL_USER=taleruser + +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" + +echo [2/6] Installation de Debian... +%WSL% --install -d Debian + +echo Attente de l'installation complète... +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)" + +:: Copie du script dans le dossier temporaire Windows +echo [4/6] Préparation du script d'installation... +copy /Y "%~dp0install-taler-from-apt.sh" "%TEMP%\install-taler-from-apt.sh" + +:: 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" + +:: 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" + +:: 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" + +:: Copie du log sur Windows +%WSL% -d Debian -u %WSL_USER% -- bash -c "cp ~/taler-installer/install.log /mnt/c/Users/Public/install.log" + +echo ✅ GNU Taler installé avec succès ! + +:: Garde la fenêtre ouverte pour voir les messages +pause +exit /b + diff --git a/source/install-taler-basic.sh b/source/install-taler-basic.sh @@ -0,0 +1,83 @@ +#!/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 @@ -0,0 +1,51 @@ +#!/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,4 +1,5 @@ #!/bin/bash +<<<<<<< HEAD set -e @@ -21,3 +22,14 @@ 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 @@ -0,0 +1,94 @@ ++ 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 @@ -0,0 +1,50 @@ +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 @@ -0,0 +1,21 @@ +!define APP_NAME "GNU Taler Installer" +Outfile "taler-installer.exe" +InstallDir "$PROGRAMFILES\TalerInstaller" +RequestExecutionLevel admin + +Page directory +Page instfiles + +Section "Install GNU Taler via WSL" + SetOutPath "$INSTDIR" + + ; Copie les fichiers nécessaires + File "setup-wsl-debian.bat" + File "install-taler-from-apt.sh" + + ; Lance le script BAT qui gère tout (WSL, Debian, script .sh) + ExecWait '"$INSTDIR\setup-wsl-debian.bat"' + + ; 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." +SectionEnd diff --git a/taler-installer.exe b/taler-installer.exe Binary files differ. diff --git a/taler-installer.nsi b/taler-installer.nsi @@ -0,0 +1,14 @@ +!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