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 16:59:04 -05:00
committed by GitHub
co-authored by Lea Anthony
parent 9a039b1dc9
commit b8dae7a6e2
3 changed files with 11 additions and 2 deletions
+1 -1
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())
}
+3 -1
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
+7
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