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