mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Ensure default icon is generated regardless of icon.ico availability
This commit is contained in:
@@ -195,14 +195,13 @@ func generateManifest(options *Options) error {
|
||||
}
|
||||
|
||||
func generateIcoFile(options *Options) error {
|
||||
content, err := buildassets.ReadFile(options.ProjectData, "appicon.png")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Check ico file exists already
|
||||
icoFile := buildassets.GetLocalPath(options.ProjectData, "windows/icon.ico")
|
||||
if !fs.FileExists(icoFile) {
|
||||
content, err := buildassets.ReadFile(options.ProjectData, "appicon.png")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if dir := filepath.Dir(icoFile); !fs.DirExists(dir) {
|
||||
if err := fs.MkDirs(dir, 0755); err != nil {
|
||||
return err
|
||||
|
||||
@@ -57,7 +57,7 @@ This step could be done from the command line or a script with `npm run build` o
|
||||
|
||||
##### Windows
|
||||
|
||||
- It creates icon sizes of 256, 128, 64, 48, 32 and 16. This is done using [winicon](https://github.com/leaanthony/winicon).
|
||||
- If `build/windows/icon.ico` does not exist, it will create it from `build/appicon.png` using icon sizes of 256, 128, 64, 48, 32 and 16. This is done using [winicon](https://github.com/leaanthony/winicon).
|
||||
- If the `build/windows/<projectname>.manifest` file does not exist, it creates it from a default version.
|
||||
- Compiles the application as a production build (above)
|
||||
- Uses [winres](https://github.com/tc-hib/winres) to bundle the icon and manifest into a `.syso` file ready for linking.
|
||||
|
||||
Reference in New Issue
Block a user