http://bugs.winehq.org/show_bug.cgi?id=29232
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net Component|-unknown |kernel32 Summary|SimCity 4: installers fail |SimCity 4: installers fail |to advance progress bar and |to advance progress bar and |also remains on 0.00% all |also remains on 0.00% all |the time |the time | |(kernel32.CopyFileExW needs | |to support | |callback/progress routine)
--- Comment #7 from Anastasius Focht focht@gmx.net 2012-05-13 11:03:40 CDT --- Hello Wylda,
good you brought this up. I actually had this bug some months ago on my screen when I worked on the copy protection part (SafeDisc 2.x) but it fell out of my queue ...
The reason for progress bar not updating is Wine not supporting copy progress callback.
CopyFileExA,W and MoveFileWithProgressA/W
The installer calls CopyFileExA with a callback and user pointer and expects it to be called to synchronize it's user interface.
--- snip --- 002b:Call KERNEL32.CopyFileExA(008cd70c "D:\Support\SimCity 4_EZ.exe",008cdd24 "C:\Program Files\Maxis\SimCity 4\Support\SimCity 4_EZ.exe",0040ad60,008cde88,00441d2c,00000000) ret=0040ed8e ... 002b:Ret KERNEL32.CopyFileExA() retval=00000001 ret=0040ed8e ... --- snip ---
Source: http://source.winehq.org/git/wine.git/blob/b5a33dab886df6352011457932713ed32...
--- snip --- 1022 BOOL WINAPI CopyFileExW(LPCWSTR sourceFilename, LPCWSTR destFilename, 1023 LPPROGRESS_ROUTINE progressRoutine, LPVOID appData, 1024 LPBOOL cancelFlagPointer, DWORD copyFlags) 1025 { 1026 /* 1027 * Interpret the only flag that CopyFile can interpret. 1028 */ 1029 return CopyFileW(sourceFilename, destFilename, (copyFlags & COPY_FILE_FAIL_IF_EXISTS) != 0); 1030 } --- snip ---
To verify my hypothesis I did a small short-circuit implementation of progress callback in CopyFileExW.
I added a call of user supplied callback *after* CopyFileW(), supplying source file size as total and transferred size and filled additional parameters with sane values. This call fixed the user interface issue. The progress bar advanced and the "percentage" static control was properly updated.
I encountered more installers with this problem, maybe when I remember them I'll add them here.
Regards