From 3d965cc8a2bf43e0a17540ed0d8ce127d25e7195 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Thu, 31 Jan 2013 22:22:57 +0100 Subject: [PATCH] WinGit: Add a script to update Inno Setup Signed-off-by: Sebastian Schuberth --- share/WinGit/update-inno-setup.sh | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 share/WinGit/update-inno-setup.sh diff --git a/share/WinGit/update-inno-setup.sh b/share/WinGit/update-inno-setup.sh new file mode 100644 index 00000000..5864c38b --- /dev/null +++ b/share/WinGit/update-inno-setup.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +# Find a suitable download tool. +if [ -f "$(type -p curl)" ]; then + download="curl" + download_args_rss="-s" + download_args="-# -L -o" +elif [ -f "$(type -p wget)" ]; then + download="wget" + download_args_rss="-q -O -" + download_args="-N -O" +else + echo "ERROR: No suitable download tool found." + exit 1 +fi + +SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)" +MSYSGITROOT="$(cd $SCRIPTDIR/../../ && pwd | sed 's/\/$//')/." +cd $MSYSGITROOT + +# Download the most recent Inno Setup version. +file="is-unicode.exe" +url="http://www.jrsoftware.org/download.php/$file" + +if [ "$download" == "curl" ]; then + download_args="$download_args $file -R -z" +fi +$download $download_args $file $url + +if [ -f $file ]; then + # Remove any previous installation. + rm -fr share/InnoSetup/ + + # Silently install Inno Setup. + wine=$(type -p wine) + if [ $? -eq 0 ]; then + $wine $file /verysilent /dir="share\InnoSetup" /noicons /tasks="" /portable=1 + else + # See http://www.mingw.org/wiki/Posix_path_conversion. + $file //verysilent //dir="share\InnoSetup" //noicons //tasks="" //portable=1 + fi + + # Remove unneeded files from the installation. + ( cd share/InnoSetup/ && rm -fr Examples/ Compil32.exe isscint.dll ) + + # Clean up. + rm $file +fi -- 2.11.4.GIT