Commits

Joseph Poirier committed 8086095

misc/dist/windows: ongoing dev

Embedded Go images in the installer dialog and
banner boxes, Go tree cloning uses version info
from the Go tool (readme updated), the installer
allows up/down-grading and reparing of the version
that's installed, added two registry values.

R=golang-dev, bradfitz, bradfitz
CC=golang-dev
http://codereview.appspot.com/5683048

  • Participants
  • Parent commits 2a74f91

Comments (0)

Files changed (7)

File misc/dist/windows/README

 Dependencies
 ============
 - Windows Installer XML (WiX) toolset: http://wix.sourceforge.net/
-- 7Zip (command-line version): http://www.7-zip.org/download.html
+- 7Zip (command line version): http://www.7-zip.org/download.html
 - Mercurial (hg): http://mercurial.selenic.com/
 
 
 The dependencies must be callable from dist.bat, therefore,
 they'll need to be in/added to the system's search PATH.
 
-Ensure the working directory reflects the toolset version;
-the packager clones the Go directory it resides in and copies the
-pre-built toolchain over into the cloned folder.
+The packaging needs to be done from within a tracked Go folder. 
+Packages are built by cloning the same version of the source tree
+that the Go tools were built from.
 
 To create an i386 distribution package on a 64 bit system, set
 GOARCH=386 prior to calling dist.bat.
 ----
 - Documentation server shortcut checkbox option
 
+Misc
+----
+WiX box sizes:
+ - banner size: 493x58
+ - left side of dialog: 164x312
+ - full dialog size: 493x312
 
+

File misc/dist/windows/dist.bat

 
 :: Requires Windows Installer XML (WiX), 7zip, and Mercurial (hg)
 
+echo # Cleaning previous WiX output files
+del /F /Q /S *.wixobj AppFiles.wxs *.wixpdb>NUL
+
 echo # Setting some variables
 for /f %%i in ('hg.exe root') do set ROOT=%%i
-for /f %%i in ('hg.exe id -n') do set ID=%%i
 for /f "tokens=3" %%i in ('%ROOT%\bin\go.exe version') do set VER=%%i
+for /f "tokens=4" %%i in ('%ROOT%\bin\go.exe version') do set ID=%%i
+set ID=%ID:+=%
 if errorlevel 1 goto end
 
 echo # Getting GOARCH
 xcopy %ROOT%\bin                   go\bin /V /E /Y /I
 xcopy %ROOT%\src\pkg\runtime\z*.c  go\src\pkg\runtime  /V /E /Y
 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
+xcopy %ROOT%\src\pkg\runtime\z*.h  go\src\pkg\runtime  /V /E /Y
 
 echo # Starting zip packaging
 7za a -tzip -mx=9 go.%VER%.windows-%GOARCH%.zip "go/"

File misc/dist/windows/images/Banner.jpg

Added
New image

File misc/dist/windows/images/Dialog.jpg

Added
New image

File misc/dist/windows/images/DialogLeft.jpg

Added
New image

File misc/dist/windows/images/gopher.ico

Added
New image

File misc/dist/windows/installer.wxs

     <!-- Version="$(var.Version)" TODO: Version requires X.X.X.X format -->
 
 <Package
-    Id='*' Keywords='Installer'
+    Id='*' 
+    Keywords='Installer'
     Description="The Go Programming Language Installer"
     Comments="The Go programming language is an open source project to make programmers more productive."
     InstallerVersion="300"
     <Property Id="ARPHELPLINK" Value="golang.org/doc/community.html" />
     <Property Id="ARPREADME" Value="golang.org" />
     <Property Id="ARPURLINFOABOUT" Value="golang.org" />
-
-<!--
-<Upgrade Id="">
-    <UpgradeVersion
-        IncludeMaximum="yes"
-        IncludeMinimum="yes"
-        Language="1033"
-        Maximum=""
-        Minimum=""
-        Property="" />
-</Upgrade>
--->
-
+<Icon Id="gopher.ico" SourceFile="images\gopher.ico"/>
+<Property Id="ARPPRODUCTICON" Value="gopher.ico" />
 <Media Id='1' Cabinet="go.cab" EmbedCab="yes" CompressionLevel="high" />
 <Condition Message="Windows 2000 or greater required."> VersionNT >= 500</Condition>
