5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 08:10:56 +08:00

Fix icon issues with windows when project name contains spaces (#3400)

* fix icon issues with windows when project name contains spaces

* add comment

* add to change log

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
Andrey Pshenkin 2024-04-29 22:59:04 +01:00 committed by GitHub
parent 9a039b1dc9
commit b8dae7a6e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View File

@ -258,7 +258,7 @@ func execBuildApplication(builder Builder, options *Options) (string, error) {
// When we finish, we will want to remove the syso file
defer func() {
err := os.Remove(filepath.Join(options.ProjectData.Path, options.ProjectData.Name+"-res.syso"))
err := os.Remove(filepath.Join(options.ProjectData.Path, strings.ReplaceAll(options.ProjectData.Name, " ", "_")+"-res.syso"))
if err != nil {
fatal(err.Error())
}

View File

@ -6,6 +6,7 @@ import (
"image"
"os"
"path/filepath"
"strings"
"github.com/leaanthony/winicon"
"github.com/tc-hib/winres"
@ -274,7 +275,8 @@ func compileResources(options *Options) error {
rs.SetVersionInfo(v)
}
targetFile := filepath.Join(options.ProjectData.Path, options.ProjectData.Name+"-res.syso")
// replace spaces with underscores as go build behaves weirdly with spaces in syso filename
targetFile := filepath.Join(options.ProjectData.Path, strings.ReplaceAll(options.ProjectData.Name, " ", "_")+"-res.syso")
fout, err := os.Create(targetFile)
if err != nil {
return err

View File

@ -14,6 +14,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
### Fixed
- Fixed an issue with missing icon for Windows. Fixed by [@APshenkin](https://github.com/wailsapp/wails/pull/3400)
### Changed
## v2.8.1 - 2024-04-11
### Added