Merge branch 'garden-shears'
[msysgit.git] / share / WinGit / portable-release.sh
blob088ded7ae935940c6c277a4c947d88de1063c88d
1 #!/bin/sh
3 test -z "$1" && {
4 echo "Usage: $0 <version>"
5 exit 1
8 # change directory to msysGit root
9 SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
10 MSYSGITROOT="$(cd $SCRIPTDIR/../../ && pwd | sed 's/\/$//')/."
11 cd $MSYSGITROOT || {
12 echo "Could not change directory to msysGit root" >&2
13 exit 1
16 TARGET="$HOME"/PortableGit-$1.7z
17 OPTS7="-m0=lzma -mx=9 -md=64M"
18 TARGET7=tmp.7z
19 TMPDIR=/tmp/WinGit
21 DONT_REMOVE_BUILTINS=1 "$(dirname $0)/copy-files.sh" $TMPDIR &&
22 cd "$TMPDIR" &&
23 cp $MSYSGITROOT/share/WinGit/README.portable ./ &&
24 cp $MSYSGITROOT/msys.bat ./git-bash.bat &&
25 cp $MSYSGITROOT/git-cmd.bat ./ &&
26 $MSYSGITROOT/share/7-Zip/7za.exe a $OPTS7 $TARGET7 * ||
27 exit
29 if test -z "$NO_SFX"
30 then
31 (cat $MSYSGITROOT/share/7-Zip/7zSD.sfx &&
32 echo ';!@Install@!UTF-8!' &&
33 echo 'Progress="yes"' &&
34 echo 'Title="WinGit: MinGW Git + minimal MSys installation"' &&
35 echo 'BeginPrompt="This program installs a complete Git for MSys setup"' &&
36 echo 'CancelPrompt="Do you want to cancel WinGit installation?"' &&
37 echo 'ExtractDialogText="Please, wait..."' &&
38 echo 'ExtractPathText="Where do you want to install WinGit?"' &&
39 echo 'ExtractTitle="Extracting..."' &&
40 echo 'GUIFlags="8+32+64+256+4096"' &&
41 echo 'GUIMode="1"' &&
42 echo 'InstallPath="%PROGRAMFILES%\\Git"' &&
43 echo 'OverwriteMode="0"' &&
44 echo ';!@InstallEnd@!7z' &&
45 cat $TARGET7) > "$TARGET"
46 else
47 mv $TARGET7 "$TARGET"
48 fi &&
49 echo "Created $TARGET"