]> Cypherpunks repositories - gostls13.git/commitdiff
misc/dist/windows: ongoing dev
authorJoe Poirier <jdpoirier@gmail.com>
Mon, 20 Feb 2012 04:21:41 +0000 (22:21 -0600)
committerJoe Poirier <jdpoirier@gmail.com>
Mon, 20 Feb 2012 04:21:41 +0000 (22:21 -0600)
Added the (properly formatted) license file back,
the installer adds go\bin to the system PATH now,
the output package names are in line with the linux
and darwin versions, dist.bat extracts GOARCH in a
sane way, readme cleanup.

Tested on Windows 7 only. It would be helpful if
someone else could give it a try. See the readme
for details.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5673099

misc/dist/windows/LICENSE [new file with mode: 0644]
misc/dist/windows/README
misc/dist/windows/dist.bat [changed mode: 0755->0644]
misc/dist/windows/godocserver.bat [deleted file]
misc/dist/windows/goenv.bat [deleted file]
misc/dist/windows/installer.wxs

diff --git a/misc/dist/windows/LICENSE b/misc/dist/windows/LICENSE
new file mode 100644 (file)
index 0000000..b2b0be6
Binary files /dev/null and b/misc/dist/windows/LICENSE differ
index c345d4570fa795f87526cf31234a4fc0b5e8d339..898940edf5b47e96f1030fef77d8d3ddb34bef2b 100644 (file)
@@ -1,20 +1,29 @@
-package.bash packages the Go toolchain for Windows in 
-zip and installer (msi) format. 
-
-Dependencies
-============
-- WiX Installer XML (WiX) toolset: http://wix.sourceforge.net/
-- 7Zip command-line: http://www.7-zip.org/download.html
-- MinGW/Msys tools
-
-Unzip and place 7za.exe in msys' bin directory.
-Add the WiX bin directory to PATH.
-
-Packaging
-=========
-- have a go tree at $GOROOT
-- make sure $GOBIN=$GOROOT\bin or is empty
-- make sure $GOARCH=386 or $GOARCH=amd64
-- select appropriate version "hg up -r ..."
-- build go "cd $GOROOT/src; ./all.bash"
-- create Windows packages "cd $GOROOT/misc/windows; ./package.bash"
+dist.bat packages the Go toolchain for Windows in both zip\r
+and installer (msi) format.\r
+\r
+Dependencies\r
+============\r
+- Windows Installer XML (WiX) toolset: http://wix.sourceforge.net/\r
+- 7Zip (command-line version): http://www.7-zip.org/download.html\r
+- Mercurial (hg): http://mercurial.selenic.com/\r
+\r
+\r
+Packaging\r
+=========\r
+The dependencies must be callable from dist.bat, therefore,\r
+they'll need to be in/added to the system's search PATH.\r
+\r
+Ensure the working directory reflects the toolset version;\r
+the packager clones the Go directory it resides in and copies the\r
+pre-built toolchain over into the cloned folder.\r
+\r
+To create an i386 distribution package on a 64 bit system, set\r
+GOARCH=386 prior to calling dist.bat.\r
+\r
+Run dist.bat from a command prompt or click on the batch file.\r
+\r
+TODO\r
+----\r
+- Documentation server shortcut checkbox option\r
+\r
+\r
old mode 100755 (executable)
new mode 100644 (file)
index ec8841d..0903577
@@ -5,31 +5,32 @@
 \r
 setlocal\r
 \r
-:: Requires WiX (candle light heat), 7zip, and hg\r
+:: Requires Windows Installer XML (WiX), 7zip, and Mercurial (hg)\r
 \r
-echo # Setting variable info\r
+echo # Setting some variables\r
 for /f %%i in ('hg.exe root') do set ROOT=%%i\r
 for /f %%i in ('hg.exe id -n') do set ID=%%i\r
 for /f "tokens=3" %%i in ('%ROOT%\bin\go.exe version') do set VER=%%i\r
 if errorlevel 1 goto end\r
 \r
 echo # Getting GOARCH\r
-%ROOT%\bin\go tool dist env > env.txt\r
-set GOARCH /p = find "GOARCH" "env.txt">NUL\r
-del /F /Q /S env.txt>NUL\r
+%ROOT%\bin\go tool dist env -w>env.bat\r
+call env.bat\r
+del /F /Q /S env.bat>NUL\r
 if errorlevel 1 goto end\r
 \r
+\r
 rmdir /S /Q go>NUL\r
 mkdir go\r
 \r
-echo # Cloning the go tree\r
+echo # Cloning the Go tree\r
 hg clone -r %ID% %ROOT% go\r
 if errorlevel 1 goto end\r
 \r
 rmdir /S /Q  go\.hg>NUL\r
 del /F /Q /S go\.hgignore go\.hgtags>NUL\r
 \r
