2011-10-17 22:51:45 -06:00
|
|
|
#!/usr/bin/env bash
|
2011-11-09 16:20:34 -07:00
|
|
|
# Copyright 2011 The Go Authors. All rights reserved.
|
2011-10-17 22:51:45 -06:00
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
set -e
|
|
|
|
|
2011-11-09 16:20:34 -07:00
|
|
|
PROGS="
|
|
|
|
candle
|
|
|
|
light
|
|
|
|
heat
|
|
|
|
"
|
2011-10-17 22:51:45 -06:00
|
|
|
|
2011-11-09 16:20:34 -07:00
|
|
|
echo "%%%%% Checking for WiX executables %%%%%" 1>&2
|
|
|
|
for i in $PROGS; do
|
|
|
|
if ! which -a $1 >/dev/null; then
|
|
|
|
echo "Cannot find '$i' on search path." 1>$2
|
2011-10-17 22:51:45 -06:00
|
|
|
exit 1
|
|
|
|
fi
|
2011-11-09 16:20:34 -07:00
|
|
|
done
|
2011-10-17 22:51:45 -06:00
|
|
|
|
|
|
|
echo "%%%%% Checking the packager's path %%%%%" 1>&2
|
|
|
|
if ! test -f ../../src/env.bash; then
|
|
|
|
echo "package.bash must be run from $GOROOT/misc/windows" 1>&2
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "%%%%% Setting the go package version info %%%%%" 1>&2
|
|
|
|
ver="$(bash ../../src/version.bash | sed 's/ .*//')"
|
|
|
|
|
|
|
|
rm -rf go
|
|
|
|
mkdir go
|
|
|
|
|
|
|
|
echo "%%%%% Cloning the go tree %%%%%" 1>&2
|
|
|
|
hg clone -r $(hg id -n | sed 's/+//') $(hg root) go
|
|
|
|
|
|
|
|
rm -rf ./go/.hg ./go/.hgignore ./go/.hgtags
|
|
|
|
|
|
|
|
echo "%%%%% Copying pkg and bin %%%%%" 1>&2
|
|
|
|
cp -a ../../pkg go/pkg
|
|
|
|
cp -a ../../bin go/bin
|
|
|
|
|
|
|
|
echo "%%%%% Starting zip packaging %%%%%" 1>&2
|
2011-10-27 15:45:17 -06:00
|
|
|
7za a -tzip -mx=9 gowin$GOARCH"_"$ver.zip "go/" >/dev/null
|
2011-10-17 22:51:45 -06:00
|
|
|
|
2011-11-09 16:20:34 -07:00
|
|
|
echo "%%%%% Starting Go directory file harvesting %%%%%" 1>&2
|
misc/windows packager development intermediate check-in
The installer now: allows a user to select an alternative
install directory, it now adds a Go folder to the Programs
Menu, and it places two shortcuts on the user's desktop.
The Program Menu folder contains shortcuts to the uninstaller
and two batch files, go.bat and godoc.bat. The desktop
shortcuts also point to go.bat and godoc.bat.
go.bat sets the Go environment, including Path, and spawns a
Window's shell. godoc.bat starts the godoc server at
localhost:6060 then spawns a browser window pointing to the
document server.
Setting the environment temporarily and spawning a shell, via
go.bat, should be safer than messing with the system's environment
and it makes the user experience a bit more streamlined.
The packager does work in its current state but it still needs
some polishing. And yes, the plan is to add a dialogue to allow
the user to decline the desktop shortcuts.
R=rsc, alex.brainman, tjyang2001
CC=golang-dev
https://golang.org/cl/5399042
2011-11-17 16:54:06 -07:00
|
|
|
heat dir go -nologo -cg AppFiles -gg -g1 -srd -sfrag -template fragment -dr INSTALLDIR -var var.SourceDir -out AppFiles.wxs
|
2011-11-09 16:20:34 -07:00
|
|
|
|
2011-10-17 22:51:45 -06:00
|
|
|
echo "%%%%% Starting installer packaging %%%%%" 1>&2
|
2011-11-09 16:20:34 -07:00
|
|
|
candle -nologo -dVersion=$ver -dArch=$GOARCH -dSourceDir=go installer.wxs AppFiles.wxs
|
misc/windows packager development intermediate check-in
The installer now: allows a user to select an alternative
install directory, it now adds a Go folder to the Programs
Menu, and it places two shortcuts on the user's desktop.
The Program Menu folder contains shortcuts to the uninstaller
and two batch files, go.bat and godoc.bat. The desktop
shortcuts also point to go.bat and godoc.bat.
go.bat sets the Go environment, including Path, and spawns a
Window's shell. godoc.bat starts the godoc server at
localhost:6060 then spawns a browser window pointing to the
document server.
Setting the environment temporarily and spawning a shell, via
go.bat, should be safer than messing with the system's environment
and it makes the user experience a bit more streamlined.
The packager does work in its current state but it still needs
some polishing. And yes, the plan is to add a dialogue to allow
the user to decline the desktop shortcuts.
R=rsc, alex.brainman, tjyang2001
CC=golang-dev
https://golang.org/cl/5399042
2011-11-17 16:54:06 -07:00
|
|
|
light -nologo -ext WixUIExtension -ext WixUtilExtension installer.wixobj AppFiles.wixobj -o gowin$GOARCH"_"$ver.msi
|
2011-10-17 22:51:45 -06:00
|
|
|
|
2011-11-09 16:20:34 -07:00
|
|
|
rm -f *.wixobj AppFiles.wxs *.wixpdb
|
2011-10-17 22:51:45 -06:00
|
|
|
|