doc: Document the cola.qt module
[git-cola.git] / win32 / create-installer.sh
blob24fc2ab6055ab3d534667b36c9d94216e1faa77b
1 #!/bin/sh
3 if ! test -d win32; then
4 echo "Please run this script from the root of the cola source tree"
5 exit 1
6 fi
8 # Add Python and Gettext to our path
9 PATH=/c/Python26:/bin:/usr/bin:/mingw/bin:"/c/Program Files/Gnu/bin":win32:"$PATH"
10 export PATH
12 VERSION=$(bin/git-cola version | awk '{print $3}')
14 while test $# -gt 0;
16 case "$1" in
17 -v|--version)
18 shift
19 VERSION="$1"
20 shift
23 echo "Usage: $0 [--version <version>]"
24 exit 1
26 esac
27 done
29 BASENAME=git-cola-$VERSION
30 ETC=$BASENAME/etc
31 ROOT=$BASENAME
32 TARGET="$ROOT".exe
34 echo "Building installer for git-cola $VERSION"
36 python setup.py --quiet install \
37 --prefix="$ROOT" \
38 --install-scripts="$ROOT"/bin
39 rm -rf "$ROOT"/lib "$ROOT"/Lib build
41 cp $BASENAME/bin/git-cola $BASENAME/bin/git-cola.pyw
42 mkdir -p $ETC 2>/dev/null
43 cp win32/git.bmp win32/gpl-2.0.rtf win32/git.ico $ETC
45 NOTES=$ETC/ReleaseNotes.txt
47 printf "git-cola: v$VERSION\nBottled-on: $(date)\n\n\n" > $NOTES
48 printf "To run cola, just type 'cola' from a Git Bash session.\n\n\n" >> $NOTES
50 tag=$(git tag | tail -2 | head -1)
51 echo "--------------------------------------------------------" >> $NOTES
52 echo " Changes since $tag" >> $NOTES
53 echo "--------------------------------------------------------" >> $NOTES
54 echo >> $NOTES
55 git shortlog $tag.. >> $NOTES
57 # LF -> CRLF
58 vim -c "set ff=dos" -c "wq" $NOTES
60 OUTPUTDIR="$(pwd -W)" &&
61 sed -e "s/%APPVERSION%/$VERSION/" -e "s@%OUTPUTDIR%@$OUTPUTDIR@" \
62 < win32/install.iss > $BASENAME/install.iss &&
63 cd "$BASENAME" &&
64 echo "Lauching Inno Setup compiler ..." &&
65 /share/InnoSetup/ISCC.exe install.iss /q | grep -Ev "\s*Reading|\s*Compressing" &&
66 cd .. &&
67 rm -rf "$BASENAME"