aboutsummaryrefslogtreecommitdiff
path: root/msys2-package.sh
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-06-22 23:34:51 +0200
committerPřemysl Eric Janouch <p@janouch.name>2023-06-26 02:10:31 +0200
commit089c90004ba8f2af9574e3982b20a4b6cb2ab2f1 (patch)
treeb10b84635ec98c89f1c0656be01d70e494366fda /msys2-package.sh
parent19913a5e4880503dd06a73c03584e77d3cf504a0 (diff)
downloadfiv-089c90004ba8f2af9574e3982b20a4b6cb2ab2f1.tar.gz
fiv-089c90004ba8f2af9574e3982b20a4b6cb2ab2f1.tar.xz
fiv-089c90004ba8f2af9574e3982b20a4b6cb2ab2f1.zip
Produce a basic Windows installer package
We're very early adopters of msitools' new UI feature, so this doesn't work on MSYS2 directly yet due to an old version.
Diffstat (limited to 'msys2-package.sh')
-rwxr-xr-xmsys2-package.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/msys2-package.sh b/msys2-package.sh
new file mode 100755
index 0000000..419ee21
--- /dev/null
+++ b/msys2-package.sh
@@ -0,0 +1,30 @@
+#!/bin/sh -e
+export LC_ALL=C.UTF-8
+cd "$MESON_BUILD_ROOT"
+
+txt2rtf() {
+ iconv -f utf-8 -t ascii//translit "$@" | awk 'BEGIN {
+ print "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0 Tahoma;}}"
+ print "\\f0\\fs24{\\pard\\sa240"
+ } {
+ gsub(/\\/, "\\\\"); gsub(/{/, "\\{"); gsub(/}/, "\\}")
+ if (!$0) { print "\\par}{\\pard\\sa240"; prefix = "" }
+ else { print prefix $0; prefix = " " }
+ } END {
+ print "\\par}}"
+ }'
+}
+
+# We're being passed host_machine.cpu(), which will be either x86 or x86_64.
+[ "$1" = "x86" ] && arch=x86 || arch=x64
+
+wxs=fiv.wxs files=fiv-files.wxs msi=fiv.msi
+
+txt2rtf "$MESON_SOURCE_ROOT/LICENSE" > License.rtf
+find "$MESON_INSTALL_DESTDIR_PREFIX" -type f \
+ | wixl-heat --prefix "$MESON_INSTALL_DESTDIR_PREFIX/" \
+ --directory-ref INSTALLDIR --component-group CG.fiv \
+ --var var.SourceDir > "$files"
+
+wixl --verbose --arch "$arch" -D SourceDir="$MESON_INSTALL_DESTDIR_PREFIX" \
+ --ext ui --output "$msi" "$wxs" "$files"