Ensure default icon is generated regardless of icon.ico availability

This commit is contained in:
Lea Anthony
2022-03-14 22:35:21 +11:00
parent 97b24a51a1
commit 9c5600d8f3
2 changed files with 5 additions and 6 deletions
+4 -5
View File
@@ -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
+1 -1
View File
@@ -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.