+<MajorUpgrade AllowDowngrades="yes" />
 <SetDirectory Id="INSTALLDIRROOT" Value="C:\"/>
 
 <CustomAction
   <Directory Id="ProgramMenuFolder">
     <Directory Id="GoProgramShortcutsDir" Name="Go Programming Language"/>
   </Directory>
+  <Directory Id="EnvironmentEntries">
+    <Directory Id="GoEnvironmentEntries" Name="Go Programming Language"/>
+  </Directory>
   <Directory Id="DesktopFolder" Name="Desktop"/>
 </Directory>
 
-<!-- Programs Menu & Desktop Shortcuts, Registry & Environment Settings -->
+<!-- Programs Menu & Desktop Shortcuts -->
 <DirectoryRef Id="GoProgramShortcutsDir">
   <Component Id="Component_GoShortCuts" Guid="f5fbfb5e-6c5c-423b-9298-21b0e3c98f4b">
     <Shortcut
         Description="Starts the Go documentation server (http://localhost:6060)"
         Show="minimized"
         Arguments='/c "start /d[INSTALLDIR]bin godoc.exe -http=:6060 &amp;&amp; start http://localhost:6060"'
+        Icon="gopher.ico"
         Target="[%ComSpec]" />
     <Shortcut
         Id="GoDocServerDesktopShortcut"
         Name="GoDocServer"
         Description="Starts the godoc server (http://localhost:6060)"
         Show="minimized"
+        Icon="gopher.ico"
         Arguments='/c "start /d[INSTALLDIR]bin godoc.exe -http=:6060 &amp;&amp; start http://localhost:6060"'
         Target="[%ComSpec]" />
     <Shortcut
         On="uninstall" />
     <RegistryValue
         Root="HKCU"
-        Key="Software\Microsoft\TheGoProgrammingLanguage"
+        Key="Software\GoProgrammingLanguage"
+        Name="ShortCuts"
+        Type="integer" 
+        Value="1"
+        KeyPath="yes" /> 
+  </Component>
+</DirectoryRef>
+
+<!-- Registry & Environment Settings -->
+<DirectoryRef Id="GoEnvironmentEntries">
+  <Component Id="Component_GoEnvironment" Guid="3ec7a4d5-eb08-4de7-9312-2df392c45993">
+    <RegistryKey 
+        Root="HKCU"
+        Key="Software\GoProgrammingLanguage"
+        Action="create" >
+            <RegistryValue
         Name="installed"
         Type="integer"
         Value="1"
         KeyPath="yes" />
+            <RegistryValue
+                Name="installLocation"
+                Type="string"
+                Value="[INSTALLDIR]" />
+    </RegistryKey>
     <Environment
         Id="Environment"
         Action="set"
         Permanent="no"
         System="yes"
         Value="[INSTALLDIR]bin" />
+    <RemoveFolder
+        Id="GoEnvironmentEntries"
+        On="uninstall" />
   </Component>
 </DirectoryRef>
 
     Title="Go"
     Level="1">
 
+      <ComponentRef Id="Component_GoEnvironment" />
       <ComponentGroupRef Id="AppFiles" />
       <ComponentRef Id="Component_GoShortCuts" />
 </Feature>
 
 <!-- Update the environment -->
 <InstallExecuteSequence>
-  <Custom
-    Action="SetApplicationRootDirectory"
-    Before="InstallFinalize" />
+    <Custom Action="SetApplicationRootDirectory" Before="InstallFinalize" />
 </InstallExecuteSequence>
 
 <!-- Include the user interface -->
 <WixVariable Id="WixUILicenseRtf" Value="LICENSE" />
+<WixVariable Id="WixUIBannerBmp" Value="images\Banner.jpg" />
+<WixVariable Id="WixUIDialogBmp" Value="images\Dialog.jpg" />
 <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
 <UIRef Id="WixUI_InstallDir" />