fyne-io/fyne
View on GitHubRunning app in C:\Windows\System32 gives the error `rundll32 resolves to executable in current directory (.\rundll32.exe)`
Open
#3,342 opened on Oct 18, 2022
Hacktoberfestbug
Repository metrics
- Stars
- (28,262 stars)
- PR merge metrics
- (Avg merge 26d 11h) (38 merged PRs in 30d)
Description
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