-
Notifications
You must be signed in to change notification settings - Fork 18k
build: make Windows MSI default install path more conventional? #23848
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
Comments
We have persistent problems with Windows path length limits (#22230, #21782, #18468, #3358, #10577, #17500, etc). IIRC, we placed it at "C:\Go" because it was shorter than "C:\Program Files\Go" and made the difference between the build working and not working. It's gotten better, but we still have open bugs in that area. |
/cc @alexbrainman |
Chime. The conventional paths may also contain spaces and parenthesis. You would also have to install the 32-bit binary toolchain in |
Yes, indeed it contains spaces, and yes that is one of the conventional paths. As someone else said, you probably wouldn't install Go on linux in |
That is where it goes on my linux machines. Most distributions have filesystem layouts comparable to the quality of Windows (e.g., /usr/bin vs /bin). Why complicate things with standards that don't have a single source of truth? |
Correct. I also suspect that we had trouble with spaces in the file paths in the past, but that should be fixed too. So I think it is fine to install Go into "C:\Program Files" just like any other program. The only thing that comes to my mind is that "C:\Program Files" might not be writable when user using Go - so we need to make sure that we don't write into "C:\Program Files\Go" once installer has finished.
I would love to have a go at fixing this, but I have to be truthful to myself :-) I have very little free time now. But I am happy to help when I can.
I suspect installer should handle this by default. We just have to stop asking installer to install Go into c:\go. Alex |
The location |
We all agreed that If you think it is important for this issue to be addressed, you should try and fix Go installer yourself. The code is in $GOPATH/src/golang.org/x/build/cmd/release/releaselet.go. Alex |
What about allowing the MSI to accept an install folder as an argument? This would be really useful for package managers like Chocolatey |
We really don't like maintaining options whenever possible. The installer already gives the user options. We just set the default. Does Chocolatey just download & run the Go installer? I would assume it's a package manager so it packages things and manages things. Or does Chocolatey run it in some headless mode where the user doesn't need to click next next next next? Chocolatey could also just install the zip releases we make instead of the msi. |
Chocolatey packages can do either, but the maintained package for go downloads and runs the MSI. By default, chocolatey supports an
So we can hand off args to the MSI, but not if the MSI itself doesn't support it. It's true that the chocolatey package could switch the the zip as it's source, but then would have to deal with complications if you add additional steps that you take care of in the MSI. It would be ideal if you could support this, but if options aren't an option, then I will just have to do the install with lots of ansible instead. |
@lucastheisen, here's our wix file: https://github.com/golang/build/blob/4e9e211/cmd/release/releaselet.go#L596 What would we need to add? |
@bradfitz , didn't know you had the WIX embedded in the go code... Now that I look, you already support
Thanks! |
I think |
Has been fixed in https://golang.org/cl/283600 |
I believe this is closed by #42070. Please let me know if I am incorrect. |
What version of Go are you using (
go version
)?Haven't installed it yet, but 1.9.4.
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?Irrelevant.
What did you do?
Ran the installer and noticed the default install path.
What did you expect to see?
C:\Program Files\Go
or some other more conventional and common path to where the files should be installed.What did you see instead?
C:\Go
Comments
So, the default install path in the MSI installer is not great. Almost all software installers on Windows default to a base path of e.g.
C:\Program Files\
or similar. It has (arguably, I'm not going to provide specific sources for this) for long been considered pretty bad practice to install stuff directly underC:\
, and I haven't been able to find a reason as to why Go defaults to that location on Windows.There's a somewhat related issue in #21609, in which @as does have a point for his use case of the default path. However, overall I think that convention and sanity (in terms of not putting stuff in one big pile under
C:\
) weighs more than being able to use\go
as the path.@as also points out that the Windows folder structure lacks coherence, and I agree with that - there's some seriously stupid things in there, like the ones he gave an example of. However, there's at least some value to having a folder structure at all, e.g. all user-installed programs being under a common folder. Imagine if you installed everything and put all user files under
C:\
, what a mess it would be.So, I am asking, is there any specific reason that
C:\Go
was chosen as the default install path, rather than a more conventional one? If there's no very specific reason, why not change it to a more conventional default path on Windows?The text was updated successfully, but these errors were encountered: