mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 19:01:02 +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:
parent
9a039b1dc9
commit
b8dae7a6e2
@ -258,7 +258,7 @@ func execBuildApplication(builder Builder, options *Options) (string, error) {
|
|||||||
|
|
||||||
// When we finish, we will want to remove the syso file
|
// When we finish, we will want to remove the syso file
|
||||||
defer func() {
|
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 {
|
if err != nil {
|
||||||
fatal(err.Error())
|
fatal(err.Error())
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"image"
|
"image"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/leaanthony/winicon"
|
"github.com/leaanthony/winicon"
|
||||||
"github.com/tc-hib/winres"
|
"github.com/tc-hib/winres"
|
||||||
@ -274,7 +275,8 @@ func compileResources(options *Options) error {
|
|||||||
rs.SetVersionInfo(v)
|
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)
|
fout, err := os.Create(targetFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -14,6 +14,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [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
|
## v2.8.1 - 2024-04-11
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
Loading…
Reference in New Issue
Block a user