diff --git a/browser/installer/windows/uninstall.it b/browser/installer/windows/uninstall.it index ba8fecf3c1c..e69de29bb2d 100644 --- a/browser/installer/windows/uninstall.it +++ b/browser/installer/windows/uninstall.it @@ -1,155 +0,0 @@ -#filter substitution - -[General] -; Run Mode values: -; Normal - Shows all dialogs. Requires user input. -; Auto - Shows some dialogs, but none requiring user input. It will -; automatically uninstall the product using default values. -; Silent - Show no dialogs at all. It will uninstall product using default -; values. -Run Mode=Normal - -Company Name=@BRAND_COMPANY_NAME@ -Product Name=@BRAND_PRODUCT_NAME@ - -; Valid Path values: -; PROGRAMFILESDIR -; WINDISK -; WINDIR -; WINSYSDIR -; COMMON_STARTUP -; COMMON_PROGRAMS -; COMMON_STARTMENU -; COMMON_DESKTOP -; -; PERSONAL_STARTUP -; PERSONAL_PROGRAMS -; PERSONAL_STARTMENU -; PERSONAL_DESKTOP -; -; PERSONAL_APPDATA -; PERSONAL_CACHE -; PERSONAL_COOKIES -; PERSONAL_FAVORITES -; PERSONAL_FONTS -; PERSONAL_HISTORY -; PERSONAL_NETHOOD -; PERSONAL_PERSONAL -; PERSONAL_PRINTHOOD (supported only under Windows NT) -; PERSONAL_RECENT -; PERSONAL_SENDTO -; PERSONAL_TEMPLATES -; -; PROGRAMFILESDIR -; COMMONFILESDIR -; MEDIAPATH -; CONFIGPATH (supported only under Windows95 and Windows98) -; DEVICEPATH - -; This provides information on where in the Windows Registry to locate the Uninstall log files -; -Main Root Key=HKEY_LOCAL_MACHINE -Main Key=[Product WinRegKey] -Decrypt Main Key=TRUE - -Root Key=HKEY_LOCAL_MACHINE -Key=[Product CurrentVersion]\Uninstall -Decrypt Key=TRUE - -[Check Instance0] -Class Name=FirefoxMessageWindow -Window Name= -Process Name=firefox.exe -Pretty Name=@BRAND_PRODUCT_NAME@ -Message=@UNINST_RUNNING@ -Message wait=@UNINST_SHUTDOWN@ - -; This key indicates whether or not to close all the windows associated with -; the process id of this app instance window found. -Close All Process Windows=TRUE - -; 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 Cmd0 Reg Key Root=HKEY_LOCAL_MACHINE -Extra Cmd0 Reg Key=Software\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe -Extra Cmd0 Reg Name= -Extra Cmd0 Parameter=-kill - -[Check Instance1] -Class Name=Netscape6MessageWindow -Window Name= -Process Name=Netscp.exe -Pretty Name=Netscape -;*** LOCALIZE ME BABY *** -Message=Netscape is detected to be currently running. Please quit Netscape before continuing. Click OK to exit Netscape automatically and proceed with uninstallation. -;*** LOCALIZE ME BABY *** -Message wait=Shutting down Netscape. Please wait... - -; This key indicates whether or not to close all the windows associated with -; the process id of this app instance window found. -Close All Process Windows=TRUE - -; These keys are not normally necessary for checking instances. They are -; set here because Netscape 6 requires a way to shut down it's turbo mode. -; This will stop at the first one that succeeds (key and file found). -Extra Cmd0 Reg Key Root=HKEY_LOCAL_MACHINE -Extra Cmd0 Reg Key=Software\Microsoft\Windows\CurrentVersion\App Paths\Netscp6.exe -Extra Cmd0 Reg Name= -Extra Cmd0 Parameter=-kill - -Extra Cmd1 Reg Key Root=HKEY_LOCAL_MACHINE -Extra Cmd1 Reg Key=Software\Microsoft\Windows\CurrentVersion\App Paths\Netscp.exe -Extra Cmd1 Reg Name= -Extra Cmd1 Parameter=-kill - - -[Dialog Uninstall] -FONTNAME=@UNINST_FONT@ -FONTSIZE=@UNINST_FONTSIZE@ -CHARSET=@UNINST_CHARSET@ -Show Dialog=TRUE -Title=@UNINST_TITLE@ -Message0=@UNINST_MESSAGE0@ - -Uninstall=@BTN_UNINST@ -Cancel=@BTN_CANCEL@ -Message1=@BTN_MESSAGE1@ -Message2=@BTN_MESSAGE2@ -FileName=@BTN_FILENAME@ -No=@BTN_NO@ -NoToAll=@BTN_NOTOALL@ -Yes=@BTN_YES@ -YesToAll=@BTN_YESTOALL@ - -; This section attempts to restore/undo the desktop integration performed by the browser/mail -[Restore Desktop Integration] -Enabled=TRUE - -; This section attempts to cleanup the UnreadMail registry keys set up by mail. -[Cleanup Mail Integration] -Enabled=TRUE - -[Messages] -ERROR_DLL_LOAD=@ERROR_DLL_LOAD@ -ERROR_STRING_LOAD=@ERROR_STRING_LOAD@ -ERROR_STRING_NULL=@ERROR_STRING_NULL@ -ERROR_GLOBALALLOC=@ERROR_GLOBALALLOC@ -ERROR_FAILED=@ERROR_FAILED@ -ERROR_DIALOG_CREATE=@ERROR_DIALOG_CREATE@ -DLGQUITTITLE=@DLGQUITTITLE@ -DLGQUITMSG=@DLGQUITMSG@ -ERROR_GET_SYSTEM_DIRECTORY_FAILED=@ERROR_GET_SYSTEM_DIRECTORY_FAILED@ -ERROR_GET_WINDOWS_DIRECTORY_FAILED=@ERROR_GET_WINDOWS_DIRECTORY_FAILED@ -ERROR_CREATE_TEMP_DIR=@ERROR_CREATE_TEMP_DIR@ -ERROR_SETUP_REQUIREMENT=@ERROR_SETUP_REQUIREMENT@ -MB_WARNING_STR=@MB_WARNING_STR@ -ERROR_UNINSTALL_LOG_FOLDER=@ERROR_UNINSTALL_LOG_FOLDER@ -MB_MESSAGE_STR=@MB_MESSAGE_STR@ -DLG_REMOVE_FILE_TITLE=@DLG_REMOVE_FILE_TITLE@ -ERROR_GETVERSION=@ERROR_GETVERSION@ -MB_ATTENTION_STR=@MB_ATTENTION_STR@ -MSG_FORCE_QUIT_PROCESS=@MSG_FORCE_QUIT_PROCESS@ -MSG_FORCE_QUIT_PROCESS_FAILED=@MSG_FORCE_QUIT_PROCESS_FAILED@ -MSG_DELETE_INSTALLATION_PATH=@MSG_DELETE_INSTALLATION_PATH@ -MSG_INSTALLATION_PATH_WITHIN_WINDIR=@MSG_INSTALLATION_PATH_WITHIN_WINDIR@ - diff --git a/browser/locales/en-US/installer/uninstaller.inc b/browser/locales/en-US/installer/uninstaller.inc index 3c058970f51..da1062e986b 100644 --- a/browser/locales/en-US/installer/uninstaller.inc +++ b/browser/locales/en-US/installer/uninstaller.inc @@ -31,6 +31,7 @@ #define BTN_NOTOALL N&o to all #define BTN_YES &Yes #define BTN_YESTOALL Y&es to all +#define BTN_OK OK #define ERROR_DLL_LOAD Could not load %s #define ERROR_STRING_LOAD Could not load string resource ID %d diff --git a/mail/installer/windows/uninstall.it b/mail/installer/windows/uninstall.it index 1d55d2b8f13..41e44a7c7f6 100644 --- a/mail/installer/windows/uninstall.it +++ b/mail/installer/windows/uninstall.it @@ -129,6 +129,7 @@ No=&No NoToAll=N&o to all Yes=&Yes YesToAll=Y&es to all +OK=@BTN_OK@ ; This section attempts to restore/undo the desktop integration performed by the browser/mail [Restore Desktop Integration] @@ -161,4 +162,6 @@ MSG_FORCE_QUIT_PROCESS=Uninstall has detected that %s (%s) is still running. Cl MSG_FORCE_QUIT_PROCESS_FAILED=Uninstall will now exit. Uninstall could not continue because %s (%s) is still running. Try manually quitting %s using Windows Task Manager, and then run Uninstall again. MSG_DELETE_INSTALLATION_PATH=Not all files were uninstalled from the installation directory:\n\n %s\n\nDo you want to completely delete this directory? MSG_INSTALLATION_PATH_WITHIN_WINDIR=Uninstall has detected that the installation path of $ProductNameInternal$ is installed to a folder within your Windows folder. Uninstall will not attempt to delete this installation due to the potential removal of critical system files. - +; Localize me!! +MSG_UNINSTALL_COMPLETE=@BRAND_PRODUCT_NAME@ has been removed from your computer. +MSG_UNINSTALL_SURVEY=Tell us what you thought of @BRAND_PRODUCT_NAME@. diff --git a/mail/locales/en-US/installer/uninstaller.inc b/mail/locales/en-US/installer/uninstaller.inc index e0f79a8f2bd..e69de29bb2d 100644 --- a/mail/locales/en-US/installer/uninstaller.inc +++ b/mail/locales/en-US/installer/uninstaller.inc @@ -1,58 +0,0 @@ -#filter emptyLines - -# This file is in the UTF-8 encoding - -#define BRAND_COMPANY_NAME Mozilla -#define BRAND_PRODUCT_NAME Mozilla Thunderbird - -#define UNINST_RUNNING Mozilla Thunderbird is detected to be currently running. Please quit Mozilla Thunderbird before continuing. Click OK to exit Mozilla Thunderbird automatically and proceed with uninstallation. -#define UNINST_SHUTDOWN Shutting down Mozilla Thunderbird. Please wait... -#define UNINST_FONT MS Sans Serif -#define UNINST_FONTSIZE 8 -#define UNINST_CHARSET 0 -# Here is a partial list CHAR_SETS -# ANSI_CHARSET = 0 -# DEFAULT_CHARSET = 1 -# SYMBOL_CHARSET = 2 -# SHIFTJIS_CHARSET = 128 -# GB2312_CHARSET = 134 -# HANGEUL_CHARSET = 129 -# CHINESEBIG5_CHARSET = 136 -# OEM_CHARSET 255 - -#define UNINST_TITLE Mozilla Thunderbird Uninstaller -#define UNINST_MESSAGE0 Are you sure you want to completely remove %s and all of its components? -#define BTN_UNINST &Uninstall -#define BTN_CANCEL &Cancel -#define BTN_MESSAGE1 Uninstall has detected that the following shared file is no longer used by any programs. If any programs still require the shared file and it is removed, those programs may no longer function. Are you sure you want to remove this shared file? -#define BTN_MESSAGE2 Leaving this file will not harm your system. If you are not sure, it is recommended that the shared file be not removed from the system. -#define BTN_FILENAME File name: -#define BTN_NO &No -#define BTN_NOTOALL N&o to all -#define BTN_YES &Yes -#define BTN_YESTOALL Y&es to all - -#define ERROR_DLL_LOAD Could not load %s -#define ERROR_STRING_LOAD Could not load string resource ID %d -#define ERROR_STRING_NULL Null pointer encountered. -#define ERROR_GLOBALALLOC Memory allocation error. -#define ERROR_FAILED %s failed. -#define ERROR_DIALOG_CREATE Could not create %s dialog. -#define DLGQUITTITLE Question -#define DLGQUITMSG Are you sure you want to cancel? -#define ERROR_GET_SYSTEM_DIRECTORY_FAILED GetSystemDirectory() failed. -#define ERROR_GET_WINDOWS_DIRECTORY_FAILED GetWindowsDirectory() failed. -#define ERROR_CREATE_TEMP_DIR Uninstall was not able to create the TEMP directory: %s -#define ERROR_SETUP_REQUIREMENT Windows95 or greater Operating System is required! Exiting Uninstall... -#define MB_WARNING_STR Warning -#define ERROR_UNINSTALL_LOG_FOLDER Uninstall log folder not found:%s -#define MB_MESSAGE_STR Message -#define DLG_REMOVE_FILE_TITLE Remove File? -#define ERROR_GETVERSION GetVersionEx() failed! -#define MB_ATTENTION_STR Attention -#define MSG_FORCE_QUIT_PROCESS Uninstall has detected that %s (%s) is still running. Click OK to quit %s and proceed with uninstallation. Alternatively, use the Windows Task Manager to quit %s, and then click OK to continue with uninstallation. -#define MSG_FORCE_QUIT_PROCESS_FAILED Uninstall will now exit. Uninstall could not continue because %s (%s) is still running. Try manually quitting %s using Windows Task Manager, and then run Uninstall again. -#define MSG_DELETE_INSTALLATION_PATH Not all files were uninstalled from the installation directory:\n\n %s\n\nDo you want to completely delete this directory? -#define MSG_INSTALLATION_PATH_WITHIN_WINDIR Uninstall has detected that the installation path of Mozilla Thunderbird is installed to a folder within your Windows folder. Uninstall will not attempt to delete this installation due to the potential removal of critical system files. - -#unfilter emptyLines diff --git a/toolkit/mozapps/installer/windows/wizard/uninstall/dialogs.c b/toolkit/mozapps/installer/windows/wizard/uninstall/dialogs.c index e90c6e8efc8..e69de29bb2d 100644 --- a/toolkit/mozapps/installer/windows/wizard/uninstall/dialogs.c +++ b/toolkit/mozapps/installer/windows/wizard/uninstall/dialogs.c @@ -1,543 +0,0 @@ -/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sean Su - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "extern.h" -#include "extra.h" -#include "dialogs.h" -#include "ifuncns.h" -#include "parser.h" -#include "rdi.h" -#include "shlobj.h" - -#define MOZ_HWND_BROADCAST_MSG_TIMEOUT 5000 -#define MOZ_CLIENT_BROWSER_KEY "Software\\Clients\\StartMenuInternet" -#define MOZ_CLIENT_MAIL_KEY "Software\\Clients\\Mail" - -void SetDefault() -{ - char szBuf[MAX_BUF]; - char szRegKey[MAX_BUF]; - - GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientTypeName", "", szBuf, MAX_BUF, szFileIniDefaultsInfo); - wsprintf(szRegKey, "SOFTWARE\\Clients\\%s", szBuf); - GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientProductKey", "", szBuf, MAX_BUF, szFileIniDefaultsInfo); - - SetWinReg(HKEY_LOCAL_MACHINE, szRegKey, "", REG_SZ, szBuf, lstrlen(szBuf)); -} - -void ParseDefaultsInfo() -{ - char szBuf[MAX_BUF]; - char szIniKey[MAX_BUF]; - char szStorageDir[MAX_BUF]; - char szShortcutPath[MAX_BUF]; - char szStoredShortcutPath[MAX_BUF]; - char szRegKey[MAX_BUF]; - char szClientTypeName[MAX_BUF]; - char szClientProductKey[MAX_BUF]; - int iIndex; - DWORD dwIconsVisible; - - // If szAppPath is a null string, i.e. we cannot find where the app has been installed: - // - HIDEICONS will still remove the shortcuts but - // - SHOWICONS will do nothing because we won't be able to find the shortcuts to display. - ParsePath(ugUninstall.szAppPath, szStorageDir, MAX_BUF, PP_PATH_ONLY); - lstrcat(szStorageDir, "defaults\\shortcuts\\"); - - // CLEANUP ISSUE: For all of the SHOWICON and HIDEICONS blocks below, there is a lot of - // redundancy: - // - Right now I'm just trying to create icons and, if I can't, trying under the PERSONAL - // key instead. I would be cleaner to check for restricted access once, and then just - // create the appropriate key each time. - // - Creating a ShowIcon() and a HideIcon() function would rid us much of the redundency. - - - // Deal with Desktop Icons - iIndex = 0; - wsprintf(szIniKey, "DesktopShortcut%d", iIndex); - GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo); - while(szBuf[0] != '\0') - { - strcpy(szShortcutPath, "COMMON_DESKTOP"); - DecryptVariable(szShortcutPath, MAX_BUF); - - if((ugUninstall.mode == SHOWICONS) && (szStorageDir[0] != '\0')) - { - wsprintf(szStoredShortcutPath, "%s%s", szStorageDir, szBuf); - FileCopy(szStoredShortcutPath, szShortcutPath, 0); - if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) ) - { - strcpy(szShortcutPath, "PERSONAL_DESKTOP"); - DecryptVariable(szShortcutPath, MAX_BUF); - FileCopy(szStoredShortcutPath, szShortcutPath, 0); - } - } - - if (ugUninstall.mode == HIDEICONS) - { - AppendBackSlash(szShortcutPath, MAX_BUF); - lstrcat(szShortcutPath, szBuf); - if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) ) - { - strcpy(szShortcutPath, "PERSONAL_DESKTOP"); - DecryptVariable(szShortcutPath, MAX_BUF); - AppendBackSlash(szShortcutPath, MAX_BUF); - lstrcat(szShortcutPath, szBuf); - } - - FileDelete(szShortcutPath); - } - - iIndex++; - wsprintf(szIniKey, "DesktopShortcut%d", iIndex); - GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo); - } - - // Deal with StartMenu Icons - iIndex = 0; - wsprintf(szIniKey, "StartMenuShortcut%d", iIndex); - GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo); - while(szBuf[0] != '\0') - { - strcpy(szShortcutPath, "COMMON_STARTMENU"); - DecryptVariable(szShortcutPath, MAX_BUF); - - if((ugUninstall.mode == SHOWICONS) && (szStorageDir[0] != '\0')) - { - lstrcpy(szStoredShortcutPath, szStorageDir); - lstrcat(szStoredShortcutPath, szBuf); - FileCopy(szStoredShortcutPath, szShortcutPath, 0); - if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) ) - { - strcpy(szShortcutPath, "PERSONAL_STARTMENU"); - DecryptVariable(szShortcutPath, MAX_BUF); - FileCopy(szStoredShortcutPath, szShortcutPath, 0); - } - } - - if (ugUninstall.mode == HIDEICONS) - { - AppendBackSlash(szShortcutPath, MAX_BUF); - lstrcat(szShortcutPath, szBuf); - if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) ) - { - strcpy(szShortcutPath, "PERSONAL_STARTMENU"); - DecryptVariable(szShortcutPath, MAX_BUF); - AppendBackSlash(szShortcutPath, MAX_BUF); - lstrcat(szShortcutPath, szBuf); - } - - FileDelete(szShortcutPath); - } - - iIndex++; - wsprintf(szIniKey, "StartMenuShortcut%d", iIndex); - GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo); - } - - // Deal with QuickLaunch Bar Icons - iIndex = 0; - wsprintf(szIniKey, "QuickLaunchBarShortcut%d", iIndex); - GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo); - while(szBuf[0] != '\0') - { - GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "AppData", szShortcutPath, MAX_BUF); - lstrcat(szShortcutPath, "\\Microsoft\\Internet Explorer\\Quick Launch"); - - if((ugUninstall.mode == SHOWICONS) && (szStorageDir[0] != '\0')) - { - wsprintf(szStoredShortcutPath, "%s%s", szStorageDir, szBuf); - FileCopy(szStoredShortcutPath, szShortcutPath, 0); - if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) ) - { - GetWinReg(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups", "Quick Launch", szShortcutPath, MAX_BUF); - FileCopy(szStoredShortcutPath, szShortcutPath, 0); - } - } - - if (ugUninstall.mode == HIDEICONS) - { - AppendBackSlash(szShortcutPath, MAX_BUF); - lstrcat(szShortcutPath, szBuf); - if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) ) - { - GetWinReg(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups", "Quick Launch", szShortcutPath, MAX_BUF); - AppendBackSlash(szShortcutPath, MAX_BUF); - lstrcat(szShortcutPath, szBuf); - } - - FileDelete(szShortcutPath); - } - - ++iIndex; - wsprintf(szIniKey, "QuickLaunchBarShortcut%d", iIndex); - GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo); - } - - GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientTypeName", "", szClientTypeName, MAX_BUF, szFileIniDefaultsInfo); - GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientProductKey", "", szClientProductKey, MAX_BUF, szFileIniDefaultsInfo); - wsprintf(szRegKey, "SOFTWARE\\Clients\\%s\\%s\\InstallInfo", szClientTypeName, szClientProductKey); - - if (ugUninstall.mode == SHOWICONS) - dwIconsVisible = 1; - else - dwIconsVisible = 0; - - SetWinRegNumValue(HKEY_LOCAL_MACHINE, szRegKey, "IconsVisible", dwIconsVisible); -} - -void ParseAllUninstallLogs() -{ - char szFileInstallLog[MAX_BUF]; - char szKey[MAX_BUF]; - sil *silFile; - DWORD dwFileFound; - DWORD dwRv = 0; - - UndoDesktopIntegration(); - CleanupMailIntegration(); - dwFileFound = GetLogFile(ugUninstall.szLogPath, ugUninstall.szLogFilename, szFileInstallLog, sizeof(szFileInstallLog)); - while(dwFileFound) - { - if((silFile = InitSilNodes(szFileInstallLog)) != NULL) - { - FileDelete(szFileInstallLog); - dwRv = Uninstall(silFile); - DeInitSilNodes(&silFile); - if(dwRv == WTD_CANCEL) - break; - } - - dwFileFound = GetLogFile(ugUninstall.szLogPath, ugUninstall.szLogFilename, szFileInstallLog, sizeof(szFileInstallLog)); - } - - if(dwRv != WTD_CANCEL) - { - lstrcpy(szFileInstallLog, ugUninstall.szLogPath); - AppendBackSlash(szFileInstallLog, MAX_BUF); - lstrcat(szFileInstallLog, ugUninstall.szLogFilename); - if(FileExists(szFileInstallLog)) - { - if((silFile = InitSilNodes(szFileInstallLog)) != NULL) - { - FileDelete(szFileInstallLog); - Uninstall(silFile); - DeInitSilNodes(&silFile); - } - } - - /* clean up the uninstall windows registry key */ - lstrcpy(szKey, "Software\\Microsoft\\Windows\\CurrentVersion\\uninstall\\"); - lstrcat(szKey, ugUninstall.szUninstallKeyDescription); - RegDeleteKey(HKEY_LOCAL_MACHINE, szKey); - - // Calling SHChangeNotify() will update the file association icons - // in case they had been reset. - SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); - - // Note completion of the uninstall process. - gbUninstallCompleted = TRUE; - } - - /* Broadcast message only if the windows registry keys exist - * in case they were changed during uninstallation. If they - * were, then the broadcast will alert the OS to update the appropriate UIs. - * This needs to be done regardless if the user canceled the uninstall - * process or not. - */ - if(WinRegKeyExists(HKEY_LOCAL_MACHINE, MOZ_CLIENT_BROWSER_KEY)) - { - SendMessageTimeout(HWND_BROADCAST, - WM_SETTINGCHANGE, - 0, - (LPARAM)MOZ_CLIENT_BROWSER_KEY, - SMTO_NORMAL|SMTO_ABORTIFHUNG, - MOZ_HWND_BROADCAST_MSG_TIMEOUT, - NULL); - } - if(WinRegKeyExists(HKEY_LOCAL_MACHINE, MOZ_CLIENT_MAIL_KEY)) - { - SendMessageTimeout(HWND_BROADCAST, - WM_SETTINGCHANGE, - 0, - (LPARAM)MOZ_CLIENT_MAIL_KEY, - SMTO_NORMAL|SMTO_ABORTIFHUNG, - MOZ_HWND_BROADCAST_MSG_TIMEOUT, - NULL); - } -} - -LRESULT CALLBACK DlgProcUninstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) -{ - char szBuf[MAX_BUF]; - RECT rDlg; - - switch(msg) - { - case WM_INITDIALOG: - SetWindowText(hDlg, diUninstall.szTitle); - wsprintf(szBuf, diUninstall.szMessage0, ugUninstall.szDescription); - SetDlgItemText(hDlg, IDC_MESSAGE0, szBuf); - GetPrivateProfileString("Dialog Uninstall", "Yes", "", szBuf, sizeof(szBuf), szFileIniUninstall); - SetDlgItemText(hDlg, IDWIZNEXT, szBuf); - GetPrivateProfileString("Dialog Uninstall", "No", "", szBuf, sizeof(szBuf), szFileIniUninstall); - SetDlgItemText(hDlg, IDCANCEL, szBuf); - SendDlgItemMessage (hDlg, IDC_MESSAGE0, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - SendDlgItemMessage (hDlg, IDWIZNEXT, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - SendDlgItemMessage (hDlg, IDCANCEL, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - - if(GetClientRect(hDlg, &rDlg)) - SetWindowPos(hDlg, HWND_TOP, (dwScreenX/2)-(rDlg.right/2), (dwScreenY/2)-(rDlg.bottom/2), 0, 0, SWP_NOSIZE); - - break; - - case WM_COMMAND: - switch(LOWORD(wParam)) - { - case IDWIZNEXT: - EnableWindow(GetDlgItem(hDlg, IDWIZNEXT), FALSE); - EnableWindow(GetDlgItem(hDlg, IDCANCEL), FALSE); - ParseAllUninstallLogs(); - // skip directory nuking for now (bug 233625) but may come back - // if the issues can be resolved in a better way by bug 281235 - // VerifyAndDeleteInstallationFolder(); - DestroyWindow(hDlg); - PostQuitMessage(0); - break; - - case IDCANCEL: - DestroyWindow(hDlg); - PostQuitMessage(0); - break; - - default: - break; - } - break; - } - return(0); -} - -LRESULT CALLBACK DlgProcWhatToDo(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) -{ - char szBuf[MAX_BUF]; - RECT rDlg; - - switch(msg) - { - case WM_INITDIALOG: - GetPrivateProfileString("Messages", "DLG_REMOVE_FILE_TITLE", "", szBuf, sizeof(szBuf), szFileIniUninstall); - SetWindowText(hDlg, szBuf); - - if((LPSTR)lParam != NULL) - SetDlgItemText(hDlg, IDC_STATIC_SHARED_FILENAME, (LPSTR)lParam); - - GetPrivateProfileString("Dialog Uninstall", "Message1", "", szBuf, sizeof(szBuf), szFileIniUninstall); - SetDlgItemText(hDlg, IDC_MESSAGE0, szBuf); - GetPrivateProfileString("Dialog Uninstall", "Message2", "", szBuf, sizeof(szBuf), szFileIniUninstall); - SetDlgItemText(hDlg, IDC_MESSAGE1, szBuf); - GetPrivateProfileString("Dialog Uninstall", "FileName", "", szBuf, sizeof(szBuf), szFileIniUninstall); - SetDlgItemText(hDlg, IDC_STATIC, szBuf); - GetPrivateProfileString("Dialog Uninstall", "No", "", szBuf, sizeof(szBuf), szFileIniUninstall); - SetDlgItemText(hDlg, ID_NO, szBuf); - GetPrivateProfileString("Dialog Uninstall", "NoToAll", "", szBuf, sizeof(szBuf), szFileIniUninstall); - SetDlgItemText(hDlg, ID_NO_TO_ALL, szBuf); - GetPrivateProfileString("Dialog Uninstall", "Yes", "", szBuf, sizeof(szBuf), szFileIniUninstall); - SetDlgItemText(hDlg, ID_YES, szBuf); - GetPrivateProfileString("Dialog Uninstall", "YesToAll", "", szBuf, sizeof(szBuf), szFileIniUninstall); - SetDlgItemText(hDlg, ID_YES_TO_ALL, szBuf); - - SendDlgItemMessage (hDlg, IDC_MESSAGE0, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - SendDlgItemMessage (hDlg, IDC_MESSAGE1, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - SendDlgItemMessage (hDlg, IDC_STATIC, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - SendDlgItemMessage (hDlg, IDC_STATIC_SHARED_FILENAME, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - SendDlgItemMessage (hDlg, ID_NO, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - SendDlgItemMessage (hDlg, ID_NO_TO_ALL, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - SendDlgItemMessage (hDlg, ID_YES, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - SendDlgItemMessage (hDlg, ID_YES_TO_ALL, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - - if(GetClientRect(hDlg, &rDlg)) - SetWindowPos(hDlg, HWND_TOP, (dwScreenX/2)-(rDlg.right/2), (dwScreenY/2)-(rDlg.bottom/2), 0, 0, SWP_NOSIZE); - - break; - - case WM_COMMAND: - switch(LOWORD(wParam)) - { - case ID_NO: - EndDialog(hDlg, WTD_NO); - break; - - case ID_NO_TO_ALL: - EndDialog(hDlg, WTD_NO_TO_ALL); - break; - - case ID_YES: - EndDialog(hDlg, WTD_YES); - break; - - case ID_YES_TO_ALL: - EndDialog(hDlg, WTD_YES_TO_ALL); - break; - - default: - break; - } - break; - } - return(0); -} - -LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) -{ - RECT rDlg; - HWND hSTMessage = GetDlgItem(hDlg, IDC_MESSAGE); /* handle to the Static Text message window */ - HDC hdcSTMessage; - SIZE sizeString; - LOGFONT logFont; - HFONT hfontTmp; - HFONT hfontOld; - int i; - - switch(msg) - { - case WM_INITDIALOG: - SendDlgItemMessage (hDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L); - break; - - case WM_COMMAND: - switch(LOWORD(wParam)) - { - case IDC_MESSAGE: - hdcSTMessage = GetWindowDC(hSTMessage); - - SystemParametersInfo(SPI_GETICONTITLELOGFONT, - sizeof(logFont), - (PVOID)&logFont, - 0); - hfontTmp = CreateFontIndirect(&logFont); - - if(hfontTmp) - hfontOld = SelectObject(hdcSTMessage, hfontTmp); - - GetTextExtentPoint32(hdcSTMessage, (LPSTR)lParam, lstrlen((LPSTR)lParam), &sizeString); - SelectObject(hdcSTMessage, hfontOld); - DeleteObject(hfontTmp); - ReleaseDC(hSTMessage, hdcSTMessage); - - SetWindowPos(hDlg, HWND_TOP, - (dwScreenX/2)-((sizeString.cx + 40)/2), (dwScreenY/2)-((sizeString.cy + 40)/2), - sizeString.cx + 40, sizeString.cy + 40, - SWP_SHOWWINDOW); - - if(GetClientRect(hDlg, &rDlg)) - SetWindowPos(hSTMessage, - HWND_TOP, - rDlg.left, - rDlg.top, - rDlg.right, - rDlg.bottom, - SWP_SHOWWINDOW); - - for(i = 0; i < lstrlen((LPSTR)lParam); i++) - { - if((((LPSTR)lParam)[i] == '\r') || (((LPSTR)lParam)[i] == '\n')) - ((LPSTR)lParam)[i] = ' '; - } - - SetDlgItemText(hDlg, IDC_MESSAGE, (LPSTR)lParam); - break; - } - break; - } - return(0); -} - -void ProcessWindowsMessages() -{ - MSG msg; - - while(PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } -} - -void ShowMessage(LPSTR szMessage, BOOL bShow) -{ - char szBuf[MAX_BUF]; - - if(ugUninstall.mode != SILENT) - { - if((bShow) && (hDlgMessage == NULL)) - { - ZeroMemory(szBuf, sizeof(szBuf)); - GetPrivateProfileString("Messages", "MB_MESSAGE_STR", "", szBuf, sizeof(szBuf), szFileIniUninstall); - hDlgMessage = InstantiateDialog(hWndMain, DLG_MESSAGE, szBuf, DlgProcMessage); - SendMessage(hDlgMessage, WM_COMMAND, IDC_MESSAGE, (LPARAM)szMessage); - } - else if(!bShow && hDlgMessage) - { - DestroyWindow(hDlgMessage); - hDlgMessage = NULL; - } - } -} - -HWND InstantiateDialog(HWND hParent, DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc) -{ - char szBuf[MAX_BUF]; - HWND hDlg = NULL; - - if((hDlg = CreateDialog(hInst, MAKEINTRESOURCE(dwDlgID), hParent, wpDlgProc)) == NULL) - { - char szEDialogCreate[MAX_BUF]; - - if(GetPrivateProfileString("Messages", "ERROR_DIALOG_CREATE", "", szEDialogCreate, sizeof(szEDialogCreate), szFileIniUninstall)) - { - wsprintf(szBuf, szEDialogCreate, szTitle); - PrintError(szBuf, ERROR_CODE_SHOW); - } - - PostQuitMessage(1); - } - - return(hDlg); -} diff --git a/toolkit/mozapps/installer/windows/wizard/uninstall/dialogs.h b/toolkit/mozapps/installer/windows/wizard/uninstall/dialogs.h index b0494c69cf7..e69de29bb2d 100644 --- a/toolkit/mozapps/installer/windows/wizard/uninstall/dialogs.h +++ b/toolkit/mozapps/installer/windows/wizard/uninstall/dialogs.h @@ -1,55 +0,0 @@ -/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sean Su - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef _DIALOGS_H_ -#define _DIALOGS_H_ - -LRESULT CALLBACK DlgProcUninstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam); -LRESULT CALLBACK DlgProcWhatToDo(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam); -LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam); - -void ParseAllUninstallLogs(); -void ParseDefaultsInfo(); -void SetDefault(); -HWND InstantiateDialog(HWND hParent, DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc); -void ShowMessage(LPSTR szMessage, BOOL bShow); -void ProcessWindowsMessages(void); - -#endif - diff --git a/toolkit/mozapps/installer/windows/wizard/uninstall/resource.h b/toolkit/mozapps/installer/windows/wizard/uninstall/resource.h index 230b5ed013b..e69de29bb2d 100644 --- a/toolkit/mozapps/installer/windows/wizard/uninstall/resource.h +++ b/toolkit/mozapps/installer/windows/wizard/uninstall/resource.h @@ -1,50 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by uninstall.rc -// -#ifndef WINVER -#define WINVER 0x0400 -#endif -#include "winresrc.h" - -#define IDS_ERROR_DLL_LOAD 1 -#define IDS_ERROR_STRING_LOAD 2 -#define IDS_ERROR_STRING_NULL 4 -#define IDS_ERROR_GLOBALALLOC 5 -#define IDS_ERROR_FAILED 6 -#define IDI_SETUP 105 -#define IDI_UNINSTALL 105 -#define DLG_MESSAGE 110 -#define IDC_LIST_PRODUCTS 1000 -#define ID_NO 1001 -#define IDC_GAUGE_FILE 1002 -#define ID_NO_TO_ALL 1002 -#define IDC_STATUS0 1004 -#define ID_YES 1004 -#define IDC_STATUS3 1005 -#define ID_YES_TO_ALL 1005 -#define IDC_GAUGE_ARCHIVE 1006 -#define IDC_STATIC_SHARED_FILENAME 1006 -#define IDC_EDIT_CURRENT_SETTINGS 1026 -#define IDC_MESSAGE0 1042 -#define IDC_MESSAGE1 1043 -#define IDC_MESSAGE 1049 -#define DLG_UNINSTALL 2008 -#define DLG_EXTRACTING 2009 -#define DLG_PRODUCT_LIST 2009 -#define DLG_WHAT_TO_DO 2009 -#define IDWIZBACK 11013 -#define IDWIZNEXT 11014 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1007 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/toolkit/mozapps/installer/windows/wizard/uninstall/uninstall.c b/toolkit/mozapps/installer/windows/wizard/uninstall/uninstall.c index 22731b95c9a..e69de29bb2d 100644 --- a/toolkit/mozapps/installer/windows/wizard/uninstall/uninstall.c +++ b/toolkit/mozapps/installer/windows/wizard/uninstall/uninstall.c @@ -1,327 +0,0 @@ -/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sean Su - * Darin Fisher - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "uninstall.h" -#include "extra.h" -#include "dialogs.h" -#include "ifuncns.h" -#include "parser.h" - -/* global variables */ -HINSTANCE hInst; - -HANDLE hAccelTable; - -HWND hDlgUninstall; -HWND hDlgMessage; -HWND hWndMain; - -LPSTR szEGlobalAlloc; -LPSTR szEStringLoad; -LPSTR szEDllLoad; -LPSTR szEStringNull; - -LPSTR szClassName; -LPSTR szUninstallDir; -LPSTR szTempDir; -LPSTR szOSTempDir; -LPSTR szFileIniUninstall; -LPSTR szFileIniDefaultsInfo; -LPSTR gszSharedFilename; - -ULONG ulOSType; -DWORD dwScreenX; -DWORD dwScreenY; - -DWORD gdwWhatToDo; - -BOOL gbAllowMultipleInstalls = FALSE; - -uninstallGen ugUninstall; -diU diUninstall; - -DWORD dwParentPID = 0; - -BOOL gbUninstallCompleted = FALSE; - -/* Copy a file into a directory. Write the path to the new file - * into the result buffer (MAX_PATH in size). */ -static BOOL CopyTo(LPCSTR file, LPCSTR destDir, LPSTR result) -{ - char leaf[MAX_BUF_TINY]; - - ParsePath(file, leaf, sizeof(leaf), PP_FILENAME_ONLY); - lstrcpy(result, destDir); - lstrcat(result, "\\"); - lstrcat(result, leaf); - - return CopyFile(file, result, TRUE); -} - -/* Spawn child process. */ -static BOOL SpawnProcess(LPCSTR exePath, LPCSTR cmdLine) -{ - STARTUPINFO si = {sizeof(si), 0}; - PROCESS_INFORMATION pi = {0}; - - BOOL ok = CreateProcess(exePath, - cmdLine, - NULL, // no special security attributes - NULL, // no special thread attributes - FALSE, // don't inherit filehandles - 0, // No special process creation flags - NULL, // inherit my environment - NULL, // use my current directory - &si, - &pi); - - if (ok) { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } - - return ok; -} - -/* This function is called to ensure that the running executable is a copy of - * the actual uninstaller. If not, then this function copies the uninstaller - * into a temporary directory and invokes the copy of itself. This is done to - * enable the uninstaller to remove itself. */ -static BOOL EnsureRunningAsCopy(LPCSTR cmdLine) -{ - char uninstExe[MAX_PATH], uninstIni[MAX_PATH]; - char tempBuf[MAX_PATH], tempDir[MAX_PATH] = ""; - DWORD n; - - if (dwParentPID != 0) - { - HANDLE hParent; - - /* OpenProcess may return NULL if the parent process has already gone away. - * If not, then wait for the parent process to exit. NOTE: The process may - * be signaled before it releases the executable image, so we sit in a loop - * until OpenProcess returns NULL. */ - while ((hParent = OpenProcess(SYNCHRONIZE, FALSE, dwParentPID)) != NULL) - { - DWORD rv = WaitForSingleObject(hParent, 5000); - CloseHandle(hParent); - if (rv != WAIT_OBJECT_0) - return FALSE; - Sleep(50); /* prevent burning CPU while waiting */ - } - - return TRUE; - } - - /* otherwise, copy ourselves to a temp location and execute the copy. */ - - /* make unique folder under the Temp folder */ - n = GetTempPath(sizeof(tempDir)-1, tempDir); - if (n == 0 || n > sizeof(tempDir)-1) - return FALSE; - lstrcat(tempDir, "nstmp"); - if (!MakeUniquePath(tempDir) || !CreateDirectory(tempDir, NULL)) - return FALSE; - - if (!GetModuleFileName(hInst, tempBuf, sizeof(tempBuf))) - return FALSE; - - /* copy exe file into temp folder */ - if (!CopyTo(tempBuf, tempDir, uninstExe)) - { - RemoveDirectory(tempDir); - return FALSE; - } - - /* copy ini file into temp folder */ - ParsePath(tempBuf, uninstIni, sizeof(uninstIni), PP_PATH_ONLY); - lstrcat(uninstIni, FILE_INI_UNINSTALL); - - if (!CopyTo(uninstIni, tempDir, tempBuf)) - { - DeleteFile(uninstExe); - RemoveDirectory(tempDir); - return FALSE; - } - - /* schedule temp dir and contents to be deleted on reboot */ - DeleteOnReboot(uninstExe); - DeleteOnReboot(tempBuf); - DeleteOnReboot(tempDir); - - /* append -ppid command line flag */ - _snprintf(tempBuf, sizeof(tempBuf), "%s %s /ppid %lu", - uninstExe, cmdLine, GetCurrentProcessId()); - - /* call CreateProcess */ - SpawnProcess(uninstExe, tempBuf); - - return FALSE; /* exit this process */ -} - -/* Uninstall completed; show some UI... */ -static void OnUninstallComplete() -{ - char exePath[MAX_PATH], buf[MAX_PATH], title[MAX_BUF]; - int rv; - - if (!(ugUninstall.szProductName && ugUninstall.szProductName[0]) || - !(ugUninstall.szProductName && ugUninstall.szProductName[0])) - return; - - /* only show the exit survey message box if a string is defined */ - GetPrivateProfileString("Messages", "MSG_EXIT_SURVEY", "", buf, sizeof(buf), - szFileIniUninstall); - GetPrivateProfileString("Dialog Uninstall", "Title", "", title, sizeof(title), - szFileIniUninstall); - if (!buf[0] || !title[0]) - return; - - rv = MessageBox(NULL, buf, title, MB_OKCANCEL | MB_ICONINFORMATION); - if (rv != IDOK) - return; - - /* find iexplore.exe. we cannot use ShellExecute because the protocol - * association (in HKEY_CLASSES_ROOT) may reference the app we just - * uninstalled, which is a bug in and of itself. */ - GetWinReg(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\IE Setup\\Setup", "Path", - exePath, sizeof(exePath)); - if (!exePath[0]) - return; - lstrcat(exePath, "\\iexplore.exe"); - - /* launch IE, and point it at the survey URL (whitespace in the product name - * or user agent is okay) */ - _snprintf(buf, sizeof(buf), - "\"%s\" \"https://survey.mozilla.com/1/%s/%s/exit.html\"", exePath, - ugUninstall.szProductName, ugUninstall.szUserAgent); - SpawnProcess(exePath, buf); -} - -int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) -{ - /***********************************************************************/ - /* HANDLE hInstance; handle for this instance */ - /* HANDLE hPrevInstance; handle for possible previous instances */ - /* LPSTR lpszCmdLine; long pointer to exec command line */ - /* int nCmdShow; Show code for main window display */ - /***********************************************************************/ - - MSG msg; - char szBuf[MAX_BUF]; - int iRv = WIZ_OK; - HWND hwndFW; - - if(!hPrevInstance) - { - hInst = GetModuleHandle(NULL); - if(InitUninstallGeneral() || ParseCommandLine(lpszCmdLine)) - { - PostQuitMessage(1); - } - else if((hwndFW = FindWindow(CLASS_NAME_UNINSTALL_DLG, NULL)) != NULL && !gbAllowMultipleInstalls) - { - /* Allow only one instance of setup to run. - * Detect a previous instance of setup, bring it to the - * foreground, and quit current instance */ - - ShowWindow(hwndFW, SW_RESTORE); - SetForegroundWindow(hwndFW); - iRv = WIZ_SETUP_ALREADY_RUNNING; - PostQuitMessage(1); - } - else if(!EnsureRunningAsCopy(lpszCmdLine) || Initialize(hInst)) - { - PostQuitMessage(1); - } - else if(!InitApplication(hInst)) - { - char szEFailed[MAX_BUF]; - - if(NS_LoadString(hInst, IDS_ERROR_FAILED, szEFailed, MAX_BUF) == WIZ_OK) - { - wsprintf(szBuf, szEFailed, "InitApplication()."); - PrintError(szBuf, ERROR_CODE_SHOW); - } - PostQuitMessage(1); - } - else if(ParseUninstallIni()) - { - PostQuitMessage(1); - } - else if(ugUninstall.bUninstallFiles == TRUE) - { - if(diUninstall.bShowDialog == TRUE) - hDlgUninstall = InstantiateDialog(hWndMain, DLG_UNINSTALL, diUninstall.szTitle, DlgProcUninstall); - // Assumes that SHOWICONS, HIDEICONS, and SETDEFAULT never show dialogs - else if((ugUninstall.mode == SHOWICONS) || (ugUninstall.mode == HIDEICONS)) - ParseDefaultsInfo(); - else if(ugUninstall.mode == SETDEFAULT) - SetDefault(); - else - ParseAllUninstallLogs(); - } - } - - if((ugUninstall.bUninstallFiles == TRUE) && (diUninstall.bShowDialog == TRUE)) - { - while(GetMessage(&msg, NULL, 0, 0)) - { - if((!IsDialogMessage(hDlgUninstall, &msg)) && (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - } - - if(diUninstall.bShowDialog == TRUE && gbUninstallCompleted) - { - OnUninstallComplete(); - } - - /* garbage collection */ - DeInitUninstallGeneral(); - if(iRv != WIZ_SETUP_ALREADY_RUNNING) - /* Do clean up before exiting from the application */ - DeInitialize(); - - return(msg.wParam); -} /* End of WinMain */ diff --git a/toolkit/mozapps/installer/windows/wizard/uninstall/uninstall.rc b/toolkit/mozapps/installer/windows/wizard/uninstall/uninstall.rc index d6374f35b53..e69de29bb2d 100644 --- a/toolkit/mozapps/installer/windows/wizard/uninstall/uninstall.rc +++ b/toolkit/mozapps/installer/windows/wizard/uninstall/uninstall.rc @@ -1,173 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -1 24 "uninstall.exe.manifest" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,2 - PRODUCTVERSION 1,0,0,2 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "mozilla.org\0" - VALUE "FileDescription", "uninstall\0" - VALUE "FileVersion", "1, 0, 0, 2\0" - VALUE "InternalName", "uninstall\0" - VALUE "LegalCopyright", "Copyright © 2001\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "uninstall.exe\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Mozilla uninstaller\0" - VALUE "ProductVersion", "1, 0, 0, 2\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_UNINSTALL ICON DISCARDABLE "uninstall.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -DLG_UNINSTALL DIALOG DISCARDABLE 51, 56, 225, 79 -STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CLASS "MozillaSetupDlg" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "",IDWIZNEXT,54,55,53,14 - PUSHBUTTON "",IDCANCEL,118,55,53,14 - LTEXT "",IDC_MESSAGE0,17,11,191,32,NOT WS_GROUP -END - -DLG_MESSAGE DIALOG DISCARDABLE 0, 0, 236, 34 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE -FONT 8, "MS Sans Serif" -BEGIN - CTEXT "",IDC_MESSAGE,0,0,236,34,SS_CENTERIMAGE -END - -DLG_WHAT_TO_DO DIALOG DISCARDABLE 51, 56, 333, 140 -STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "",ID_NO,40,108,53,14 - PUSHBUTTON "",ID_NO_TO_ALL,107,108,53,14 - PUSHBUTTON "",ID_YES,174,108,53,14 - PUSHBUTTON "",ID_YES_TO_ALL,241,108,53,14 - LTEXT "",IDC_MESSAGE0,16,13,301,33,NOT WS_GROUP - LTEXT "",IDC_MESSAGE1,16,50,301,19,NOT WS_GROUP - RTEXT "",IDC_STATIC,18,81,41,8 - LTEXT "Static",IDC_STATIC_SHARED_FILENAME,66,79,251,14, - SS_CENTERIMAGE | SS_SUNKEN -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_DLL_LOAD "Could not load %s" - IDS_ERROR_STRING_LOAD "Could not load string resource ID %d" - IDS_ERROR_STRING_NULL "Null pointer encountered." - IDS_ERROR_GLOBALALLOC "Memory allocation error." -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED -