Skip to content

Commit 024bd71

Browse files
committed
cmd/release: install Go to appropriate Program Files directory
The previous default installation path, C:\Go, has default permissions that are too permissive when adding a directory to the OS path. This change moves the default installation target to "Program Files" or "Program Files (x86)", which will inherit appropriate permissions, and is the canonical place to install software on Windows. Tested signed windows-386 and windows-amd64 artifacts on a 64-bit Windows device. Fixes golang/go#42070 Change-Id: I4a4cf744e53bb8f75b53d0f918de1707c4847882 Reviewed-on: https://go-review.googlesource.com/c/build/+/283600 Trust: Alexander Rakoczy <[email protected]> Run-TryBot: Alexander Rakoczy <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 789b929 commit 024bd71

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cmd/release/releaselet.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,12 @@ var windowsData = map[string]string{
366366
<?define ProdId = {FF5B30B2-08C2-11E1-85A2-6ACA4824019B} ?>
367367
<?define UpgradeCode = {1C3114EA-08C3-11E1-9095-7FCA4824019B} ?>
368368
<?define SysFolder=SystemFolder ?>
369+
<?define ArchProgramFilesFolder="ProgramFilesFolder" ?>
369370
<?else?>
370371
<?define ProdId = {716c3eaa-9302-48d2-8e5e-5cfec5da2fab} ?>
371372
<?define UpgradeCode = {22ea7650-4ac6-4001-bf29-f4b8775db1c0} ?>
372373
<?define SysFolder=System64Folder ?>
374+
<?define ArchProgramFilesFolder="ProgramFiles64Folder" ?>
373375
<?endif?>
374376
375377
<Product
@@ -406,7 +408,6 @@ var windowsData = map[string]string{
406408
((VersionNT > 601) OR (VersionNT = 601 AND ServicePackLevel >= 1))
407409
</Condition>
408410
<MajorUpgrade AllowDowngrades="yes" />
409-
<SetDirectory Id="INSTALLDIRROOT" Value="[%SYSTEMDRIVE]"/>
410411
411412
<CustomAction
412413
Id="SetApplicationRootDirectory"
@@ -415,7 +416,7 @@ var windowsData = map[string]string{
415416
416417
<!-- Define the directory structure and environment variables -->
417418
<Directory Id="TARGETDIR" Name="SourceDir">
418-
<Directory Id="INSTALLDIRROOT">
419+
<Directory Id="$(var.ArchProgramFilesFolder)">
419420
<Directory Id="INSTALLDIR" Name="Go"/>
420421
</Directory>
421422
<Directory Id="ProgramMenuFolder">

0 commit comments

Comments
 (0)