wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
24.42k stars 1.17k forks source link

v2.9.1 runtime.OpenFileDialog in win10/win11 will crash #3699

Closed scp-66 closed 2 weeks ago

scp-66 commented 3 weeks ago

Description

func (a *App) Upload(sid uint32, dst string) error {
    return control.Upload(a.ctx, sid, dst)
}

func Upload(ctx context.Context, sid uint32, dst string) error {
    home, err := os.UserHomeDir()
    if err != nil {
        return err
    }
    uploadOptions := runtime.OpenDialogOptions{
        Title:            "Upload File",
        DefaultDirectory: filepath.Join(home, "Desktop"),
    }
    fmt.Println(filepath.Join(home, "Desktop"))
    src, _ := runtime.OpenFileDialog(ctx, uploadOptions)
    ...
}

This is my code.It will crash at runtime.OpenFileDialog.

To Reproduce

1.call this function by click. 2.the app crashed.

Expected behaviour

Open a file dialog to select a file.

Screenshots

No response

Attempted Fixes

I'm sure my DefaultDirectory is existed.Then I delete all of runtime.OpenDialogOptions.But It's still crashed

System Details

Version | v2.9.1

# System
┌─────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                                           |
| Version      | 2009 (Build: 22631)                                                      |
| ID           | 23H2                                                                     |
| Go Version   | go1.23.0                                                                 |
| Platform     | windows                                                                  |
| Architecture | amd64                                                                    |
| CPU          | 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz                           |
| GPU 1        | Intel(R) Iris(R) Xe Graphics (Intel Corporation) - Driver: 32.0.101.5768 |
| GPU 2        | Microsoft Remote Display Adapter (Microsoft) - Driver: 10.0.22621.3672   |
| Memory       | 32GB                                                                     |
└─────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version        |
| WebView2   | N/A          | Installed | 127.0.2651.105 |
| Nodejs     | N/A          | Installed | 20.16.0        |
| npm        | N/A          | Installed | 10.2.3         |
| *upx       | N/A          | Available |                |
| *nsis      | N/A          | Available |                |
└─────────────── * - Optional Dependency ────────────────┘

Additional context

No response

scp-66 commented 3 weeks ago

I also try it on my other cmp without any software.But is's still crashed

scp-66 commented 3 weeks ago

Fine.It's ok with golang 1.22.6. Terrible go 1.23.0!!!

StephanMa commented 3 weeks ago

Same with latest 2.8. wails release.... Had to revert to 1.22.6 Funny Thing... it works fine on Mac... but same App doesn't run on Windows.

lsrKids commented 2 weeks ago

me too. runtime.OpenDirectoryDialog still crashed.

levinit commented 2 weeks ago

Must downgrade go SDK to 1.22.6...

xray-bit commented 2 weeks ago

same as #3681

leaanthony commented 2 weeks ago

Moving the conversation to #3681