fyne-io/fyne
在 GitHub 查看Running app in C:\Windows\System32 gives the error `rundll32 resolves to executable in current directory (.\rundll32.exe)`
Open
#3,342 创建于 2022年10月18日
Hacktoberfestbug
仓库指标
- Star
- (28,262 star)
- PR 合并指标
- (平均合并 26天 11小时) (30 天内合并 38 个 PR)
描述
Checklist
- I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
- This issue only relates to a single bug. I will open new issues for any other problems.
Describe the bug
Running app in C:\Windows\System32 gives the error rundll32 resolves to executable in current directory (.\rundll32.exe)
The code calls fyne.CurrentApp().OpenURL(url)
Which hits this code (windows):
func (a *fyneApp) OpenURL(url *url.URL) error {
cmd := a.exec("rundll32", "url.dll,FileProtocolHandler", url.String())
cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr
return cmd.Run()
}
But with the go 1.19 changes to PATH lookups this fails. The same error will happen for all other fyne calls to "rundll32". I assume the fix is to reference the full path to it: "C:\Windows\System32\rundll32"
See https://go.dev/doc/go1.19 - PATH lookups for details.
How to reproduce
- Create fyne app with golang 1.19 on Windows that calls
fyne.CurrentApp().OpenURL(url) - Run the app with the working directory as
C:\Windows\System32 - Notice the error.
Screenshots
No response
Example code
fyne.CurrentApp().OpenURL(url)
Fyne version
2.2.3
Go compiler version
1.19.1
Operating system
Windows
Operating system version
Windows 10
Additional Information
No response