[ADD] build: create_exe.sh, the Windows executable from Linux
Building the portable executable was reachable only through make windows.
create_exe.sh is the standalone entry point, next to run.sh and install.sh:
it runs scripts/construire_windows.sh through avec_node, so under the
project's Node, and refuses on Windows and macOS, where the build does not
run. make windows now calls it, so both share one path. The installation
test guards its shebang, exec bit and shared library. Checked: --help,
bad option (2), macOS refusal (1), existing-executable refusal; node 5173.
--- FR ---
[ADD] construction : create_exe.sh, l'exécutable Windows depuis Linux
L'exécutable portable ne se construisait que par make windows. create_exe.sh
en est le point d'entrée autonome, à côté de run.sh et install.sh : il lance
scripts/construire_windows.sh par avec_node, donc sous le Node du projet, et
refuse sous Windows et macOS, où la construction ne se fait pas. make
windows passe désormais par lui. L'épreuve d'installation garde son shebang,
son bit d'exécution et la bibliothèque commune. Vérifié : --help, option
inconnue (2), refus macOS (1), refus d'un exécutable existant ; node 5173.
Assisted-by: Claude Opus 5.5
2026-10-14 00:22:33 -04:00
#!/usr/bin/env bash
# © 2026 TechnoLibre (http://www.technolibre.ca)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
# Construit l'exécutable Windows portable depuis Linux (§ 16) : la page en
# mode livraison sur l'hôte, puis electron-builder sous podman, par
# scripts/construire_windows.sh, le Node du projet en tête du PATH. Il sort
# dans dist-electron/, nommé d'après version.json ; make windows passe ici.
#
[IMP] create_exe.sh: ask before overwriting this version's executable
An existing executable for the current version stopped the build with a
refusal, and the only way past it was to rerun with --reconstruire. The
script now asks [o/N] first: yes rebuilds it, anything else keeps it and
stops. Without a terminal the answer is no, so a script or a pipe never
overwrites a binary by accident; --reconstruire and GTT_OUI=1 skip the
question. Checked in a terminal against a stub build: n keeps (1), o and
y pass --reconstruire (0), no terminal keeps (1), absent builds directly.
--- FR ---
[IMP] create_exe.sh : demander avant d'écraser l'exécutable de la version
Un exécutable déjà construit pour la version arrêtait la construction sur
un refus, qu'on ne levait qu'en relançant avec --reconstruire. Le script
demande désormais [o/N] : oui le reconstruit, toute autre réponse le garde
et s'arrête. Sans terminal, la réponse est non : un script ou un tube
n'écrase jamais un binaire par mégarde ; --reconstruire et GTT_OUI=1 sautent
la question. Vérifié en terminal, construction remplacée par un témoin :
n garde (1), o et y passent --reconstruire (0), sans terminal garde (1).
Assisted-by: Claude Opus 5.5
2026-10-14 00:38:52 -04:00
# ./create_exe.sh demande avant d'écraser l'exécutable de la version
# ./create_exe.sh --reconstruire l'écrase sans demander
#
# Sans terminal, la question reçoit « non » : l'exécutable existant reste, sauf
# sous --reconstruire ou GTT_OUI=1.
[ADD] build: create_exe.sh, the Windows executable from Linux
Building the portable executable was reachable only through make windows.
create_exe.sh is the standalone entry point, next to run.sh and install.sh:
it runs scripts/construire_windows.sh through avec_node, so under the
project's Node, and refuses on Windows and macOS, where the build does not
run. make windows now calls it, so both share one path. The installation
test guards its shebang, exec bit and shared library. Checked: --help,
bad option (2), macOS refusal (1), existing-executable refusal; node 5173.
--- FR ---
[ADD] construction : create_exe.sh, l'exécutable Windows depuis Linux
L'exécutable portable ne se construisait que par make windows. create_exe.sh
en est le point d'entrée autonome, à côté de run.sh et install.sh : il lance
scripts/construire_windows.sh par avec_node, donc sous le Node du projet, et
refuse sous Windows et macOS, où la construction ne se fait pas. make
windows passe désormais par lui. L'épreuve d'installation garde son shebang,
son bit d'exécution et la bibliothèque commune. Vérifié : --help, option
inconnue (2), refus macOS (1), refus d'un exécutable existant ; node 5173.
Assisted-by: Claude Opus 5.5
2026-10-14 00:22:33 -04:00
set -euo pipefail
cd -- " $( dirname -- " $0 " ) "
. scripts/installation/commun.sh
[IMP] create_exe.sh: ask before overwriting this version's executable
An existing executable for the current version stopped the build with a
refusal, and the only way past it was to rerun with --reconstruire. The
script now asks [o/N] first: yes rebuilds it, anything else keeps it and
stops. Without a terminal the answer is no, so a script or a pipe never
overwrites a binary by accident; --reconstruire and GTT_OUI=1 skip the
question. Checked in a terminal against a stub build: n keeps (1), o and
y pass --reconstruire (0), no terminal keeps (1), absent builds directly.
--- FR ---
[IMP] create_exe.sh : demander avant d'écraser l'exécutable de la version
Un exécutable déjà construit pour la version arrêtait la construction sur
un refus, qu'on ne levait qu'en relançant avec --reconstruire. Le script
demande désormais [o/N] : oui le reconstruit, toute autre réponse le garde
et s'arrête. Sans terminal, la réponse est non : un script ou un tube
n'écrase jamais un binaire par mégarde ; --reconstruire et GTT_OUI=1 sautent
la question. Vérifié en terminal, construction remplacée par un témoin :
n garde (1), o et y passent --reconstruire (0), sans terminal garde (1).
Assisted-by: Claude Opus 5.5
2026-10-14 00:38:52 -04:00
reconstruire = 0
[ADD] build: create_exe.sh, the Windows executable from Linux
Building the portable executable was reachable only through make windows.
create_exe.sh is the standalone entry point, next to run.sh and install.sh:
it runs scripts/construire_windows.sh through avec_node, so under the
project's Node, and refuses on Windows and macOS, where the build does not
run. make windows now calls it, so both share one path. The installation
test guards its shebang, exec bit and shared library. Checked: --help,
bad option (2), macOS refusal (1), existing-executable refusal; node 5173.
--- FR ---
[ADD] construction : create_exe.sh, l'exécutable Windows depuis Linux
L'exécutable portable ne se construisait que par make windows. create_exe.sh
en est le point d'entrée autonome, à côté de run.sh et install.sh : il lance
scripts/construire_windows.sh par avec_node, donc sous le Node du projet, et
refuse sous Windows et macOS, où la construction ne se fait pas. make
windows passe désormais par lui. L'épreuve d'installation garde son shebang,
son bit d'exécution et la bibliothèque commune. Vérifié : --help, option
inconnue (2), refus macOS (1), refus d'un exécutable existant ; node 5173.
Assisted-by: Claude Opus 5.5
2026-10-14 00:22:33 -04:00
for argument in " $@ " ; do
case " $argument " in
[IMP] create_exe.sh: ask before overwriting this version's executable
An existing executable for the current version stopped the build with a
refusal, and the only way past it was to rerun with --reconstruire. The
script now asks [o/N] first: yes rebuilds it, anything else keeps it and
stops. Without a terminal the answer is no, so a script or a pipe never
overwrites a binary by accident; --reconstruire and GTT_OUI=1 skip the
question. Checked in a terminal against a stub build: n keeps (1), o and
y pass --reconstruire (0), no terminal keeps (1), absent builds directly.
--- FR ---
[IMP] create_exe.sh : demander avant d'écraser l'exécutable de la version
Un exécutable déjà construit pour la version arrêtait la construction sur
un refus, qu'on ne levait qu'en relançant avec --reconstruire. Le script
demande désormais [o/N] : oui le reconstruit, toute autre réponse le garde
et s'arrête. Sans terminal, la réponse est non : un script ou un tube
n'écrase jamais un binaire par mégarde ; --reconstruire et GTT_OUI=1 sautent
la question. Vérifié en terminal, construction remplacée par un témoin :
n garde (1), o et y passent --reconstruire (0), sans terminal garde (1).
Assisted-by: Claude Opus 5.5
2026-10-14 00:38:52 -04:00
--reconstruire) reconstruire = 1 ; ;
[ADD] build: create_exe.sh, the Windows executable from Linux
Building the portable executable was reachable only through make windows.
create_exe.sh is the standalone entry point, next to run.sh and install.sh:
it runs scripts/construire_windows.sh through avec_node, so under the
project's Node, and refuses on Windows and macOS, where the build does not
run. make windows now calls it, so both share one path. The installation
test guards its shebang, exec bit and shared library. Checked: --help,
bad option (2), macOS refusal (1), existing-executable refusal; node 5173.
--- FR ---
[ADD] construction : create_exe.sh, l'exécutable Windows depuis Linux
L'exécutable portable ne se construisait que par make windows. create_exe.sh
en est le point d'entrée autonome, à côté de run.sh et install.sh : il lance
scripts/construire_windows.sh par avec_node, donc sous le Node du projet, et
refuse sous Windows et macOS, où la construction ne se fait pas. make
windows passe désormais par lui. L'épreuve d'installation garde son shebang,
son bit d'exécution et la bibliothèque commune. Vérifié : --help, option
inconnue (2), refus macOS (1), refus d'un exécutable existant ; node 5173.
Assisted-by: Claude Opus 5.5
2026-10-14 00:22:33 -04:00
-h | --help)
[IMP] create_exe.sh: ask before overwriting this version's executable
An existing executable for the current version stopped the build with a
refusal, and the only way past it was to rerun with --reconstruire. The
script now asks [o/N] first: yes rebuilds it, anything else keeps it and
stops. Without a terminal the answer is no, so a script or a pipe never
overwrites a binary by accident; --reconstruire and GTT_OUI=1 skip the
question. Checked in a terminal against a stub build: n keeps (1), o and
y pass --reconstruire (0), no terminal keeps (1), absent builds directly.
--- FR ---
[IMP] create_exe.sh : demander avant d'écraser l'exécutable de la version
Un exécutable déjà construit pour la version arrêtait la construction sur
un refus, qu'on ne levait qu'en relançant avec --reconstruire. Le script
demande désormais [o/N] : oui le reconstruit, toute autre réponse le garde
et s'arrête. Sans terminal, la réponse est non : un script ou un tube
n'écrase jamais un binaire par mégarde ; --reconstruire et GTT_OUI=1 sautent
la question. Vérifié en terminal, construction remplacée par un témoin :
n garde (1), o et y passent --reconstruire (0), sans terminal garde (1).
Assisted-by: Claude Opus 5.5
2026-10-14 00:38:52 -04:00
sed -n '5,14p' " $0 " | sed 's/^# \{0,1\}//'
[ADD] build: create_exe.sh, the Windows executable from Linux
Building the portable executable was reachable only through make windows.
create_exe.sh is the standalone entry point, next to run.sh and install.sh:
it runs scripts/construire_windows.sh through avec_node, so under the
project's Node, and refuses on Windows and macOS, where the build does not
run. make windows now calls it, so both share one path. The installation
test guards its shebang, exec bit and shared library. Checked: --help,
bad option (2), macOS refusal (1), existing-executable refusal; node 5173.
--- FR ---
[ADD] construction : create_exe.sh, l'exécutable Windows depuis Linux
L'exécutable portable ne se construisait que par make windows. create_exe.sh
en est le point d'entrée autonome, à côté de run.sh et install.sh : il lance
scripts/construire_windows.sh par avec_node, donc sous le Node du projet, et
refuse sous Windows et macOS, où la construction ne se fait pas. make
windows passe désormais par lui. L'épreuve d'installation garde son shebang,
son bit d'exécution et la bibliothèque commune. Vérifié : --help, option
inconnue (2), refus macOS (1), refus d'un exécutable existant ; node 5173.
Assisted-by: Claude Opus 5.5
2026-10-14 00:22:33 -04:00
exit 0
; ;
*)
gtt_dire "usage : ./create_exe.sh [--reconstruire]"
exit 2
; ;
esac
done
case " $( gtt_famille) " in
windows | macos) gtt_refuser "l'exécutable Windows se construit sous Linux, en conteneur podman (§ 16)." ; ;
esac
[IMP] create_exe.sh: ask before overwriting this version's executable
An existing executable for the current version stopped the build with a
refusal, and the only way past it was to rerun with --reconstruire. The
script now asks [o/N] first: yes rebuilds it, anything else keeps it and
stops. Without a terminal the answer is no, so a script or a pipe never
overwrites a binary by accident; --reconstruire and GTT_OUI=1 skip the
question. Checked in a terminal against a stub build: n keeps (1), o and
y pass --reconstruire (0), no terminal keeps (1), absent builds directly.
--- FR ---
[IMP] create_exe.sh : demander avant d'écraser l'exécutable de la version
Un exécutable déjà construit pour la version arrêtait la construction sur
un refus, qu'on ne levait qu'en relançant avec --reconstruire. Le script
demande désormais [o/N] : oui le reconstruit, toute autre réponse le garde
et s'arrête. Sans terminal, la réponse est non : un script ou un tube
n'écrase jamais un binaire par mégarde ; --reconstruire et GTT_OUI=1 sautent
la question. Vérifié en terminal, construction remplacée par un témoin :
n garde (1), o et y passent --reconstruire (0), sans terminal garde (1).
Assisted-by: Claude Opus 5.5
2026-10-14 00:38:52 -04:00
# Un exécutable de cette version déjà construit : la question remplace le
# refus de scripts/construire_windows.sh, et « oui » lui passe --reconstruire.
# Le nom vient de deriver, appliqué à version.json, comme dans ce script.
if [ " $reconstruire " = 0 ] ; then
nom = " $( scripts/installation/avec_node.sh node -e "
const { deriver } = require( './scripts/version.js' ) ;
console.log( deriver( require( './version.json' ) .version) .nomFichier) ;
")"
if [ -e " dist-electron/ $nom " ] ; then
gtt_confirmer " dist-electron/ $nom existe déjà. L'écraser ? " \
|| gtt_refuser " dist-electron/ $nom reste. Un numéro ne désigne qu'un binaire (§ 18.2) : changer la version pour un exécutable qui a déjà quitté cette machine. "
reconstruire = 1
fi
fi
options = ( )
[ " $reconstruire " = 1 ] && options += ( --reconstruire)
exec scripts/installation/avec_node.sh scripts/construire_windows.sh ${ options [@]+ " ${ options [@] } " }