http://bugs.winehq.org/show_bug.cgi?id=24924
Summary: DNAsp* crashes unless native MFC40.DLL is used. Product: Wine Version: 1.3.5 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: f.pinamartins@gmail.com
Created an attachment (id=31560) --> (http://bugs.winehq.org/attachment.cgi?id=31560) Console output
DNAsp installs fine, but won't run unless the file "MFC40.dll" is copied from the program dir to "c:/windows/system32". Attached it the console output and a screenshot of the resulting dialogue box.
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #1 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-27 16:44:33 CDT --- Created an attachment (id=31561) --> (http://bugs.winehq.org/attachment.cgi?id=31561) Dialogue box screenshot
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #2 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-27 16:46:12 CDT --- Almost forgot, here is the link to the AppDB entry. More information (download locations, etc...) can be found there.
http://appdb.winehq.org/objectManager.php?sClass=version&iId=19184
http://bugs.winehq.org/show_bug.cgi?id=24924
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |dank@kegel.com Resolution| |DUPLICATE
--- Comment #3 from Dan Kegel dank@kegel.com 2010-10-27 18:10:31 CDT --- The general topic is "wine could use an implementation of mfc", which is bug 657.
*** This bug has been marked as a duplicate of bug 657 ***
http://bugs.winehq.org/show_bug.cgi?id=24924
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Dmitry Timoshkov dmitry@codeweavers.com 2010-10-28 02:19:38 CDT --- Closing duplicate.
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #5 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-28 03:59:28 CDT --- OK, thanks for the explanations. I did search for bugs regarding MCF40.dll, but since they were closed I didn't find them. Just one thing regarding this specific bug: If the dll is provided by the app, why do I have to copy it to "C:/windows/system32"? Is this a DNAsp bug, in a way that it is not properly packaged?
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #6 from Dan Kegel dank@kegel.com 2010-10-28 06:47:13 CDT --- Apologies for not reading the second line of your description carefully. That part of the bug may be a dup of bug 14980, which we ought to fix someday but haven't really started on.
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #7 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-28 08:38:28 CDT --- No problem! Since bug 657 is a no go (at least from my point of view), as "MFC40.DLL" is an "extra" library, maybe this should be marked as a dupe of bug 14980, since DNAsp provides an easier test case than powerpoint (free download and all). Does it sound sensible to you?
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #8 from Dan Kegel dank@kegel.com 2010-10-28 12:25:37 CDT --- Yep, makes sense.
*** This bug has been marked as a duplicate of bug 14980 ***
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #9 from Rosanne DiMesio dimesio@earthlink.net 2010-10-28 13:42:48 CDT --- (In reply to comment #8)
Yep, makes sense.
*** This bug has been marked as a duplicate of bug 14980 ***
How is this a duplicate of bug 14980? The riched20 installed by Office does not have to be copied to system32 in order to work, the override just has to be set in winecfg, and that's because Wine has a builtin implementation of riched20 that it favors by default, which is not the case with mfc40.
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #10 from Dan Kegel dank@kegel.com 2010-10-28 15:06:58 CDT --- Ran fine for me. How do I trigger the crash?
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #11 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-28 17:04:02 CDT --- @Rosanne
The reason why I consider it a duplicate, despite the work arounds for the problems being different: In both cases, the apps come provided (or packaged with, not sure of the correct terminology here) with a library, that should be used regardless of what windows or wine provides. In both cases, when the program is run, this dll should be used instead of whatever it is that your system provides. In the case of powerpoint, riched20.dll is provided by windows (and wine), but the one that powerpoint provides should be the one to use. This happens in windows, but does not in wine (from what I understood, this could lead to the use of a lot of non-builtin libs, and mess other things up [please feel free to correct me, this is just my impression]). In the case of DNAsp, wine does not provide this dll (for reasons debated in bug 657) and it is not a core part of windows either, but the application automatically uses it's own MFC40.DLL under windows but does not under wine. In short: They are similar because in both cases, wine should use the DLL provided with the application and does not. They are different because wine provides an implementation of riched20.dll and does not provide a built-in MFC40.DLL. Hence the work arounds for these two situations are different.
I hope my reasoning is clear. Why do you think they should not be duplicates?
PS - I did not try to set an override to native in MFC40.DLL, but if my line of thinking is correct, it should also work, right? I will try that the moment I have a chance.
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #12 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-28 17:10:20 CDT --- @ Dan
How to trigger the crash using wine 1.3.5: Download version 5.10.00, available here: http://scguy318.freeshell.org/dnasp51000.msi The version in the website is more recent. I haven't tested it yet.
Create a new wine prefix and install DNAsp:
WINEPREFIX=~/wine.tmp wine msiexec /i dnasp51000.msi
Run DNAsp and I get a crash:
WINEPERFIX=~/wine.tmp wine ~/wine.tmp/drive_c/path/to/DNAsp.exe
It's working for you?
http://bugs.winehq.org/show_bug.cgi?id=24924
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|DUPLICATE |INVALID
--- Comment #13 from Dmitry Timoshkov dmitry@codeweavers.com 2010-10-28 22:13:18 CDT --- (In reply to comment #8)
Yep, makes sense.
*** This bug has been marked as a duplicate of bug 14980 ***
It doesn't make sense. A built-in replacement of mfc40.dll doesn't exist in Wine.
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #14 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-30 13:25:21 CDT --- @Rosanne
I have tested DNAsp using an override in winecfg and it does not work. Does this mean that the duplicate status is invalid and a new bug should be filed? Something more like: "Wine does not load dll's provided by applications automatically."
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #15 from Jeff Zaroyko jeffz@jeffz.name 2010-10-30 14:38:14 CDT --- (In reply to comment #12)
Run DNAsp and I get a crash:
What happens if you change directory to the install location before running DNAsp.exe?
cd ~/wine.tmp/drive_c/path/to/
WINEPERFIX=~/wine.tmp wine ~/wine.tmp/drive_c/path/to/DNAsp.exe
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #16 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-30 15:36:55 CDT --- @Jeff
Running DNAsp from it's directory (like you suggested) works fine, without copying MFC40.dll to c:/windows/system32.
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #17 from Dan Kegel dank@kegel.com 2010-10-30 15:39:14 CDT --- I bet that's how it behaves in Windows, too.
If it behaves differently in real Windows, i.e. if in a cmd session on real windows you do
c: cd \ path\to\DNAsp.exe
and it fails, then this bug is well and truly invalid.
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #18 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-30 16:11:59 CDT --- Just ran DNAsp in a VM. Starting cmd and doing: cd \ path\to\DNAsp.exe
Works. So it's not the same behaviour. I will try to figure out if this copy of XP has MFC40.dll installed. If it does, it might be the reason it's not failing. I'll report back once I have more info.
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #19 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-30 16:14:52 CDT --- MFC40.dll was installed, but after deleting it from C:\Windows\system32 and repeating the above procedure the program still works...
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #20 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-30 16:21:37 CDT --- Sorry about all these posts. It turns out that windows restores mfc40.dll in "c:\windows\system32" after I delete it or replace it with another file...
I guess I cannot reliably test it this way...
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #21 from Jeff Zaroyko jeffz@jeffz.name 2010-10-30 16:46:01 CDT --- (In reply to comment #20)
Sorry about all these posts. It turns out that windows restores mfc40.dll in "c:\windows\system32" after I delete it or replace it with another file...
I guess I cannot reliably test it this way...
For future reference:
http://wiki.winehq.org/FAQ#head-3b297df7a5411abe2b8d37fead01a2b8edc21619
Many applications don't bother to check their own cwd, since 99.999% of the time they are started via a shortcut on Windows which specifies the working directory to be automatically set when the executable is run. Or if they are launched from explorer then the working directory is the folder that is open/displaying the executable which you've clicked on.
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #22 from Francisco Pina Martins f.pinamartins@gmail.com 2010-10-30 16:57:46 CDT --- Thanks for the link, Jeff.
I guess this settles it then?
http://bugs.winehq.org/show_bug.cgi?id=24924
--- Comment #23 from Jeff Zaroyko jeffz@jeffz.name 2010-10-30 17:09:07 CDT --- (In reply to comment #22)
Thanks for the link, Jeff.
I guess this settles it then?
Yes. It's up to the author of the program to decide if this is desired behavior or not.
Any application programmers who want to force the cwd to the application directory usually use a combination of GetModuleFileName and SetWorkingDirectory, or a combination of GetModuleFileName and SetDllDirectory.