cmd/release: notify explorer of PATH update after install on Win
Windows installer will not broadcast WM_SETTINGCHANGE when a reboot is
pending. This message is required for explorer.exe to reload the PATH
from the registry so future cmd.exe processes will launch with go/bin in
the PATH.
- Updated to wix v3.11[1]
- Added sha256 validation of wix binary after download
- Use the Wix extension[0] to always broadcast WM_SETTINGCHANGE after install.
- Removed to RegistryKey/@Action in installer.wxs suppress warning CNDL1138.
The param is deperacated and not needed.
[0] http://wixtoolset.org/documentation/manual/v3/customactions/wixsettingchange.html
[1] https://github.com/wixtoolset/wix3/releases/tag/wix311rtm
Fixes golang/go#18680
Change-Id: I645b1e4a32bf0c1df2925d53474a38a7d7ddec94
Reviewed-on: https://go-review.googlesource.com/46458
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/cmd/release/releaselet.go b/cmd/release/releaselet.go
index 58383a9..b0a8390 100644
--- a/cmd/release/releaselet.go
+++ b/cmd/release/releaselet.go
@@ -11,7 +11,9 @@
import (
"archive/zip"
"bytes"
+ "crypto/sha256"
"errors"
+ "fmt"
"io"
"io/ioutil"
"log"
@@ -291,7 +293,8 @@
)
}
-const wixBinaries = "https://storage.googleapis.com/go-builder-data/wix35-binaries.zip"
+const wixBinaries = "https://storage.googleapis.com/go-builder-data/wix311-binaries.zip"
+const wixSha256 = "da034c489bd1dd6d8e1623675bf5e899f32d74d6d8312f8dd125a084543193de"
// installWix fetches and installs the wix toolkit to the specified path.
func installWix(path string) error {
@@ -301,6 +304,12 @@
return err
}
+ // Verify sha256
+ sum := sha256.Sum256(body)
+ if fmt.Sprintf("%x", sum) != wixSha256 {
+ return errors.New("sha256 mismatch for wix toolkit")
+ }
+
// Unzip to path.
zr, err := zip.NewReader(bytes.NewReader(body), int64(len(body)))
if err != nil {
@@ -632,8 +641,7 @@
<Component Id="Component_GoEnvironment" Guid="{3ec7a4d5-eb08-4de7-9312-2df392c45993}">
<RegistryKey
Root="HKCU"
- Key="Software\GoProgrammingLanguage"
- Action="create" >
+ Key="Software\GoProgrammingLanguage">
<RegistryValue
Name="installed"
Type="integer"
@@ -681,6 +689,9 @@
<Custom Action="SetApplicationRootDirectory" Before="InstallFinalize" />
</InstallExecuteSequence>
+<!-- Notify top level applications of the new PATH variable (golang.org/issue/18680) -->
+<CustomActionRef Id="WixBroadcastEnvironmentChange" />
+
<!-- Include the user interface -->
<WixVariable Id="WixUILicenseRtf" Value="LICENSE.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="images\Banner.jpg" />