Skip to content

Commit fb385a2

Browse files
johnsonjbradfitz
authored andcommitted
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 <[email protected]>
1 parent 49954a5 commit fb385a2

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

cmd/release/releaselet.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ package main
1111
import (
1212
"archive/zip"
1313
"bytes"
14+
"crypto/sha256"
1415
"errors"
16+
"fmt"
1517
"io"
1618
"io/ioutil"
1719
"log"
@@ -291,7 +293,8 @@ func windowsMSI() error {
291293
)
292294
}
293295

294-
const wixBinaries = "https://storage.googleapis.com/go-builder-data/wix35-binaries.zip"
296+
const wixBinaries = "https://storage.googleapis.com/go-builder-data/wix311-binaries.zip"
297+
const wixSha256 = "da034c489bd1dd6d8e1623675bf5e899f32d74d6d8312f8dd125a084543193de"
295298

296299
// installWix fetches and installs the wix toolkit to the specified path.
297300
func installWix(path string) error {
@@ -301,6 +304,12 @@ func installWix(path string) error {
301304
return err
302305
}
303306

307+
// Verify sha256
308+
sum := sha256.Sum256(body)
309+
if fmt.Sprintf("%x", sum) != wixSha256 {
310+
return errors.New("sha256 mismatch for wix toolkit")
311+
}
312+
304313
// Unzip to path.
305314
zr, err := zip.NewReader(bytes.NewReader(body), int64(len(body)))
306315
if err != nil {
@@ -632,8 +641,7 @@ var windowsData = map[string]string{
632641
<Component Id="Component_GoEnvironment" Guid="{3ec7a4d5-eb08-4de7-9312-2df392c45993}">
633642
<RegistryKey
634643
Root="HKCU"
635-
Key="Software\GoProgrammingLanguage"
636-
Action="create" >
644+
Key="Software\GoProgrammingLanguage">
637645
<RegistryValue
638646
Name="installed"
639647
Type="integer"
@@ -681,6 +689,9 @@ var windowsData = map[string]string{
681689
<Custom Action="SetApplicationRootDirectory" Before="InstallFinalize" />
682690
</InstallExecuteSequence>
683691
692+
<!-- Notify top level applications of the new PATH variable (golang.org/issue/18680) -->
693+
<CustomActionRef Id="WixBroadcastEnvironmentChange" />
694+
684695
<!-- Include the user interface -->
685696
<WixVariable Id="WixUILicenseRtf" Value="LICENSE.rtf" />
686697
<WixVariable Id="WixUIBannerBmp" Value="images\Banner.jpg" />

0 commit comments

Comments
 (0)