https://bugs.winehq.org/show_bug.cgi?id=48902
Bug ID: 48902 Summary: Warframe launcher fails to replace updated Launcher.exe the first time (works when Retry option pressed, as Launcher.exe deleted first time) Product: Wine Version: 5.4 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: wine.bugzilla@johnthomson.fastmail.com.au Distribution: ---
Created attachment 66856 --> https://bugs.winehq.org/attachment.cgi?id=66856 trace+file,trace+ntdll,trace+server,+relay truncated
Warframe launcher When a Launcher.exe update is available, the update will be downloaded and extracted as Launcher.exe.tmp. Then replace Launcher.exe with Launcher.exe.tmp. This is first attempted with MoveFileEx, then MoveFileWithProgressW Launcher.exe.tmp Launcher.exe nil nil 0001 (MOVEFILE_REPLACE_EXISTING)
The game's user/Local\ Settings/Application\ Data/Warframe/Launcher.log shows these errors: MoveFileEx 0x5 Access denied ReplaceFile 0x497 Unable to remove the file to be replaced
In moving the replaced file out of the way, a temp file is created, and the replaced file is moved to this temp file This temp file is then deleted with: NtCreateFile(&hFile, SYNCHRONIZE | DELETE, //access mask &attr, &io, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, //sharing FILE_OPEN, //disposition FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, //options NULL, 0);
This fails in server/fd.c check_sharing if ((existing_access & FILE_MAPPING_IMAGE) && (options & FILE_DELETE_ON_CLOSE)) return STATUS_CANNOT_DELETE; A printf here showed: existing_access=2684354560 FILE_MAPPING_IMAGE=80000000 options=00001040 FILE_DELETE_ON_CLOSE=00001000
Launcher.exe is no longer in place, as it was moved to the temp file. Launcher.exe.tmp remains.
The launcher shows an error about this replacement failure, with a retry option. The replacement works at retry, because the Launcher.exe file no longer exists.