https://bugs.winehq.org/show_bug.cgi?id=35809
Bug ID: 35809 Summary: Avoid deletion of precious (empty) folders such as '%USERPROFILE%\Application Data' during MSI product upgrades/uninstalls Product: Wine Version: 1.7.14 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: tools Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net
Hello folks,
found this while investigating some issues with Aeria Game Launcher (https://www.aeriagames.com/playnow/ignite).
Aeria requires .NET Framework 3.5 installed. After applying 'wintricks -q dotnet35' recipe to a fresh 32-bit WINEPREFIX the 'Aeria Ignite' installer silently fails.
The reason is that some folders such as '%USERPROFILE%\Application Data' are completely missing and the installer fails to put some files below that.
Those folders are created during WINEPREFIX creation (wineboot). Deletion afterwards won't let them get recreated (prefix update).
Further investigation reveals this happens during .NET Framework service pack recipe runs where products to be upgraded are uninstalled (expected, by design).
Example: .NET Framework 2.0 -> .NET Framework 2.0 SP1
--- snip --- ... 0028:Call KERNEL32.CreateProcessW(00000000,0171b210 L"msiexec /i {7131646D-CD3C-40F4-97B9-CD9E4E6262EF} REMOVE=ALL",00000000,00000000,00000000,00000000,00000000,00000000,0033d0d8,0033d0c8) ret=7dac3509 ... 008d:Call KERNEL32.__wine_kernel_init() ret=7bc5a3aa 0028:Ret KERNEL32.CreateProcessW() retval=00000001 ret=7dac3509 ... 008d:trace:msi:ACTION_PerformUIAction Performing action (L"RemoveFiles") ... 008d:trace:msi:ACTION_PerformUIAction Performing action (L"RemoveFolders") ... <*** attempted removal of lots of folders, even precious ones ***> ... 008d:trace:msi:ACTION_PerformUIAction Performing action (L"CreateFolders") ... 008d:trace:msi:ACTION_PerformUIAction Performing action (L"InstallFiles") ... 008d:trace:msi:ACTION_PerformUIAction Performing action (L"PublishProduct") ... 008d:trace:msi:ACTION_PerformUIAction Performing action (L"InstallFinalize") ... 008d:Call msi.MsiConfigureProductExW(00139a96 L"{7131646D-CD3C-40F4-97B9-CD9E4E6262EF}",00000000,00000005,00136340 L" REMOVE=ALL") ret=7edefa60 008d:Call KERNEL32.DeleteFileW(00159bd0 L"C:\windows\Installer\14bc.msi") ret=7ed19d6f 008d:Ret KERNEL32.DeleteFileW() retval=00000001 ret=7ed19d6f ... 008d:Ret msi.MsiConfigureProductExW() retval=00000000 ret=7edefa60 008d:Call KERNEL32.ExitProcess(00000000) ret=7edf0282 ... --- snip ---
I filtered only the successful deletions (= folder was empty):
--- snip --- $ grep -B1 "KERNEL32.RemoveDirectoryW() retval=00000001" log.txt ... 0028:Call KERNEL32.RemoveDirectoryW(0066d2e0 L"C:\users\focht\Temp\testdir.dir") ret=3ab16b39 0028:Ret KERNEL32.RemoveDirectoryW() retval=00000001 ret=3ab16b39 -- 0028:Call KERNEL32.RemoveDirectoryW(00681970 L"C:\users\focht\Temp\Microsoft .NET Framework 3.5") ret=3ab1709a 0028:Ret KERNEL32.RemoveDirectoryW() retval=00000001 ret=3ab1709a -- 008d:Call KERNEL32.RemoveDirectoryW(0057e808 L"C:\users\focht\Application Data\") ret=7ecfd3d8 008d:Ret KERNEL32.RemoveDirectoryW() retval=00000001 ret=7ecfd3d8 -- 008d:Call KERNEL32.RemoveDirectoryW(00176ee8 L"C:\users\focht\Start Menu\Programs\Administrative Tools\") ret=7ecfd3d8 008d:Ret KERNEL32.RemoveDirectoryW() retval=00000001 ret=7ecfd3d8 -- 008d:Call KERNEL32.RemoveDirectoryW(005c70e8 L"C:\windows\Microsoft.NET\Framework\v2.0.50727\Microsoft .NET Framework 2.0\") ret=7ecfd3d8 008d:Ret KERNEL32.RemoveDirectoryW() retval=00000001 ret=7ecfd3d8 -- 008d:Call KERNEL32.RemoveDirectoryW(005c5178 L"C:\users\focht\Local Settings\Application Data\") ret=7ecfd3d8 008d:Ret KERNEL32.RemoveDirectoryW() retval=00000001 ret=7ecfd3d8 -- 008d:Call KERNEL32.RemoveDirectoryW(005c4938 L"C:\windows\PCHEALTH\ERRORREP\QHEADLES\") ret=7ecbd63d 008d:Ret KERNEL32.RemoveDirectoryW() retval=00000001 ret=7ecbd63d 008d:Call KERNEL32.RemoveDirectoryW(005c4b50 L"C:\windows\PCHEALTH\ERRORREP\QSIGNOFF\") ret=7ecbd63d 008d:Ret KERNEL32.RemoveDirectoryW() retval=00000001 ret=7ecbd63d 008d:Call KERNEL32.RemoveDirectoryW(005c4ab0 L"C:\windows\PCHEALTH\ERRORREP\") ret=7ecbd63d 008d:Ret KERNEL32.RemoveDirectoryW() retval=00000001 ret=7ecbd63d 008d:Call KERNEL32.RemoveDirectoryW(005c42f8 L"C:\windows\PCHEALTH\") ret=7ecbd63d 008d:Ret KERNEL32.RemoveDirectoryW() retval=00000001 ret=7ecbd63d -- 0028:Call KERNEL32.RemoveDirectoryW(0033de50 L"C:\users\focht\Temp\IXP04D49.tmp") ret=3a1047e9 0028:Ret KERNEL32.RemoveDirectoryW() retval=00000001 ret=3a1047e9 --- snip ---
Some folders are essential for many installers/apps. Deletion will cause subtle problems on further software installations (the actual apps) or at run time.
Especially true for:
'%USERPROFILE%\Application Data' '%USERPROFILE%\Local Settings\Application Data'
Those are precious and need to be preserved. On Windows this scenario never happens because there always exist dozen of subfolders below by default.
A quick fix would be the creation of (empty) subfolder below, for example 'Microsoft' which is present on all Windows systems by default. This prevents the deletion of the parent.
Another option is to fix bugs like bug 34910 which needs '%USERPROFILE%\Application Data\Microsoft\Windows\Themes\' folder present, which would automatically thwart the folder deletion attempt.
Regards