-echo # Copying pkg, bin and src/pkg/runtime/z*\r
+echo # Copying pkg, bin, and src/pkg/runtime/z*\r
 xcopy %ROOT%\pkg                   go\pkg /V /E /Y /I\r
 xcopy %ROOT%\bin                   go\bin /V /E /Y /I\r
 xcopy %ROOT%\src\pkg\runtime\z*.c  go\src\pkg\runtime  /V /E /Y\r
@@ -37,18 +38,20 @@ xcopy %ROOT%\src\pkg\runtime\z*.go go\src\pkg\runtime  /V /E /Y
 xcopy %ROOT%\src\pkg\runtime\z*.h  go\src\pkg\runtime  /V /E /T\r
 \r
 echo # Starting zip packaging\r
-7za a -tzip -mx=9 gowin%GOARCH%"_"%VER%.zip "go/"\r
+7za a -tzip -mx=9 go.%VER%.windows-%GOARCH%.zip "go/"\r
 if errorlevel 1 goto end\r
 \r
+\r
 echo # Starting Go directory file harvesting\r
 heat dir go -nologo -cg AppFiles -gg -g1 -srd -sfrag -template fragment -dr INSTALLDIR -var var.SourceDir -out AppFiles.wxs\r
 if errorlevel 1 goto end\r
 \r
 echo # Starting installer packaging\r
 candle -nologo -dVersion=%VER% -dArch=%GOARCH% -dSourceDir=go installer.wxs AppFiles.wxs\r
-light -nologo -ext WixUIExtension -ext WixUtilExtension installer.wixobj AppFiles.wixobj -o gowin%GOARCH%"_"%VER%.msi\r
+light -nologo -ext WixUIExtension -ext WixUtilExtension installer.wixobj AppFiles.wixobj -o go.%VER%.windows-%GOARCH%.msi\r
 if errorlevel 1 goto end\r
 \r
 del /F /Q /S *.wixobj AppFiles.wxs *.wixpdb>NUL\r
 \r
 :end\r
+endlocal\r
diff --git a/misc/dist/windows/godocserver.bat b/misc/dist/windows/godocserver.bat
deleted file mode 100644 (file)
index 70b35de..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-@echo off\r
-setlocal\r
-for /f "delims=" %%i in ('cd') do set cwd=%%i\r
-\r
-if exist bin\godoc.exe goto ok\r
-echo Unable to find the godoc executable\r
-echo This batch file must run from the root Go folder\r
-pause\r
-exit\r
-\r
-:ok\r
-start bin\godoc -http=localhost:6060 -goroot="%cwd%"\r
-start http://localhost:6060\r
-endlocal\r
diff --git a/misc/dist/windows/goenv.bat b/misc/dist/windows/goenv.bat
deleted file mode 100644 (file)
index e6ae164..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-@echo off\r
-setlocal\r
-for /f %%i in ("%0") do set cwd=%%~dpi\r
-cd /d %cwd%\r
-\r
-:: sanity checks\r
-if exist "%cwd%"\bin\6g.exe (\r
-set GOARCH=amd64\r
-goto ok\r
-)\r
-\r
-if exist "%cwd%"\bin\8g.exe (\r
-set GOARCH=386\r
-goto ok\r
-)\r
-\r
-echo Unable to find the Go compiler\r
-echo This batch file must run from the root Go folder\r
-pause\r
-exit\r
-\r
-:ok\r
-set GOROOT=%cwd%\r
-set GOBIN=%GOROOT%\bin\r
-set PATH=%GOBIN%;%PATH%\r
-\r
-@CMD /F:ON\r
-endlocal\r
-\r
index e15bfcfc1bdbf7127754651c31dccd9d7a033792..62a5e7cc0b9d4e1d30dc270902a8d4daadbdde84 100644 (file)
@@ -16,8 +16,9 @@
 \r
 <Product\r
     Id="FF5B30B2-08C2-11E1-85A2-6ACA4824019B"\r
-    Name="The Go Programming Language $(var.Arch) $(var.Version)"\r
+    Name="Go Programming Language $(var.Arch) $(var.Version)"\r
     Language="1033"\r
+    Codepage="1252"\r
     Version="0.0.0.0"\r
     Manufacturer="http://golang.org"\r
     UpgradeCode="1C3114EA-08C3-11E1-9095-7FCA4824019B" >\r
     Comments="The Go programming language is an open source project to make programmers more productive."\r
     InstallerVersion="300"\r
     Compressed="yes"\r
-    Manufacturer="http://golang.org"\r
     InstallScope="perMachine"\r
+    SummaryCodepage="1252"\r
     Languages="1033" />\r
