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

Building for windows fails to add icon #66

Closed
zivoy opened this issue Sep 10, 2021 · 1 comment
Closed

Building for windows fails to add icon #66

zivoy opened this issue Sep 10, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@zivoy
Copy link

zivoy commented Sep 10, 2021

When building for windows, some projects fail to add the icon to the exe file. Doesn't matter if building for x64 or x86 or when building from a different machine.

The project that it doesn't work on is my [email protected]
it has a structure that is something like

BeatList/
 | - cmd/
 |    | - gui/
 | - fyne-cross/
 |    | - tmp/
 |    | - bin/
 |    | - dist/ 
 | - Icon.png
 | - go.mod

When building with a working dir of BeatList with fyne-cross windows ./cmd/gui it works fine and it generates the exe file, but it doesn't add the icon to the exe file.
The ico file is generated in the temp folder of fyne-cross but it just doesn't get applied to the exe.
I have another project I'm working with a very similar structure, only difference being that the base dir and the dir in cmd have the same name, it is working perfectly and the icon gets applied to the exe, so I tried renaming the folder in this project to be the same as the base dir to no effect.

If I go into the gui dir and use fyne package then it works fine and generates an icon with the exe,

in the end
I did manage to get fyne cross to compile the exe with an icon, but I had to make another go mod file in the gui dir and move the Icon png to the gui dir (v0.1.3)

note: for the full build script I used you can check the bash script in the scripts dir on both versions

fyne-cross version v1.1.0
fyne version v2.0.4

I talked about this in the gophers discord as well and @andydotxyz mentioned a person with the same issue on the slack

lucor added a commit to lucor/fyne-io-fyne-cross that referenced this issue Oct 6, 2021
The windows resource file (syso) need to be into the package root to be linked automatically by the compiler.

This commit copies the syso file into the package root after it is created.

Fixes fyne-io#66
@lucor lucor added the bug Something isn't working label Oct 6, 2021
@lucor lucor self-assigned this Oct 6, 2021
@lucor
Copy link
Member

lucor commented Oct 7, 2021

Thanks for reporting.
A fix is now available on develop for testing.

@lucor lucor closed this as completed Oct 7, 2021
@lucor lucor mentioned this issue Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants