win32: avoid new git feature
[git-cola.git] / contrib / win32 / create-installer.sh
blob9f440d1cfcf7165410919d08aab39cdff4a16876
1 #!/bin/sh
2 cd "$(git rev-parse --show-toplevel)"
4 WIN32="$PWD/contrib/win32"
6 if ! test -d "$WIN32"
7 then
8 echo "Please run this script from the git-cola source tree"
9 exit 1
12 # Add Python and Gettext to our path
13 for python in "/c/Python27" "/c/Python26" "/c/Python25"
15 if test -d "$python"
16 then
17 break
19 done
20 PATH="$python":/bin:/usr/bin:/mingw/bin:"/c/Program Files/Gnu/bin":"$WIN32":"$PATH"
21 export PATH
23 VERSION=$(bin/git-cola version --brief)
25 while test $# -gt 0;
27 case "$1" in
28 -v|--version)
29 shift
30 VERSION="$1"
31 shift
34 echo "Usage: $0 [--version <version>]"
35 exit 1
37 esac
38 done
40 BASENAME="git-cola-$VERSION"
41 ETC="$BASENAME/etc"
42 ROOT="$BASENAME"
43 TARGET="$ROOT.exe"
45 echo "Building installer for git-cola $VERSION" &&
47 python setup.py --quiet install \
48 --prefix="$ROOT" \
49 --install-scripts="$ROOT"/bin &&
51 rm -rf "$ROOT/lib" "$ROOT/Lib" build &&
53 cp "$BASENAME/bin/git-cola" $BASENAME/bin/git-cola.pyw &&
54 cp "$BASENAME/bin/git-dag" $BASENAME/bin/git-dag.pyw &&
56 mkdir -p "$ETC" 2>/dev/null &&
57 cp "$WIN32/git.bmp" "$WIN32/gpl-2.0.rtf" "$WIN32/git.ico" "$ETC" &&
59 NOTES="$ETC/ReleaseNotes.txt" &&
61 printf "git-cola: v$VERSION\nBottled-on: $(date)\n\n\n" >"$NOTES" &&
63 tag=$(git tag | tail -2 | head -1) &&
64 echo "--------------------------------------------------------" >>"$NOTES" &&
65 echo " Changes since $tag" >>"$NOTES" &&
66 echo "--------------------------------------------------------" >>"$NOTES" &&
67 echo >>"$NOTES" &&
68 git shortlog "$tag.." >>"$NOTES" &&
70 # LF -> CRLF
71 vim -c "set ff=dos" -c "wq" "$NOTES" &&
72 sed -e "s/%APPVERSION%/$VERSION/" -e "s/%OUTPUTDIR%/../" \
73 < "$WIN32/install.iss" > "$BASENAME/install.iss" &&
75 cd "$BASENAME" &&
76 echo "Lauching Inno Setup compiler ..." &&
77 /share/InnoSetup/ISCC.exe install.iss |
78 grep -Ev "\s*Reading|\s*Compressing"
79 ) &&
80 rm -rf "$BASENAME"