Skip to content
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

proposal: command line flag for go build to add icon for windows executable #38509

Open
pjebs opened this issue Apr 17, 2020 · 3 comments
Open

proposal: command line flag for go build to add icon for windows executable #38509

pjebs opened this issue Apr 17, 2020 · 3 comments
Milestone

Comments

@pjebs
Copy link
Contributor

@pjebs pjebs commented Apr 17, 2020

There should be a command line flag to go build to add an icon to the executable file.

@gopherbot gopherbot added this to the Proposal milestone Apr 17, 2020
@gopherbot gopherbot added the Proposal label Apr 17, 2020
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Apr 17, 2020

I would guess that you can do this by adding a file with a .syso extension with an appropriate resource section. That seems more convenient than a go build option, since it will work even if you forget to use the command line option.

@ianlancetaylor ianlancetaylor changed the title Proposal: command line flag for go build to add icon for windows executable proposal: command line flag for go build to add icon for windows executable Apr 17, 2020
@pjebs
Copy link
Contributor Author

@pjebs pjebs commented Apr 23, 2020

A syso file can be used to embed all sorts of different resources and not just an icon.
I assume adding an icon would be the overwhelming use-case. Generating a sysco file using an external application such as https://github.com/josephspurrier/goversioninfo would be overkill if one merely wants to add an icon and nothing else.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Apr 23, 2020

I don't understand why generating a .syso file is overkill. Sure, it can do a lot more than add an icon. So what? If you want to add an icon, you have to have an icon file. It's one more command, run exactly once, to turn that icon file into a .syso file. Then you're done.

A .syso file has another advantage: it is always there, so you don't have to add a command line option when you run go build or go install. It just works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.