-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: after installing via MSI installer, prompt says "go is not a recognized command" #18680
Comments
Does the go installer modify the system %PATH%? What's the system %PATH%
after installation?
From the source code, it does look like it should modify the system %PATH%.
https://github.com/golang/build/blob/master/cmd/release/releaselet.go#L647
|
I cannot reproduce it. It does work for me. I am running Windows 7. Perhaps something is not quite right with your step 2.
It does modify mine. Alex |
How was the new command prompt started? On most systems I've noticed running CMD.exe in the existing console doesn't work. It has to be a new window. |
I am able to produce it on 32-bit Windows 8 and 10. My %PATH% is not modified. I am opening a new command prompt window via a right click on the Start button. |
Couldn't reproduce on a fresh VM (Windows Server 2016 Datacenter - version 1607, OS version 14393.693). Also couldn't reproduce on a 64-bit Windows 10. Could be specific to 32-bit? Related to #17602 perhaps? |
I used
to gather logs but installation succeed (at my third retry) and added GOROOT and modified the GOPATH. I don't understand what makes this inconsistently fail. I haven't updated the installation path, I am not thinking it might be related to #17602. |
Go installer does not add GOPATH variable. Did you mean it modified PATH? Alex |
Are you sure you have 32-bit Windows. What does "echo %PROCESSOR_ARCHITECTURE%" prints? 32-bit Windows is not common now days. I tried installing 32-bit version of Go on 64-bit version of Windows, and that works for me. Alex |
There is only today or tomorrow to get a change submitted for Go 1.8. This won't block the release. |
No repro on a fresh 32-bit Server 2008 Datacenter VM for Go1.8rc2 |
Closing this until reproduced. It is clear that it is not making to 1.8 if the bug is there. |
I'm able to reproduce this on W10 amd64, the details are in the session below.
The registry, as shown above, contains the updated PATH. So the MSI did in fact do its job. So then why did the path not get updated in a new command prompt? It depends on how the installer itself was started. Here's my interpretation of what happens: The update to the system environment variables is reflected in the registry, as well as the environment of the process. When you double click the MSI, it executes in the same environment as the desktop process (explorer). The changes to the path happen in the same environment as the desktop, the subsequent command prompts created by the desktop receive a copy of this updated environment, so PATH, and everything else works as intended. When the MSI is run from the command prompt, it receives only a copy of cmd's environment. So when it changes the PATH value, the change only exists for that copy of the environment and is never shared with explorer. New command prompts started from explorer use the old path, because explorer's environment remains the same. Logging out, restarting, or just killing explorer and restarting it fixes the issue because explorer reads the registry when it initializes. The following can test this idea:
|
@as does it repro when you open a new command line? it needs to run from explorer.exe, so It's in your registry Path so it should be picked up by a fresh environment. |
Yes, until explorer was restarted, even using "Start > Run" failed to find the go program. I've edited the previous comment with more details. |
Thanks for the detailed repro! I tested mine via double click (instead of msiexec as @rakyll and @as mentioned) Perhaps cli needs an explicit As @as pointed out with the |
@rakyll maybe re-open and tag for Go1.9? |
I believe this is the issue. It's a reasonable explanation of why it doesn't repro in all environments/consistently:
CL inbound |
CL https://golang.org/cl/36324 mentions this issue. |
Our version of Wix doesn't include this flag. We'll need to update it. |
@broady I was worried about that! Is the install built by the build bots or somewhere else? |
Yeah, by the build bots. I just sent a change to revert it for the 1.8 release (today), but if you can see a straightforward fix, that'd be good. |
CL https://golang.org/cl/37135 mentions this issue. |
Wix needs to be >= v3.10.0.1519 and looks like we're at 3.5. With a release today, rollback seems appropriate. Can you link me to the buildbot output where this failed so I can check it out next time? |
…Win" This reverts commit 924bb6b. https://golang.org/cl/36324 When running the release builds, we get this error: C:\workdir\windows\installer.wxs(155) : error LGHT0094 : Unresolved reference to symbol 'CustomAction:WixBroadcastEnvironmentChange' in section 'Product:*'. The wix documentation indicates we need to enable it: http://wixtoolset.org/documentation/manual/v3/customactions/wixsettingchange.html In any case, reverting this change for the 1.8 release. Updates golang/go#18680. Change-Id: I86e8d82dc57e585c11846edf589c4bab84a60308 Reviewed-on: https://go-review.googlesource.com/37135 Reviewed-by: Jeff Johnson <[email protected]> Reviewed-by: Chris Broadfoot <[email protected]>
@broady, can you handle updating our Wix, or do you need help? |
CL https://golang.org/cl/46458 mentions this issue. |
go
into the prompt.Actual result:
Expected result:
The go binary is found.
The text was updated successfully, but these errors were encountered: