Zrythm installer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

68 lines
1.8 KiB

#!@BASH@
#
# Copyright (C) 2020-2021 Alexandros Theodotou <alex at zrythm dot org>
#
# This file is part of Zrythm
#
# Zrythm is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Zrythm 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
set -ex
out_file="$1"
dist_dir="$2"
inno_installer_iss="$3"
dash_trial="@DASH_TRIAL@"
zrythm_pkg_ver="@ZRYTHM_PKG_VERSION@"
app_name="Zrythm$dash_trial"
verify_bin_file () {
bin_file="$1"
ok_text="$2"
echo "verifying zrythm binary $bin_file..."
temp_file=`mktemp`
$bin_file --version > $temp_file 2>&1 || true
output="`cat $temp_file`"
echo "$output"
if [[ "$output" = *"$ok_text"* ]]; then
echo "ok"
else
echo "fail"
rm "$temp_file"
exit 1
fi
rm "$temp_file"
exit 0
}
main () {
# verify installation
(verify_bin_file "$dist_dir/bin/zrythm.exe" "built with ")
cp $inno_installer_iss $dist_dir/installer.iss
info_version=`echo "$zrythm_pkg_ver" | sed -e 's/^\([0-9]\+\.[0-9]\+\.[0-9]\+\)\..*$/\1/'`
pushd $dist_dir
~/.wine/drive_c/Program\ Files\ \(x86\)/Inno\ Setup\ 6/ISCC.exe \
"//DAppName=$app_name" "//DAppVersion=$zrythm_pkg_ver" \
"//DAppInfoVersion=$info_version" \
"//DPluginsDir=plugins" \
installer.iss
popd
mv "$dist_dir/Output/Zrythm$dash_trial $zrythm_pkg_ver.exe" \
"$out_file"
}
main 1>&2