From: Joe Poirier Date: Thu, 17 Nov 2011 23:54:06 +0000 (-0600) Subject: misc/windows packager development intermediate check-in X-Git-Tag: weekly.2011-11-18~15 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=984b4e381dc571e961934acbd5d4af329ae8afb9;p=gostls13.git 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 --- diff --git a/misc/windows/LICENSE b/misc/windows/LICENSE new file mode 100644 index 0000000000..b2b0be62c0 Binary files /dev/null and b/misc/windows/LICENSE differ diff --git a/misc/windows/godocserver.bat b/misc/windows/godocserver.bat new file mode 100644 index 0000000000..70b35dec71 --- /dev/null +++ b/misc/windows/godocserver.bat @@ -0,0 +1,14 @@ +@echo off +setlocal +for /f "delims=" %%i in ('cd') do set cwd=%%i + +if exist bin\godoc.exe goto ok +echo Unable to find the godoc executable +echo This batch file must run from the root Go folder +pause +exit + +:ok +start bin\godoc -http=localhost:6060 -goroot="%cwd%" +start http://localhost:6060 +endlocal diff --git a/misc/windows/goenv.bat b/misc/windows/goenv.bat new file mode 100644 index 0000000000..e6ae164624 --- /dev/null +++ b/misc/windows/goenv.bat @@ -0,0 +1,29 @@ +@echo off +setlocal +for /f %%i in ("%0") do set cwd=%%~dpi +cd /d %cwd% + +:: sanity checks +if exist "%cwd%"\bin\6g.exe ( +set GOARCH=amd64 +goto ok +) + +if exist "%cwd%"\bin\8g.exe ( +set GOARCH=386 +goto ok +) + +echo Unable to find the Go compiler +echo This batch file must run from the root Go folder +pause +exit + +:ok +set GOROOT=%cwd% +set GOBIN=%GOROOT%\bin +set PATH=%GOBIN%;%PATH% + +@CMD /F:ON +endlocal + diff --git a/misc/windows/installer.wxs b/misc/windows/installer.wxs index f35c4596ae..e15bfcfc1b 100644 --- a/misc/windows/installer.wxs +++ b/misc/windows/installer.wxs @@ -1,80 +1,152 @@ + - - - - - + + + + + + + + + + + + + + + + VersionNT >= 500 + + + - - VersionNT >= 500 - - - - - - - - + + + + + + + + + + - - - + + + + + + + + + + + + - + + + + + + + + + - - + + - - + + + + + - - - - - + + + + - - - EnableEV=1 - + + + + - - \ No newline at end of file + + diff --git a/misc/windows/package.bash b/misc/windows/package.bash index 8232a3cc5f..873db7019c 100755 --- a/misc/windows/package.bash +++ b/misc/windows/package.bash @@ -42,11 +42,11 @@ echo "%%%%% Starting zip packaging %%%%%" 1>&2 7za a -tzip -mx=9 gowin$GOARCH"_"$ver.zip "go/" >/dev/null echo "%%%%% Starting Go directory file harvesting %%%%%" 1>&2 -heat dir go -nologo -cg AppFiles -gg -g1 -srd -sfrag -template fragment -dr APPLICATIONROOTDIRECTORY -var var.SourceDir -out AppFiles.wxs +heat dir go -nologo -cg AppFiles -gg -g1 -srd -sfrag -template fragment -dr INSTALLDIR -var var.SourceDir -out AppFiles.wxs echo "%%%%% Starting installer packaging %%%%%" 1>&2 candle -nologo -dVersion=$ver -dArch=$GOARCH -dSourceDir=go installer.wxs AppFiles.wxs -light -nologo installer.wixobj AppFiles.wixobj -o gowin$GOARCH"_"$ver.msi +light -nologo -ext WixUIExtension -ext WixUtilExtension installer.wixobj AppFiles.wixobj -o gowin$GOARCH"_"$ver.msi rm -f *.wixobj AppFiles.wxs *.wixpdb