Bug 771766 - Preserve the case of the application installation directory when replacing the application after an update for it has been staged; r=rstrong

This commit is contained in:
Ehsan Akhgari 2012-07-09 20:50:16 -04:00
parent adf6e16d58
commit ad10d0e5c3

View File

@ -1831,6 +1831,15 @@ ProcessReplaceRequest()
NS_tchar sourceDir[MAXPATHLEN];
NS_tsnprintf(sourceDir, sizeof(sourceDir)/sizeof(sourceDir[0]),
NS_T("%s/Contents"), installDir);
#elif XP_WIN
// Windows preserves the case of the file/directory names. We use the
// GetLongPathName API in order to get the correct case for the directory
// name, so that if the user has used a different case when launching the
// application, the installation directory's name does not change.
NS_tchar sourceDir[MAXPATHLEN];
if (!GetLongPathNameW(installDir, sourceDir, sizeof(sourceDir)/sizeof(sourceDir[0]))) {
return NO_INSTALLDIR_ERROR;
}
#else
NS_tchar* sourceDir = installDir;
#endif