GitMe: fix installation to a path containing spaces
[msysgit.git] / share / GitMe / release.sh
blob059106c51314981d4a5711f417519a901046728a
1 #!/bin/sh
3 # Recreate GitMe-$VERSION.exe
5 test -z "$1" && {
6 echo "Usage: $0 <version>"
7 exit 1
10 TARGET="$HOME"/GitMe-"$1".exe
11 TMPDIR=/tmp/installer-tmp
12 OPTS7="-m0=lzma -mx=9 -md=64M"
13 TMPPACK=/tmp.7z
14 SHARE=/share/GitMe
16 test ! -d "$TMPDIR" || rm -rf "$TMPDIR" || exit
17 mkdir "$TMPDIR" &&
18 cd "$TMPDIR" &&
19 (cd .. && test ! -f "$TMPPACK" || rm "$TMPPACK") &&
20 echo "Copying files" &&
21 cat "$SHARE"/fileList.txt | (cd / && tar -c --file=- --files-from=-) |
22 tar xvf - &&
23 cat "$SHARE"/fileList-mingw.txt |
24 (cd /mingw && tar -c --file=- --files-from=-) |
25 tar xvf - &&
26 strip bin/*.exe &&
27 mkdir etc &&
28 cp "$SHARE"/gitconfig etc/ &&
29 cp "$SHARE"/setup-msysgit.sh ./ &&
30 echo "Creating archive" &&
31 cd .. &&
32 7z a $OPTS7 "$TMPPACK" installer-tmp &&
33 (cat /share/7-Zip/7zSD.sfx &&
34 echo ';!@Install@!UTF-8!' &&
35 echo 'Title="GitMe: MinGW Git + MSys installation"' &&
36 echo 'BeginPrompt="This archive contains the minimal system needed to\nbootstrap the latest MinGW Git and MSys environment"' &&
37 echo 'CancelPrompt="Do you want to cancel MSysGit installation?"' &&
38 echo 'ExtractDialogText="Please, wait..."' &&
39 echo 'ExtractPathText="Where do you want to install MSysGit?"' &&
40 echo 'ExtractTitle="Extracting..."' &&
41 echo 'GUIFlags="8+32+64+256+4096"' &&
42 echo 'GUIMode="1"' &&
43 echo 'InstallPath="C:\\msysgit"' &&
44 echo 'OverwriteMode="2"' &&
45 echo 'RunProgram="\"%%T\installer-tmp\bin\sh.exe\" /setup-msysgit.sh"' &&
46 echo 'Delete="%%T\installer-tmp"' &&
47 echo 'RunProgram="\"%%T\bin\sh.exe\" --login -i"' &&
48 echo ';!@InstallEnd@!' &&
49 cat "$TMPPACK") > "$TARGET" &&
50 echo Success! You\'ll find the new installer at $TARGET
51 rm $TMPPACK