mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 00:41:59 +08:00
Update icon.ico file mode (#1154)
* Add os.O_WRONLY to icon.ico to avoid bad file descriptor error * Wrap errors coming from winres.LoadICO() If the file exists but is empty, a blunt "Unexpected EOF" is returned, and propagated as is. This is not super helpful when trying to pin point what's going on. Wrapping the error helps to locate the problem.
This commit is contained in:
parent
f923a431f7
commit
e6424dc8ab
@ -260,7 +260,7 @@ func generateIcoFile(options *Options) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
output, err := os.OpenFile(icoFile, os.O_CREATE, 0644)
|
||||
output, err := os.OpenFile(icoFile, os.O_CREATE|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -295,7 +295,7 @@ func compileResources(options *Options) error {
|
||||
defer iconFile.Close()
|
||||
ico, err := winres.LoadICO(iconFile)
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("couldn't load icon from icon.ico: %w", err)
|
||||
}
|
||||
err = rs.SetIcon(winres.RT_ICON, ico)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user