https://bugs.winehq.org/show_bug.cgi?id=50099
Bug ID: 50099 Summary: .Net GetFullPath not working correctly Product: Wine Version: 5.0.2 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: grimessa@gmail.com Distribution: ---
I have an application I wrote myself in C#.
It works perfectly on Windows.
However it is not working in wine. The application tries to load sound files to play from a subfolder of where the exe is. So the code uses GetFullPath method to get the absolute path from a relative path string.
I am not using Mono, it is using Native .Net.
GetFullPath is a static method of the Path class, which is part of .Net in System.IO namespace.
The application I am running is running from this path in the WineBottle MyWineBottle/drive_c/MyApp/App.exe
So when calling string path = System.IO.Path.GetFullPath(@"Sounds\1.wav"); The expected path should be: C:\MyApp\Sounds\1.wav
However, it returns this instead D:\home\grimes\Sounds\1.wav (grimes is my username)
This does not seem correct. I am not sure why it is returning the Path from the D drive. There does not seem to be one in the winebottle anyway.
I am new to Wine(and linux) so let me know if there might be config I may have overlooked.
Here are the details of my system Linux Mint 19.3 Tricia Wine 5.0.2 .Net 4.6.1 WINEARCH=win32
https://bugs.winehq.org/show_bug.cgi?id=50099
--- Comment #1 from Grimes grimessa@gmail.com --- I said there isnt a D drive, but I see there is. It is just not configured and is '/'.
If I configure the D drive of the Winebottle using winecfg, to be a folder "../drive_d", like how the default c drive is, then the GetFullPath returns this Z:\home\grimes\Sounds\1.wav
looking for it on the Z drive.
https://bugs.winehq.org/show_bug.cgi?id=50099
--- Comment #2 from Alexandre Julliard julliard@winehq.org --- Probably you are running your app from the shell, so it inherits the current directory from there. If you want the cwd to be the app dir, you have to set it explicitly (cd MyWineBottle/drive_c/MyApp; wine App.exe). I expect that you'd see the same thing on Windows if you run it from the command line.
https://bugs.winehq.org/show_bug.cgi?id=50099
Grimes grimessa@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID
--- Comment #3 from Grimes grimessa@gmail.com --- Thanks Alexandre, you are correct. Changing the current directory fixed it.
https://bugs.winehq.org/show_bug.cgi?id=50099
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Austin English austinenglish@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=50099
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |RESOLVED
--- Comment #5 from Austin English austinenglish@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=50099
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Gijs Vermeulen gijsvrm@gmail.com --- Closing INVALID.