http://bugs.winehq.org/show_bug.cgi?id=58636
Bug ID: 58636 Summary: CapCut installer fails: CreateFileW with FILE_ATTRIBUTE_DIRECTORY | FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_POSIX_SEMANTICS should create a directory instesd of a file. Product: Wine Version: 10.13 Hardware: x86-64 URL: https://lf16-capcut.faceulv.com/obj/capcutpc-packages- us/packages/CapCut_6_9_0_2786_capcutpc_0_creatortool.e xe OS: Linux Status: NEW Keywords: download, source Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: xerox.xerox2000x@gmail.com Distribution: Debian
I tried the installer from bugreport https://bugs.winehq.org/show_bug.cgi?id=58635 but it fails instantly with a error messagebox.
I think I managed to track down the bug:
The installer does: KERNEL32.CreateFileW(0012f4c4 L"C:\users\louis\AppData\Local\\CapCut",00000001,00000003,00000000,00000001,03000010,00000000)
Then an empty file "CapCut" is present in Appdata\Local\ dir.
After that it tries to create L"C:\users\louis\AppData\Local\CapCut\User Data" and L"C:\users\louis\AppData\Local\CapCut\User Data\Log" in which Log is a file. This all fails as a file CapCut is already present.
Manual workaround to fool the installer: mkdir ~/.wine/drive_c/users/**/AppData/Local/CapCut before you start the installer, then it won't crash.
Apparently on windows one can create a directory with CreateFile with the flags used by the installer; below is a simple test program I tested on windows and that creates a directory:
#include <windows.h> #include <stdio.h> #include <shlwapi.h>
// compile: x86_64-w64-mingw32-gcc a.c -lshlwapi
int main() { char path[] = "c:\log";
HANDLE h = CreateFileA( path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_DIRECTORY | FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_POSIX_SEMANTICS , // 0x03000010, NULL);
if (h == INVALID_HANDLE_VALUE) { DWORD err = GetLastError(); printf("err %d\n", err); return 1; }
printf("%p\n", h);
BOOL ret = PathIsDirectoryA(path);
printf("PathIsDirectoryA returned %d\n",ret);
return 0; }
Output on windows:
00000000000000c0 PathIsDirectoryA returned 16
Output on wine: 000000000000005c PathIsDirectoryA returned 0
http://bugs.winehq.org/show_bug.cgi?id=58636
--- Comment #1 from Dmitry Timoshkov dmitry@baikal.ru --- Created attachment 79197 --> http://bugs.winehq.org/attachment.cgi?id=79197 patch
Does the attached patch help?
http://bugs.winehq.org/show_bug.cgi?id=58636
--- Comment #2 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to Dmitry Timoshkov from comment #1)
Created attachment 79197 [details] patch
Does the attached patch help?
Hi Dmitry, thanks for looking into this, the patch fixes the bug indeed and the installer now successfully completes!
(See below also that with your patch directory structure is correct now):
ls -al drive_c/users/louis/AppData/Local/CapCut/ total 16 drwxrwxr-x 4 louis louis 4096 Aug 26 22:16 . drwxrwxr-x 5 louis louis 4096 Aug 26 22:16 .. drwxrwxr-x 4 louis louis 4096 Aug 26 22:18 Apps drwxrwxr-x 5 louis louis 4096 Aug 26 22:18 'User Data'
http://bugs.winehq.org/show_bug.cgi?id=58636
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |cf0a1f531c419d1307a8df6f406 | |ce711ae511374
--- Comment #3 from Dmitry Timoshkov dmitry@baikal.ru --- This should be fixed by cf0a1f531c419d1307a8df6f406ce711ae511374.
http://bugs.winehq.org/show_bug.cgi?id=58636
--- Comment #4 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to Dmitry Timoshkov from comment #3)
This should be fixed by cf0a1f531c419d1307a8df6f406ce711ae511374.
Yes, it's fixed, thanks for the quick fix!