WinGit: Add a script to update Inno Setup
[msysgit.git] / share / WinGit / update-inno-setup.sh
blob5864c38b458010a10378b068ddc5cae0c8f4b527
1 #!/bin/sh
3 # Find a suitable download tool.
4 if [ -f "$(type -p curl)" ]; then
5 download="curl"
6 download_args_rss="-s"
7 download_args="-# -L -o"
8 elif [ -f "$(type -p wget)" ]; then
9 download="wget"
10 download_args_rss="-q -O -"
11 download_args="-N -O"
12 else
13 echo "ERROR: No suitable download tool found."
14 exit 1
17 SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
18 MSYSGITROOT="$(cd $SCRIPTDIR/../../ && pwd | sed 's/\/$//')/."
19 cd $MSYSGITROOT
21 # Download the most recent Inno Setup version.
22 file="is-unicode.exe"
23 url="http://www.jrsoftware.org/download.php/$file"
25 if [ "$download" == "curl" ]; then
26 download_args="$download_args $file -R -z"
28 $download $download_args $file $url
30 if [ -f $file ]; then
31 # Remove any previous installation.
32 rm -fr share/InnoSetup/
34 # Silently install Inno Setup.
35 wine=$(type -p wine)
36 if [ $? -eq 0 ]; then
37 $wine $file /verysilent /dir="share\InnoSetup" /noicons /tasks="" /portable=1
38 else
39 # See http://www.mingw.org/wiki/Posix_path_conversion.
40 $file //verysilent //dir="share\InnoSetup" //noicons //tasks="" //portable=1
43 # Remove unneeded files from the installation.
44 ( cd share/InnoSetup/ && rm -fr Examples/ Compil32.exe isscint.dll )
46 # Clean up.
47 rm $file