1
0
mirror of https://github.com/golang/go synced 2024-11-22 11:14:47 -07:00
go/misc/windows/goenv.bat
Joe Poirier 984b4e381d 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 17:54:06 -06:00

30 lines
423 B
Batchfile

@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