зеркало из https://github.com/mozilla/gecko-dev.git
fixing bug 90159 - Uninstall does not complete when run while Mozilla,N6 running in turbo mode. r=syd,dveditz sr=mscott. affects windows platforms only
This commit is contained in:
Родитель
be36f3d342
Коммит
a7661ff3a9
|
@ -81,14 +81,14 @@ print "\n Making $outIniFile...\n";
|
|||
while($line = <fpInIt>)
|
||||
{
|
||||
# For each line read, search and replace $Version$ with the version passed in
|
||||
$line =~ s/\$Version\$/$inVersion/i;
|
||||
$line =~ s/\$UserAgent\$/$userAgent/i;
|
||||
$line =~ s/\$UserAgentShort\$/$userAgentShort/i;
|
||||
$line =~ s/\$XPInstallVersion\$/$xpinstallVersion/i;
|
||||
$line =~ s/\$CompanyName\$/$nameCompany/i;
|
||||
$line =~ s/\$ProductName\$/$nameProduct/i;
|
||||
$line =~ s/\$MainExeFile\$/$fileMainExe/i;
|
||||
$line =~ s/\$UninstallFile\$/$fileUninstall/i;
|
||||
$line =~ s/\$Version\$/$inVersion/gi;
|
||||
$line =~ s/\$UserAgent\$/$userAgent/gi;
|
||||
$line =~ s/\$UserAgentShort\$/$userAgentShort/gi;
|
||||
$line =~ s/\$XPInstallVersion\$/$xpinstallVersion/gi;
|
||||
$line =~ s/\$CompanyName\$/$nameCompany/gi;
|
||||
$line =~ s/\$ProductName\$/$nameProduct/gi;
|
||||
$line =~ s/\$MainExeFile\$/$fileMainExe/gi;
|
||||
$line =~ s/\$UninstallFile\$/$fileUninstall/gi;
|
||||
print fpOutIni $line;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,20 @@ Decrypt Key=TRUE
|
|||
Uninstall Filename=$UninstallFile$
|
||||
|
||||
|
||||
[Check Instance0]
|
||||
Class Name=MozillaMessageWindow
|
||||
Window Name=
|
||||
;*** LOCALIZE ME BABY ***
|
||||
Message=$ProductName$ is detected to be currently running. Please quit $ProductName$ before continuing. Click Retry to perform the check again, or Cancel to exit the uninstaller.
|
||||
|
||||
; These keys are not normally necessary for checking instances. They are
|
||||
; set here because Mozilla requires a way to shut down it's turbo mode.
|
||||
Extra Cmd Reg Key Root=HKEY_LOCAL_MACHINE
|
||||
Extra Cmd Reg Key=Software\Microsoft\Windows\CurrentVersion\App Paths\$MainExeFile$
|
||||
Extra Cmd Reg Name=
|
||||
Extra Cmd Parameter=-kill
|
||||
|
||||
|
||||
[Dialog Uninstall]
|
||||
FONTNAME=MS Sans Serif
|
||||
FONTSIZE=8
|
||||
|
|
|
@ -836,6 +836,78 @@ void ParseCommandLine(LPSTR lpszCmdLine)
|
|||
}
|
||||
}
|
||||
|
||||
int PreCheckInstance(char *szSection, char *szIniFile)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szKey[MAX_BUF];
|
||||
char szName[MAX_BUF];
|
||||
char szParameter[MAX_BUF];
|
||||
char szPath[MAX_BUF];
|
||||
char szFile[MAX_BUF];
|
||||
char *ptrName = NULL;
|
||||
HKEY hkeyRoot;
|
||||
int iRv = WIZ_OK;
|
||||
|
||||
/* Read the win reg key path */
|
||||
GetPrivateProfileString(szSection,
|
||||
"Extra Cmd Reg Key",
|
||||
"",
|
||||
szKey,
|
||||
sizeof(szKey),
|
||||
szIniFile);
|
||||
if(*szKey == '\0')
|
||||
return(iRv);
|
||||
|
||||
/* Read the win reg root key */
|
||||
GetPrivateProfileString(szSection,
|
||||
"Extra Cmd Reg Key Root",
|
||||
"",
|
||||
szBuf,
|
||||
sizeof(szBuf),
|
||||
szIniFile);
|
||||
if(*szBuf == '\0')
|
||||
return(iRv);
|
||||
hkeyRoot = ParseRootKey(szBuf);
|
||||
|
||||
/* Read the win reg name value */
|
||||
GetPrivateProfileString(szSection,
|
||||
"Extra Cmd Reg Name",
|
||||
"",
|
||||
szName,
|
||||
sizeof(szName),
|
||||
szIniFile);
|
||||
if(*szName == '\0')
|
||||
ptrName = NULL;
|
||||
else
|
||||
ptrName = szName;
|
||||
|
||||
/* Read the parameter to use for quitting the browser's turbo mode */
|
||||
GetPrivateProfileString(szSection,
|
||||
"Extra Cmd Parameter",
|
||||
"",
|
||||
szParameter,
|
||||
sizeof(szParameter),
|
||||
szIniFile);
|
||||
|
||||
/* Read the win reg key that contains the path to the browser */
|
||||
GetWinReg(hkeyRoot, szKey, ptrName, szFile, sizeof(szFile));
|
||||
ParsePath(szFile, szPath, sizeof(szPath), PP_PATH_ONLY);
|
||||
|
||||
/* Make sure the file exists */
|
||||
if(FileExists(szFile))
|
||||
{
|
||||
/* Run the file */
|
||||
WinSpawn(szFile, szParameter, szPath, SW_HIDE, TRUE);
|
||||
|
||||
/* Even though WinSpawn is suppose to wait for the app to finish, this
|
||||
* does not really work that way for trying to quit the browser when
|
||||
* it's in turbo mode, so we wait 2 secs for it to complete. */
|
||||
Delay(2);
|
||||
}
|
||||
|
||||
return(iRv);
|
||||
}
|
||||
|
||||
HRESULT CheckInstances()
|
||||
{
|
||||
char szSection[MAX_BUF];
|
||||
|
@ -886,23 +958,47 @@ HRESULT CheckInstances()
|
|||
else
|
||||
szWN = szWindowName;
|
||||
|
||||
if((hwndFW = FindWindow(szClassName, szWN)) != NULL)
|
||||
/* If an instance is found, call PreCheckInstance first. */
|
||||
if((hwndFW = FindWindow(szCN, szWN)) != NULL)
|
||||
PreCheckInstance(szSection, szFileIniUninstall);
|
||||
|
||||
if((hwndFW = FindWindow(szCN, szWN)) != NULL)
|
||||
{
|
||||
if(*szMessage != '\0')
|
||||
{
|
||||
if((ugUninstall.dwMode != SILENT) && (ugUninstall.dwMode != AUTO))
|
||||
switch(ugUninstall.dwMode)
|
||||
{
|
||||
MessageBox(hWndMain, szMessage, NULL, MB_ICONEXCLAMATION);
|
||||
}
|
||||
else if(ugUninstall.dwMode == AUTO)
|
||||
{
|
||||
ShowMessage(szMessage, TRUE);
|
||||
Delay(5);
|
||||
ShowMessage(szMessage, FALSE);
|
||||
}
|
||||
}
|
||||
case NORMAL:
|
||||
switch(MessageBox(hWndMain, szMessage, NULL, MB_ICONEXCLAMATION | MB_RETRYCANCEL))
|
||||
{
|
||||
case IDCANCEL:
|
||||
/* User selected to cancel Setup */
|
||||
return(TRUE);
|
||||
|
||||
return(TRUE);
|
||||
case IDRETRY:
|
||||
/* User selected to retry. Reset counter */
|
||||
iIndex = -1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case AUTO:
|
||||
ShowMessage(szMessage, TRUE);
|
||||
Delay(5);
|
||||
ShowMessage(szMessage, FALSE);
|
||||
|
||||
/* Setup mode is AUTO. Show message, timeout, then cancel because we can't allow user to continue */
|
||||
return(TRUE);
|
||||
|
||||
case SILENT:
|
||||
return(TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No message to display. Assume cancel because we can't allow user to continue */
|
||||
return(TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче