Skip to content

Commit c44e43e

Browse files
committed
[MSI] HACK Fix MS Office Destroying Tahoma Fonts
CORE-19789
1 parent 1b46029 commit c44e43e

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

dll/win32/msi/files.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,43 @@ static BOOL copy_file( MSIPACKAGE *package, const WCHAR *src, const WCHAR *dst,
7171
{
7272
BOOL ret;
7373
msi_disable_fs_redirection( package );
74+
#ifdef __REACTOS__
75+
/* HACK: Protect Tahoma.ttf and Tahomabd.ttf from overwrites
76+
* until next reboot. See CORE-19789. */
77+
WCHAR PathWin[MAX_PATH];
78+
WCHAR PathTahoma[MAX_PATH] = { 0 };
79+
WCHAR PathTahomabd[MAX_PATH] = { 0 };
80+
WCHAR PathTmp[MAX_PATH];
81+
82+
GetSystemWindowsDirectoryW(PathWin, MAX_PATH);
83+
wcscat(PathTahoma, PathWin);
84+
wcscat(PathTahoma, L"\\Fonts\\TAHOMA.TTF");
85+
wcscat(PathTahomabd, PathWin);
86+
wcscat(PathTahomabd, L"\\Fonts\\TAHOMABD.TTF");
87+
88+
if (_wcsicmp(dst, PathTahoma) == 0)
89+
{
90+
ERR("HACK. Should be using WFP or SFC\n");
91+
wcscpy(PathTmp, PathWin);
92+
wcscat(PathTmp, L"\\Fonts\\TAHOMA.tmp");
93+
ret = CopyFileW( src, PathTmp, FALSE);
94+
MoveFileExW(PathTahoma, NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
95+
MoveFileExW(PathTmp, PathTahoma, MOVEFILE_DELAY_UNTIL_REBOOT);
96+
}
97+
else if (_wcsicmp(dst, PathTahomabd) == 0)
98+
{
99+
ERR("HACK. Should be using WFP or SFC\n");
100+
wcscpy(PathTmp, PathWin);
101+
wcscat(PathTmp, L"\\Fonts\\TAHOMABD.tmp");
102+
ret = CopyFileW( src, PathTmp, FALSE);
103+
MoveFileExW(PathTahomabd, NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
104+
MoveFileExW(PathTmp, PathTahomabd, MOVEFILE_DELAY_UNTIL_REBOOT);
105+
}
106+
else
107+
ret = CopyFileW( src, dst, fail_if_exists );
108+
#else
74109
ret = CopyFileW( src, dst, fail_if_exists );
110+
#endif
75111
msi_revert_fs_redirection( package );
76112
return ret;
77113
}

0 commit comments

Comments
 (0)