From 9c5600d8f3a1cdfd1c500ad934099115d6885af6 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 14 Mar 2022 22:35:21 +1100 Subject: [PATCH] Ensure default icon is generated regardless of icon.ico availability --- v2/pkg/commands/build/packager.go | 9 ++++----- website/docs/guides/manual-builds.mdx | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/v2/pkg/commands/build/packager.go b/v2/pkg/commands/build/packager.go index 2bf18914..601f297f 100644 --- a/v2/pkg/commands/build/packager.go +++ b/v2/pkg/commands/build/packager.go @@ -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 diff --git a/website/docs/guides/manual-builds.mdx b/website/docs/guides/manual-builds.mdx index 9d525314..e6215ee7 100644 --- a/website/docs/guides/manual-builds.mdx +++ b/website/docs/guides/manual-builds.mdx @@ -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/.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.