-     <!--    Platform="x86 or x64" -->\r
+    <!--    Platform="x86 or x64" -->\r
+\r
+    <Property Id="ARPCOMMENTS" Value="The Go programming language is a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language." />\r
+    <Property Id="ARPCONTACT" Value="golang-nuts@googlegroups.com" />\r
+    <Property Id="ARPHELPLINK" Value="golang.org/doc/community.html" />\r
+    <Property Id="ARPREADME" Value="golang.org" />\r
+    <Property Id="ARPURLINFOABOUT" Value="golang.org" />\r
+\r
 <!--\r
 <Upgrade Id="">\r
     <UpgradeVersion\r
@@ -44,6 +52,7 @@
         Property="" />\r
 </Upgrade>\r
 -->\r
+\r
 <Media Id='1' Cabinet="go.cab" EmbedCab="yes" CompressionLevel="high" />\r
 <Condition Message="Windows 2000 or greater required."> VersionNT >= 500</Condition>\r
 <SetDirectory Id="INSTALLDIRROOT" Value="C:\"/>\r
     <Directory Id="INSTALLDIR" Name="Go"/>\r
   </Directory>\r
   <Directory Id="ProgramMenuFolder">\r
-    <Directory Id="GoProgramShortcutsDir" Name="Go Programming"/>\r
+    <Directory Id="GoProgramShortcutsDir" Name="Go Programming Language"/>\r
   </Directory>\r
   <Directory Id="DesktopFolder" Name="Desktop"/>\r
 </Directory>\r
 \r
-<!-- Programs Menu & Desktop Shortcuts -->\r
+<!-- Programs Menu & Desktop Shortcuts, Registry & Environment Settings -->\r
 <DirectoryRef Id="GoProgramShortcutsDir">\r
   <Component Id="Component_GoShortCuts" Guid="f5fbfb5e-6c5c-423b-9298-21b0e3c98f4b">\r
-    <Shortcut\r
-        Id="GoEnvStartMenuShortcut"\r
-        Name="GoEnv"\r
-        Description="Sets the Go environment and spawns a shell window"\r
-        Target="[INSTALLDIR]goenv.bat" />\r
-    <Shortcut\r
-        Id="GoEnvDesktopShortcut"\r
-        Directory="DesktopFolder"\r
-        Name="GoEnv"\r
-        Description="Sets the Go environment and spawns a shell window"\r
-        Target="[INSTALLDIR]goenv.bat" />\r
     <Shortcut\r
         Id="GoDocServerStartMenuShortcut"\r
         Name="GoDocServer"\r
-        Description="Starts the godoc server on localhost:6060"\r
-        Target="[INSTALLDIR]godocserver.bat" />\r
+        Description="Starts the Go documentation server (http://localhost:6060)"\r
+        Show="minimized"\r
+        Arguments='/c "start /d[INSTALLDIR]bin godoc.exe -http=:6060 &amp;&amp; start http://localhost:6060"'\r
+        Target="[%ComSpec]" />\r
     <Shortcut\r
         Id="GoDocServerDesktopShortcut"\r
         Directory="DesktopFolder"\r
         Name="GoDocServer"\r
-        Description="Starts the godoc server on localhost:6060"\r
-        Target="[INSTALLDIR]godocserver.bat" />\r
+        Description="Starts the godoc server (http://localhost:6060)"\r
+        Show="minimized"\r
+        Arguments='/c "start /d[INSTALLDIR]bin godoc.exe -http=:6060 &amp;&amp; start http://localhost:6060"'\r
+        Target="[%ComSpec]" />\r
     <Shortcut\r
         Id="UninstallShortcut"\r
         Name="Uninstall Go"\r
         Type="integer"\r
         Value="1"\r
         KeyPath="yes" />\r
+    <Environment\r
+        Id="Environment"\r
+        Action="set"\r
+        Part="last"\r
+        Name="PATH"\r
+        Permanent="no"\r
+        System="yes"\r
+        Value="[INSTALLDIR]bin" />\r
   </Component>\r
 </DirectoryRef>\r
 \r
 <!-- Components -->\r
-<DirectoryRef Id="INSTALLDIR">\r
-  <Component Id="Component_GoDocServerBAT" Guid="c40ea60a-4290-4a91-864d-e1d8eb5cf693">\r
-    <File\r
-        Id="FILE_GoDocServerBat"\r
-        Source="godocserver.bat"\r
-        KeyPath="yes" />\r
-  </Component>\r
-  <Component Id="Component_GoEnvBAT" Guid="ee4587d3-fba3-47f9-b45e-ec9ca9c8a9c3">\r
-    <File\r
-        Id="FILE_GoEnvBat"\r
-        Source="goenv.bat"\r
-        KeyPath="yes" />\r
-  </Component>\r
-</DirectoryRef>\r
 \r
 <!-- Install the files -->\r
 <Feature\r
     Level="1">\r
 \r
       <ComponentGroupRef Id="AppFiles" />\r
-      <ComponentRef Id="Component_GoDocServerBAT" />\r
-      <ComponentRef Id="Component_GoEnvBAT" />\r
       <ComponentRef Id="Component_GoShortCuts" />\r
 </Feature>\r
 \r