mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07: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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user