diff --git a/xpinstall/packager/win_gre/config.it b/xpinstall/packager/win_gre/config.it index 7cc5f87a3ff..ffddcc97dd8 100644 --- a/xpinstall/packager/win_gre/config.it +++ b/xpinstall/packager/win_gre/config.it @@ -98,6 +98,12 @@ Refresh Icons=FALSE ;*** LOCALIZE ME BABY *** GRE Cleanup Orphans Message=Cleaning up orphaned GREs (Gecko Runtime Environments), please wait... +; Controls the check to see if user is installing on top of a previous +; installation of the product. If so, then prompt the user that cleanup +; of destination folder is highly recommended, or instability of product +; can occurr. +Cleanup On Upgrade=FALSE + ; This section contains info on how to send error information in case of ; either a download or xpinstall error. ; By default, this feature is enabled, unless disabled. @@ -747,7 +753,7 @@ Message Cancel Setup AUTO mode=Canceling Setup, please wait... ;*** LOCALIZE ME BABY *** Error File Uncompress=Error uncompressing file %s: %d ;*** LOCALIZE ME BABY *** -UsageMsg Usage=Usage: %s [options]\n [options] can be any of the following combination:\n -h: This help.\n -a [path]: Alternate archive search path.\n -app [app id]: ID of application which is launching the installer (shared installs)\n -app_path [app]: Points to (full path) representative file of application (Shared installs)\n * -dd [path]: Suggested install destination directory. (Shared installs)\n * -greLocal: Forces GRE to be installed into the application dir.\n * -greShared: Forces GRE to be installed into a global, shared dir (normally)\n c:\program files\common files\mozilla.org\GRE\n -reg_path [path]: Where to make entries in the Windows registry. (Shared installs)\n -f: Force install of GRE installer (Shared installs), though it'll work\n for non GRE installers too.\n -greForce: Force 'Component GRE' to be downloaded, run, and installed. This\n bypasses GRE's logic of determining when to install by running its\n installer with a '-f' flag.\n -n [filename]: Setup's parent process filename.\n * -ma: Run setup in Auto mode.\n * -ms: Run setup in Silent mode.\n -ira: Ignore the [RunAppX] sections\n -ispf: Ignore the [Program FolderX] sections that show\n the Start Menu shortcut folder at the end of installation.\n * -showBanner: Show the banner image in the download and install progress dialogs\n * -hideBanner: Hide the banner image in the download and install progress dialogs\n\n * means it will override config.ini +UsageMsg Usage=Usage: %s [options]\n [options] can be any of the following combination:\n -h: This help.\n -a [path]: Alternate archive search path.\n -app [app id]: ID of application which is launching the installer (shared installs)\n -app_path [app]: Points to (full path) representative file of application (Shared installs)\n * -dd [path]: Suggested install destination directory. (Shared installs)\n * -greLocal: Forces GRE to be installed into the application dir.\n * -greShared: Forces GRE to be installed into a global, shared dir (normally)\n c:\program files\common files\mozilla.org\GRE\n -reg_path [path]: Where to make entries in the Windows registry. (Shared installs)\n -f: Force install of GRE installer (Shared installs), though it'll work\n for non GRE installers too.\n -greForce: Force 'Component GRE' to be downloaded, run, and installed. This\n bypasses GRE's logic of determining when to install by running its\n installer with a '-f' flag.\n -n [filename]: Setup's parent process filename.\n * -ma: Run setup in Auto mode.\n * -ms: Run setup in Silent mode.\n -ira: Ignore the [RunAppX] sections\n -ispf: Ignore the [Program FolderX] sections that show\n the Start Menu shortcut folder at the end of installation.\n * -showBanner: Show the banner image in the download and install progress dialogs\n * -hideBanner: Hide the banner image in the download and install progress dialogs\n * -cleanupOnUpgrade: Tells Setup to check to see if user is upgrading (installing on top\n of previous version of product). If user is upgrading:\n * NORMAL mode: prompt user on how to proceed\n * All other modes: assume user wants to cleanup.\n * -noCleanupOnUpgrade: Tells Setup to not check if user is upgrading (installing on top\n of previous version of product). This will disable the cleanup feature.\n\n * means it will override config.ini ;*** LOCALIZE ME BABY *** IDC Use FTP=Use &FTP for downloading files ;*** LOCALIZE ME BABY *** @@ -764,6 +770,12 @@ Message Download Paused=Setup has encountered a network problem and has paused t Message NORMAL Restricted Access=Setup has detected that you do not have the appropriate Administrator privileges to this system. It is highly recommended that you do not continue with the installation of $ProductName$, or it may not function properly. Would you still like to continue? ;*** LOCALIZE ME BABY *** Message AUTO Restricted Access=Setup has detected that you do not have the appropriate Administrator privileges to this system. Setup cannot continue with the installation of $ProductName$. +;*** LOCALIZE ME BABY *** +Message Cleanup On Upgrade=A previous $ProductNameInternal$ installation has been found in the chosen directory.\n\nUnrecognized 3rd party components will be removed from this directory to prevent version incompatibilities and will have to be re-installed. Your $ProductNameInternal$ profile information will not be affected. +;*** LOCALIZE ME BABY *** +Message Cleanup On Upgrade Windir=Setup has detected that the previous installation of $ProductNameInternal$ was installed to a folder within your Windows folder. Setup will not attempt to cleanup the previous installation of $ProductNameInternal$ due to the potential removal of critical system files. +;*** LOCALIZE ME BABY *** +Cleanup On Upgrade Path Box String=Path to be cleaned up: [Site Selector] diff --git a/xpinstall/packager/win_gre/install.it b/xpinstall/packager/win_gre/install.it index e93b033ed83..25dc31a7c7c 100644 --- a/xpinstall/packager/win_gre/install.it +++ b/xpinstall/packager/win_gre/install.it @@ -18,6 +18,7 @@ CANCEL=Cancel CANCEL_=&Cancel NEXT_=&Next > BACK_=< &Back +IGNORE_=&Ignore PROXYSETTINGS=Proxy Settings: PROXYSETTINGS_=&Proxy Settings SERVER=Server: @@ -49,6 +50,8 @@ BROWSE_=B&rowse... CURRENTSETTINGS=Current Settings: INSTALL_=&Install DELETE_=&Delete +CONTINUE_=&Continue +SKIP_=&Skip README=Re&ad Me PAUSE_=&Pause RESUME_=&Resume @@ -122,4 +125,5 @@ ERROR_STRING_NULL=Null pointer encountered. ERROR_GLOBALALLOC=Memory allocation error. MSG_FORCE_QUIT_PROCESS=Setup has detected that %s (%s) is still running. Click OK to quit %s and proceed with installation. Alternatively, use the Windows Task Manager to quit %s, and then click OK to continue with installation. MSG_FORCE_QUIT_PROCESS_FAILED=Setup will now exit. Setup could not continue because %s (%s) is still running. Try manually quitting %s using Windows Task Manager, and then run Setup again. +ERROR_PATH_WITHIN_WINDIR=Setup has detected that you have selected a directory within the Windows directory and will not allow the installation to proceed. Please choose a different directory. diff --git a/xpinstall/packager/win_gre/uninstall.it b/xpinstall/packager/win_gre/uninstall.it index 575f5a72010..98e4cf0a43e 100644 --- a/xpinstall/packager/win_gre/uninstall.it +++ b/xpinstall/packager/win_gre/uninstall.it @@ -164,4 +164,6 @@ ERROR_GETVERSION=GetVersionEx() failed! MB_ATTENTION_STR=Attention 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. 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. diff --git a/xpinstall/packager/win_mfcembed/config.it b/xpinstall/packager/win_mfcembed/config.it index f2de273218b..ff7d229bdb0 100644 --- a/xpinstall/packager/win_mfcembed/config.it +++ b/xpinstall/packager/win_mfcembed/config.it @@ -125,6 +125,12 @@ GRE Private Key=Software\mozilla.org\GRE_$GreUniqueID$_PRIVATE_%ProductNameInter ; Default value is TRUE. Show Banner Image=TRUE +; Controls the check to see if user is installing on top of a previous +; installation of the product. If so, then prompt the user that cleanup +; of destination folder is highly recommended, or instability of product +; can occurr. +Cleanup On Upgrade=TRUE + ; This section contains info on how to send error information in case of ; either a download or xpinstall error. ; By default, this feature is enabled, unless disabled. @@ -783,7 +789,7 @@ Message Cancel Setup AUTO mode=Canceling Setup, please wait... ;*** LOCALIZE ME BABY *** Error File Uncompress=Error uncompressing file %s: %d ;*** LOCALIZE ME BABY *** -UsageMsg Usage=Usage: %s [options]\n [options] can be any of the following combination:\n -h: This help.\n -a [path]: Alternate archive search path.\n -app [app id]: ID of application which is launching the installer (shared installs)\n -app_path [app]: Points to (full path) representative file of application (Shared installs)\n * -dd [path]: Suggested install destination directory. (Shared installs)\n * -greLocal: Forces GRE to be installed into the application dir.\n * -greShared: Forces GRE to be installed into a global, shared dir (normally)\n c:\program files\common files\mozilla.org\GRE\n -reg_path [path]: Where to make entries in the Windows registry. (Shared installs)\n -f: Force install of GRE installer (Shared installs), though it'll work\n for non GRE installers too.\n -greForce: Force 'Component GRE' to be downloaded, run, and installed. This\n bypasses GRE's logic of determining when to install by running its\n installer with a '-f' flag.\n -n [filename]: Setup's parent process filename.\n * -ma: Run setup in Auto mode.\n * -ms: Run setup in Silent mode.\n -ira: Ignore the [RunAppX] sections\n -ispf: Ignore the [Program FolderX] sections that show\n the Start Menu shortcut folder at the end of installation.\n * -showBanner: Show the banner image in the download and install progress dialogs\n * -hideBanner: Hide the banner image in the download and install progress dialogs\n\n * means it will override config.ini +UsageMsg Usage=Usage: %s [options]\n [options] can be any of the following combination:\n -h: This help.\n -a [path]: Alternate archive search path.\n -app [app id]: ID of application which is launching the installer (shared installs)\n -app_path [app]: Points to (full path) representative file of application (Shared installs)\n * -dd [path]: Suggested install destination directory. (Shared installs)\n * -greLocal: Forces GRE to be installed into the application dir.\n * -greShared: Forces GRE to be installed into a global, shared dir (normally)\n c:\program files\common files\mozilla.org\GRE\n -reg_path [path]: Where to make entries in the Windows registry. (Shared installs)\n -f: Force install of GRE installer (Shared installs), though it'll work\n for non GRE installers too.\n -greForce: Force 'Component GRE' to be downloaded, run, and installed. This\n bypasses GRE's logic of determining when to install by running its\n installer with a '-f' flag.\n -n [filename]: Setup's parent process filename.\n * -ma: Run setup in Auto mode.\n * -ms: Run setup in Silent mode.\n -ira: Ignore the [RunAppX] sections\n -ispf: Ignore the [Program FolderX] sections that show\n the Start Menu shortcut folder at the end of installation.\n * -showBanner: Show the banner image in the download and install progress dialogs\n * -hideBanner: Hide the banner image in the download and install progress dialogs\n * -cleanupOnUpgrade: Tells Setup to check to see if user is upgrading (installing on top\n of previous version of product). If user is upgrading:\n * NORMAL mode: prompt user on how to proceed\n * All other modes: assume user wants to cleanup.\n * -noCleanupOnUpgrade: Tells Setup to not check if user is upgrading (installing on top\n of previous version of product). This will disable the cleanup feature.\n\n * means it will override config.ini ;*** LOCALIZE ME BABY *** IDC Use FTP=Use &FTP for downloading files ;*** LOCALIZE ME BABY *** @@ -800,6 +806,12 @@ Message Download Paused=Setup has encountered a network problem and has paused t Message NORMAL Restricted Access=Setup has detected that you do not have the appropriate Administrator privileges to this system. It is highly recommended that you do not continue with the installation of $ProductName$, or it may not function properly. Would you still like to continue? ;*** LOCALIZE ME BABY *** Message AUTO Restricted Access=Setup has detected that you do not have the appropriate Administrator privileges to this system. Setup cannot continue with the installation of $ProductName$. +;*** LOCALIZE ME BABY *** +Message Cleanup On Upgrade=A previous $ProductNameInternal$ installation has been found in the chosen directory.\n\nUnrecognized 3rd party components will be removed from this directory to prevent version incompatibilities and will have to be re-installed. Your $ProductNameInternal$ profile information will not be affected. +;*** LOCALIZE ME BABY *** +Message Cleanup On Upgrade Windir=Setup has detected that the previous installation of $ProductNameInternal$ was installed to a folder within your Windows folder. Setup will not attempt to cleanup the previous installation of $ProductNameInternal$ due to the potential removal of critical system files. +;*** LOCALIZE ME BABY *** +Cleanup On Upgrade Path Box String=Path to be cleaned up: [Site Selector] diff --git a/xpinstall/packager/win_mfcembed/install.it b/xpinstall/packager/win_mfcembed/install.it index e93b033ed83..25dc31a7c7c 100644 --- a/xpinstall/packager/win_mfcembed/install.it +++ b/xpinstall/packager/win_mfcembed/install.it @@ -18,6 +18,7 @@ CANCEL=Cancel CANCEL_=&Cancel NEXT_=&Next > BACK_=< &Back +IGNORE_=&Ignore PROXYSETTINGS=Proxy Settings: PROXYSETTINGS_=&Proxy Settings SERVER=Server: @@ -49,6 +50,8 @@ BROWSE_=B&rowse... CURRENTSETTINGS=Current Settings: INSTALL_=&Install DELETE_=&Delete +CONTINUE_=&Continue +SKIP_=&Skip README=Re&ad Me PAUSE_=&Pause RESUME_=&Resume @@ -122,4 +125,5 @@ ERROR_STRING_NULL=Null pointer encountered. ERROR_GLOBALALLOC=Memory allocation error. MSG_FORCE_QUIT_PROCESS=Setup has detected that %s (%s) is still running. Click OK to quit %s and proceed with installation. Alternatively, use the Windows Task Manager to quit %s, and then click OK to continue with installation. MSG_FORCE_QUIT_PROCESS_FAILED=Setup will now exit. Setup could not continue because %s (%s) is still running. Try manually quitting %s using Windows Task Manager, and then run Setup again. +ERROR_PATH_WITHIN_WINDIR=Setup has detected that you have selected a directory within the Windows directory and will not allow the installation to proceed. Please choose a different directory. diff --git a/xpinstall/packager/win_mfcembed/uninstall.it b/xpinstall/packager/win_mfcembed/uninstall.it index 1dd5809205c..e69de29bb2d 100644 --- a/xpinstall/packager/win_mfcembed/uninstall.it +++ b/xpinstall/packager/win_mfcembed/uninstall.it @@ -1,163 +0,0 @@ -[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=$CompanyName$ -Product Name=$ProductName$ - -; 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 - -Uninstall Filename=$UninstallFile$ -Defaults Info Filename=defaults_info.ini - -[Check Instance0] -Class Name=MozillaMessageWindow -Window Name= -Process Name=Mozilla.exe -Pretty Name=Mozilla -Message=Mozilla is detected to be currently running. Please quit Mozilla before continuing. Click OK to exit Mozilla automatically and proceed with uninstallation. -;*** LOCALIZE ME BABY *** -Message wait=Shutting down Mozilla. 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 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\Mozilla.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=MS Sans Serif -FONTSIZE=8 -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 -Show Dialog=TRUE -Title=$ProductName$ Uninstaller -Message0=Are you sure you want to completely remove %s and all of its components? - -Uninstall=&Uninstall -Cancel=&Cancel -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? -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. -FileName=File name: -No=&No -NoToAll=N&o to all -Yes=&Yes -YesToAll=Y&es to all - -; 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=Could not load %s -ERROR_STRING_LOAD=Could not load string resource ID %d -ERROR_STRING_NULL=Null pointer encountered. -ERROR_GLOBALALLOC=Memory allocation error. -ERROR_FAILED=%s failed. -ERROR_DIALOG_CREATE=Could not create %s dialog. -DLGQUITTITLE=Question -DLGQUITMSG=Are you sure you want to cancel? -ERROR_GET_SYSTEM_DIRECTORY_FAILED=GetSystemDirectory() failed. -ERROR_GET_WINDOWS_DIRECTORY_FAILED=GetWindowsDirectory() failed. -ERROR_CREATE_TEMP_DIR=Uninstall was not able to create the TEMP directory: %s -ERROR_SETUP_REQUIREMENT=Windows95 or greater Operating System is required! Exiting Uninstall... -MB_WARNING_STR=Warning -ERROR_UNINSTALL_LOG_FOLDER=Uninstall log folder not found:%s -MB_MESSAGE_STR=Message -DLG_REMOVE_FILE_TITLE=Remove File? -ERROR_GETVERSION=GetVersionEx() failed! -MB_ATTENTION_STR=Attention -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. -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. - diff --git a/xpinstall/packager/windows/config.it b/xpinstall/packager/windows/config.it index 09e45fa322f..0b28c848db7 100644 --- a/xpinstall/packager/windows/config.it +++ b/xpinstall/packager/windows/config.it @@ -123,6 +123,12 @@ GRE Private Key=Software\mozilla.org\GRE_$GreUniqueID$_PRIVATE_$ProductNameInter ; Default value is TRUE. Show Banner Image=TRUE +; Controls the check to see if user is installing on top of a previous +; installation of the product. If so, then prompt the user that cleanup +; of destination folder is highly recommended, or instability of product +; can occurr. +Cleanup On Upgrade=TRUE + ; This section contains info on how to send error information in case of ; either a download or xpinstall error. ; By default, this feature is enabled, unless disabled. @@ -1219,7 +1225,7 @@ Message Cancel Setup AUTO mode=Canceling Setup, please wait... ;*** LOCALIZE ME BABY *** Error File Uncompress=Error uncompressing file %s: %d ;*** LOCALIZE ME BABY *** -UsageMsg Usage=Usage: %s [options]\n [options] can be any of the following combination:\n -h: This help.\n -a [path]: Alternate archive search path.\n -app [app id]: ID of application which is launching the installer (shared installs)\n -app_path [app]: Points to (full path) representative file of application (Shared installs)\n * -dd [path]: Suggested install destination directory. (Shared installs)\n * -greLocal: Forces GRE to be installed into the application dir.\n * -greShared: Forces GRE to be installed into a global, shared dir (normally)\n c:\program files\common files\mozilla.org\GRE\n -reg_path [path]: Where to make entries in the Windows registry. (Shared installs)\n -f: Force install of GRE installer (Shared installs), though it'll work\n for non GRE installers too.\n -greForce: Force 'Component GRE' to be downloaded, run, and installed. This\n bypasses GRE's logic of determining when to install by running its\n installer with a '-f' flag.\n -n [filename]: Setup's parent process filename.\n * -ma: Run setup in Auto mode.\n * -ms: Run setup in Silent mode.\n -ira: Ignore the [RunAppX] sections\n -ispf: Ignore the [Program FolderX] sections that show\n the Start Menu shortcut folder at the end of installation.\n * -showBanner: Show the banner image in the download and install progress dialogs\n * -hideBanner: Hide the banner image in the download and install progress dialogs\n\n * means it will override config.ini +UsageMsg Usage=Usage: %s [options]\n [options] can be any of the following combination:\n -h: This help.\n -a [path]: Alternate archive search path.\n -app [app id]: ID of application which is launching the installer (shared installs)\n -app_path [app]: Points to (full path) representative file of application (Shared installs)\n * -dd [path]: Suggested install destination directory. (Shared installs)\n * -greLocal: Forces GRE to be installed into the application dir.\n * -greShared: Forces GRE to be installed into a global, shared dir (normally)\n c:\program files\common files\mozilla.org\GRE\n -reg_path [path]: Where to make entries in the Windows registry. (Shared installs)\n -f: Force install of GRE installer (Shared installs), though it'll work\n for non GRE installers too.\n -greForce: Force 'Component GRE' to be downloaded, run, and installed. This\n bypasses GRE's logic of determining when to install by running its\n installer with a '-f' flag.\n -n [filename]: Setup's parent process filename.\n * -ma: Run setup in Auto mode.\n * -ms: Run setup in Silent mode.\n -ira: Ignore the [RunAppX] sections\n -ispf: Ignore the [Program FolderX] sections that show\n the Start Menu shortcut folder at the end of installation.\n * -showBanner: Show the banner image in the download and install progress dialogs\n * -hideBanner: Hide the banner image in the download and install progress dialogs\n * -cleanupOnUpgrade: Tells Setup to check to see if user is upgrading (installing on top\n of previous version of product). If user is upgrading:\n * NORMAL mode: prompt user on how to proceed\n * All other modes: assume user wants to cleanup.\n * -noCleanupOnUpgrade: Tells Setup to not check if user is upgrading (installing on top\n of previous version of product). This will disable the cleanup feature.\n\n * means it will override config.ini ;*** LOCALIZE ME BABY *** IDC Use FTP=Use &FTP for downloading files ;*** LOCALIZE ME BABY *** @@ -1236,6 +1242,12 @@ Message Download Paused=Setup has encountered a network problem and has paused t Message NORMAL Restricted Access=Setup has detected that you do not have the appropriate Administrator privileges to this system. It is highly recommended that you do not continue with the installation of $ProductName$, or it may not function properly. Would you still like to continue? ;*** LOCALIZE ME BABY *** Message AUTO Restricted Access=Setup has detected that you do not have the appropriate Administrator privileges to this system. Setup cannot continue with the installation of $ProductName$. +;*** LOCALIZE ME BABY *** +Message Cleanup On Upgrade=A previous $ProductNameInternal$ installation has been found in the chosen directory.\n\nUnrecognized 3rd party components will be removed from this directory to prevent version incompatibilities and will have to be re-installed. Your $ProductNameInternal$ profile information will not be affected. +;*** LOCALIZE ME BABY *** +Message Cleanup On Upgrade Windir=Setup has detected that the previous installation of $ProductNameInternal$ was installed to a folder within your Windows folder. Setup will not attempt to cleanup the previous installation of $ProductNameInternal$ due to the potential removal of critical system files. +;*** LOCALIZE ME BABY *** +Cleanup On Upgrade Path Box String=Path to be cleaned up: [Site Selector] diff --git a/xpinstall/packager/windows/install.it b/xpinstall/packager/windows/install.it index e93b033ed83..25dc31a7c7c 100644 --- a/xpinstall/packager/windows/install.it +++ b/xpinstall/packager/windows/install.it @@ -18,6 +18,7 @@ CANCEL=Cancel CANCEL_=&Cancel NEXT_=&Next > BACK_=< &Back +IGNORE_=&Ignore PROXYSETTINGS=Proxy Settings: PROXYSETTINGS_=&Proxy Settings SERVER=Server: @@ -49,6 +50,8 @@ BROWSE_=B&rowse... CURRENTSETTINGS=Current Settings: INSTALL_=&Install DELETE_=&Delete +CONTINUE_=&Continue +SKIP_=&Skip README=Re&ad Me PAUSE_=&Pause RESUME_=&Resume @@ -122,4 +125,5 @@ ERROR_STRING_NULL=Null pointer encountered. ERROR_GLOBALALLOC=Memory allocation error. MSG_FORCE_QUIT_PROCESS=Setup has detected that %s (%s) is still running. Click OK to quit %s and proceed with installation. Alternatively, use the Windows Task Manager to quit %s, and then click OK to continue with installation. MSG_FORCE_QUIT_PROCESS_FAILED=Setup will now exit. Setup could not continue because %s (%s) is still running. Try manually quitting %s using Windows Task Manager, and then run Setup again. +ERROR_PATH_WITHIN_WINDIR=Setup has detected that you have selected a directory within the Windows directory and will not allow the installation to proceed. Please choose a different directory. diff --git a/xpinstall/packager/windows/uninstall.it b/xpinstall/packager/windows/uninstall.it index 84fa4f9cb42..b1076660d9b 100644 --- a/xpinstall/packager/windows/uninstall.it +++ b/xpinstall/packager/windows/uninstall.it @@ -162,4 +162,6 @@ ERROR_GETVERSION=GetVersionEx() failed! MB_ATTENTION_STR=Attention 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. 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. diff --git a/xpinstall/wizard/windows/setup/dialogs.c b/xpinstall/wizard/windows/setup/dialogs.c index 9045fbb823d..d4e33cd5998 100644 --- a/xpinstall/wizard/windows/setup/dialogs.c +++ b/xpinstall/wizard/windows/setup/dialogs.c @@ -466,63 +466,58 @@ LRESULT CALLBACK BrowseHookProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l } AppendBackSlash(szBuf, sizeof(szBuf)); + + /* Make sure that the path is not within the windows dir */ + if(IsPathWithinWindir(szBuf)) + { + char errorMsg[MAX_BUF]; + char errorMsgTitle[MAX_BUF]; + + GetPrivateProfileString("Messages", "ERROR_PATH_WITHIN_WINDIR", + "", errorMsg, sizeof(errorMsg), szFileIniInstall); + GetPrivateProfileString("Messages", "ERROR_MESSAGE_TITLE", "", + errorMsgTitle, sizeof(errorMsgTitle), szFileIniInstall); + MessageBox(hDlg, errorMsg, errorMsgTitle, MB_OK | MB_ICONERROR); + break; + } + + /* Create the path if it does not exist */ if(FileExists(szBuf) == FALSE) { - char szMsgCreateDirectory[MAX_BUF]; - char szStrCreateDirectory[MAX_BUF]; char szBufTemp[MAX_BUF]; - char szBufTemp2[MAX_BUF]; + char szBuf2[MAX_PATH]; - GetPrivateProfileString("Messages", "STR_CREATE_DIRECTORY", "", szStrCreateDirectory, sizeof(szStrCreateDirectory), szFileIniInstall); - if(GetPrivateProfileString("Messages", "MSG_CREATE_DIRECTORY", "", szMsgCreateDirectory, sizeof(szMsgCreateDirectory), szFileIniInstall)) + if(CreateDirectoriesAll(szBuf, ADD_TO_UNINSTALL_LOG) != WIZ_OK) { + char szECreateDirectory[MAX_BUF]; + char szEMessageTitle[MAX_BUF]; + lstrcpy(szBufTemp, "\n\n"); - lstrcat(szBufTemp, szBuf); + lstrcat(szBufTemp, sgProduct.szPath); RemoveBackSlash(szBufTemp); lstrcat(szBufTemp, "\n\n"); - wsprintf(szBufTemp2, szMsgCreateDirectory, szBufTemp); - } - if(MessageBox(hDlg, szBufTemp2, szStrCreateDirectory, MB_YESNO | MB_ICONQUESTION) == IDYES) - { - char szBuf2[MAX_PATH]; + if(GetPrivateProfileString("Messages", "ERROR_CREATE_DIRECTORY", "", szECreateDirectory, sizeof(szECreateDirectory), szFileIniInstall)) + wsprintf(szBuf, szECreateDirectory, szBufTemp); - if(CreateDirectoriesAll(szBuf, ADD_TO_UNINSTALL_LOG) != WIZ_OK) - { - char szECreateDirectory[MAX_BUF]; - char szEMessageTitle[MAX_BUF]; + GetPrivateProfileString("Messages", "ERROR_MESSAGE_TITLE", "", szEMessageTitle, sizeof(szEMessageTitle), szFileIniInstall); - lstrcpy(szBufTemp, "\n\n"); - lstrcat(szBufTemp, sgProduct.szPath); - RemoveBackSlash(szBufTemp); - lstrcat(szBufTemp, "\n\n"); - - if(GetPrivateProfileString("Messages", "ERROR_CREATE_DIRECTORY", "", szECreateDirectory, sizeof(szECreateDirectory), szFileIniInstall)) - wsprintf(szBuf, szECreateDirectory, szBufTemp); - - GetPrivateProfileString("Messages", "ERROR_MESSAGE_TITLE", "", szEMessageTitle, sizeof(szEMessageTitle), szFileIniInstall); - - MessageBox(hDlg, szBuf, szEMessageTitle, MB_OK | MB_ICONERROR); - break; - } - - if(*sgProduct.szSubPath != '\0') - { - /* log the subpath for uninstallation. This subpath does not normally get logged - * for uninstallation due to a chicken and egg problem with creating the log file - * and the directory its in */ - lstrcpy(szBuf2, szBuf); - AppendBackSlash(szBuf2, sizeof(szBuf2)); - lstrcat(szBuf2, sgProduct.szSubPath); - UpdateInstallLog(KEY_CREATE_FOLDER, szBuf2, FALSE); - } - - bCreateDestinationDir = TRUE; - } - else - { + MessageBox(hDlg, szBuf, szEMessageTitle, MB_OK | MB_ICONERROR); break; } + + if(*sgProduct.szSubPath != '\0') + { + /* log the subpath for uninstallation. This subpath does not normally get logged + * for uninstallation due to a chicken and egg problem with creating the log file + * and the directory its in */ + lstrcpy(szBuf2, szBuf); + AppendBackSlash(szBuf2, sizeof(szBuf2)); + lstrcat(szBuf2, sgProduct.szSubPath); + UpdateInstallLog(KEY_CREATE_FOLDER, szBuf2, FALSE); + } + + bCreateDestinationDir = TRUE; } lstrcpy(szTempSetupPath, szBuf); @@ -665,7 +660,6 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara HWND hDestinationPath; char szBuf[MAX_BUF]; char szBufTemp[MAX_BUF]; - char szBufTemp2[MAX_BUF]; hRadioSt0 = GetDlgItem(hDlg, IDC_RADIO_ST0); hStaticSt0 = GetDlgItem(hDlg, IDC_STATIC_ST0_DESCRIPTION); @@ -839,93 +833,70 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara lstrcpy(szBuf, sgProduct.szPath); AppendBackSlash(szBuf, sizeof(szBuf)); + /* Make sure that the path is not within the windows dir */ + if(IsPathWithinWindir(szBuf)) + { + char errorMsg[MAX_BUF]; + char errorMsgTitle[MAX_BUF]; + + GetPrivateProfileString("Messages", "ERROR_PATH_WITHIN_WINDIR", + "", errorMsg, sizeof(errorMsg), szFileIniInstall); + GetPrivateProfileString("Messages", "ERROR_MESSAGE_TITLE", "", + errorMsgTitle, sizeof(errorMsgTitle), szFileIniInstall); + MessageBox(hDlg, errorMsg, errorMsgTitle, MB_OK | MB_ICONERROR); + break; + } + + /* Create the path if it does not exist */ if(FileExists(szBuf) == FALSE) { - char szMsgCreateDirectory[MAX_BUF]; - char szStrCreateDirectory[MAX_BUF]; + char szBuf2[MAX_PATH]; - GetPrivateProfileString("Messages", "STR_CREATE_DIRECTORY", "", szStrCreateDirectory, sizeof(szStrCreateDirectory), szFileIniInstall); - if(GetPrivateProfileString("Messages", "MSG_CREATE_DIRECTORY", "", szMsgCreateDirectory, sizeof(szMsgCreateDirectory), szFileIniInstall)) + if(CreateDirectoriesAll(szBuf, ADD_TO_UNINSTALL_LOG) != WIZ_OK) { + char szECreateDirectory[MAX_BUF]; + char szEMessageTitle[MAX_BUF]; + lstrcpy(szBufTemp, "\n\n"); - lstrcat(szBufTemp, szBuf); + lstrcat(szBufTemp, sgProduct.szPath); RemoveBackSlash(szBufTemp); lstrcat(szBufTemp, "\n\n"); - wsprintf(szBufTemp2, szMsgCreateDirectory, szBufTemp); - } - if(MessageBox(hDlg, szBufTemp2, szStrCreateDirectory, MB_YESNO | MB_ICONQUESTION) == IDYES) - { - char szBuf2[MAX_PATH]; + if(GetPrivateProfileString("Messages", "ERROR_CREATE_DIRECTORY", "", szECreateDirectory, sizeof(szECreateDirectory), szFileIniInstall)) + wsprintf(szBuf, szECreateDirectory, szBufTemp); - if(CreateDirectoriesAll(szBuf, ADD_TO_UNINSTALL_LOG) != WIZ_OK) - { - char szECreateDirectory[MAX_BUF]; - char szEMessageTitle[MAX_BUF]; + GetPrivateProfileString("Messages", "ERROR_MESSAGE_TITLE", "", szEMessageTitle, sizeof(szEMessageTitle), szFileIniInstall); - lstrcpy(szBufTemp, "\n\n"); - lstrcat(szBufTemp, sgProduct.szPath); - RemoveBackSlash(szBufTemp); - lstrcat(szBufTemp, "\n\n"); - - if(GetPrivateProfileString("Messages", "ERROR_CREATE_DIRECTORY", "", szECreateDirectory, sizeof(szECreateDirectory), szFileIniInstall)) - wsprintf(szBuf, szECreateDirectory, szBufTemp); - - GetPrivateProfileString("Messages", "ERROR_MESSAGE_TITLE", "", szEMessageTitle, sizeof(szEMessageTitle), szFileIniInstall); - - MessageBox(hDlg, szBuf, szEMessageTitle, MB_OK | MB_ICONERROR); - break; - } - - if(*sgProduct.szSubPath != '\0') - { - /* log the subpath for uninstallation. This subpath does not normally get logged - * for uninstallation due to a chicken and egg problem with creating the log file - * and the directory its in */ - lstrcpy(szBuf2, szBuf); - AppendBackSlash(szBuf2, sizeof(szBuf2)); - lstrcat(szBuf2, sgProduct.szSubPath); - UpdateInstallLog(KEY_CREATE_FOLDER, szBuf2, FALSE); - } - - bCreateDestinationDir = TRUE; - } - else - { + MessageBox(hDlg, szBuf, szEMessageTitle, MB_OK | MB_ICONERROR); break; } + + if(*sgProduct.szSubPath != '\0') + { + /* log the subpath for uninstallation. This subpath does not normally get logged + * for uninstallation due to a chicken and egg problem with creating the log file + * and the directory its in */ + lstrcpy(szBuf2, szBuf); + AppendBackSlash(szBuf2, sizeof(szBuf2)); + lstrcat(szBuf2, sgProduct.szSubPath); + UpdateInstallLog(KEY_CREATE_FOLDER, szBuf2, FALSE); + } + + bCreateDestinationDir = TRUE; } /* retrieve and save the state of the selected radio button */ if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST0) == BST_CHECKED) - { - SiCNodeSetItemsSelected(ST_RADIO0); - dwSetupType = ST_RADIO0; - dwTempSetupType = dwSetupType; - } else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST1) == BST_CHECKED) - { - SiCNodeSetItemsSelected(ST_RADIO1); - dwSetupType = ST_RADIO1; - dwTempSetupType = dwSetupType; - } else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST2) == BST_CHECKED) - { - SiCNodeSetItemsSelected(ST_RADIO2); - dwSetupType = ST_RADIO2; - dwTempSetupType = dwSetupType; - } else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST3) == BST_CHECKED) - { - SiCNodeSetItemsSelected(ST_RADIO3); - dwSetupType = ST_RADIO3; - dwTempSetupType = dwSetupType; - } + dwTempSetupType = dwSetupType; + SiCNodeSetItemsSelected(dwSetupType); DestroyWindow(hDlg); DlgSequence(NEXT_DLG); break; @@ -951,6 +922,90 @@ LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara return(0); } +LRESULT CALLBACK DlgProcUpgrade(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam) +{ + char buf[MAX_BUF]; + + switch(msg) + { + case WM_INITDIALOG: + DisableSystemMenuItems(hDlg, FALSE); + + GetPrivateProfileString("Messages", "MB_WARNING_STR", "", + buf, sizeof(buf), szFileIniInstall); + SetWindowText(hDlg, buf); + + GetPrivateProfileString("Strings", "Message Cleanup On Upgrade", "", + buf, sizeof(buf), szFileIniConfig); + ReplacePrivateProfileStrCR(buf); + SetDlgItemText(hDlg, IDC_MESSAGE0, buf); + + GetPrivateProfileString("Strings", "Cleanup On Upgrade Path Box String", "", + buf, sizeof(buf), szFileIniConfig); + SetDlgItemText(hDlg, IDC_STATIC, buf); + + MozCopyStr(sgProduct.szPath, buf, sizeof(buf)); + RemoveBackSlash(buf); + SetDlgItemText(hDlg, IDC_DELETE_PATH, buf); + + RepositionWindow(hDlg, NO_BANNER_IMAGE); + + SetDlgItemText(hDlg, IDCONTINUE, sgInstallGui.szContinue_); + SetDlgItemText(hDlg, IDSKIP, sgInstallGui.szSkip_); + SetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_); + SendDlgItemMessage (hDlg, IDC_STATIC, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + SendDlgItemMessage (hDlg, IDC_MESSAGE0, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + SendDlgItemMessage (hDlg, IDC_DELETE_PATH, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + SendDlgItemMessage (hDlg, IDCONTINUE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + SendDlgItemMessage (hDlg, IDSKIP, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + SendDlgItemMessage (hDlg, IDWIZBACK, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); + break; + + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDCONTINUE: + /* If the installation path happens to be within the %windir%, then + * show error message and continue without removing the previous + * installation path. */ + if(IsPathWithinWindir(sgProduct.szPath)) + { + GetPrivateProfileString("Strings", "Message Cleanup On Upgrade Windir", "", + buf, sizeof(buf), szFileIniConfig); + MessageBox(hWndMain, buf, NULL, MB_ICONEXCLAMATION); + } + else + /* set the var to delete target path here */ + sgProduct.doCleanupOnUpgrade = TRUE; + + SiCNodeSetItemsSelected(dwSetupType); + SaveWindowPosition(hDlg); + DestroyWindow(hDlg); + DlgSequence(NEXT_DLG); + break; + + case IDSKIP: + sgProduct.doCleanupOnUpgrade = FALSE; + SiCNodeSetItemsSelected(dwSetupType); + SaveWindowPosition(hDlg); + DestroyWindow(hDlg); + DlgSequence(NEXT_DLG); + break; + + case IDWIZBACK: + SaveWindowPosition(hDlg); + DestroyWindow(hDlg); + DlgSequence(PREV_DLG); + break; + + default: + break; + } + break; + } + return(0); +} + void DrawLBText(LPDRAWITEMSTRUCT lpdis, DWORD dwACFlag) { siC *siCTemp = NULL; @@ -2677,6 +2732,9 @@ void DlgSequence(int iDirection) dwWizardState = DLG_SETUP_TYPE; break; case DLG_SETUP_TYPE: + dwWizardState = DLG_UPGRADE; + break; + case DLG_UPGRADE: dwWizardState = DLG_SELECT_COMPONENTS; break; case DLG_SELECT_COMPONENTS: @@ -2719,6 +2777,9 @@ void DlgSequence(int iDirection) case DLG_SETUP_TYPE: dwWizardState = DLG_LICENSE; break; + case DLG_UPGRADE: + dwWizardState = DLG_SETUP_TYPE; + break; case DLG_SELECT_COMPONENTS: dwWizardState = DLG_SETUP_TYPE; break; @@ -2794,6 +2855,47 @@ void DlgSequence(int iDirection) } break; + case DLG_UPGRADE: + if(sgProduct.checkCleanupOnUpgrade) + { + char buf[MAX_BUF]; + + // Found destination folder. check to see if we're upgrading ontop + // of a previous installation. If so, we need to prompt the user + // about removing the entire dir before installation happens. + MozCopyStr(sgProduct.szPath, buf, sizeof(buf)); + AppendBackSlash(buf, sizeof(buf)); + lstrcat(buf, sgProduct.szProgramName); + if(FileExists(buf)) + { + char warningTitleString[MAX_BUF]; + + GetPrivateProfileString("Messages", "MB_WARNING_STR", "", + warningTitleString, sizeof(warningTitleString), + szFileIniInstall); + + /* Prompt user if deleting target path is okay. Only show + * prompt if the setup is running in normal mode, else + * assume user wants deletion */ + if(sgProduct.mode == NORMAL) + { + hDlgCurrent = InstantiateDialog(hWndMain, dwWizardState, + warningTitleString, DlgProcUpgrade); + bDone = TRUE; + } + else + sgProduct.doCleanupOnUpgrade = TRUE; + } + } + + /* SiCNodeSetItemsSelected() is called from within DlgProcUpgrade(). + * If DlgProcUpgrade is not called (in the case of a !NORMAL install), + * then we need to call it here. */ + if(sgProduct.mode != NORMAL) + SiCNodeSetItemsSelected(dwSetupType); + + break; + case DLG_SELECT_COMPONENTS: if((diSelectComponents.bShowDialog) && (sgProduct.dwCustomType == dwSetupType)) { @@ -2989,6 +3091,14 @@ void CommitInstall(void) return; } + /* Remove the previous installation of the product here. + * This should be done before processing the Xpinstall engine. */ + if(sgProduct.doCleanupOnUpgrade) + { + SetSetupState(SETUP_STATE_REMOVING_PREV_INST); + CleanupOnUpgrade(); + } + if(gbDownloadTriggered || gbPreviousUnfinishedDownload) SetSetupState(SETUP_STATE_UNPACK_XPCOM); diff --git a/xpinstall/wizard/windows/setup/extra.c b/xpinstall/wizard/windows/setup/extra.c index dc75b9597de..00b41a79c51 100644 --- a/xpinstall/wizard/windows/setup/extra.c +++ b/xpinstall/wizard/windows/setup/extra.c @@ -57,6 +57,7 @@ void LaunchExistingGreInstaller(greInfo *gre); HRESULT GetInstalledGreConfigIni(greInfo *aGre, char *aGreConfigIni, DWORD aGreConfigIniBufSize); HRESULT GetInfoFromInstalledGreConfigIni(greInfo *aGre); HRESULT DetermineGreComponentDestinationPath(char *aInPath, char *aOutPath, DWORD aOutPathBufSize); +BOOL IsOkToRemoveFileOrDirname(char *aFileOrDirname); static greInfo gGre; @@ -65,6 +66,11 @@ char *ArchiveExtensions[] = {"zip", "jar", ""}; +char *ExcludeRemoveList[] = {"plugins", + "uninstall", + "install_status.log", + ""}; + #define SETUP_STATE_REG_KEY "Software\\%s\\%s\\%s\\Setup" #define APP_PATHS_KEY "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\%s" @@ -2410,6 +2416,144 @@ HRESULT LaunchApps() return(0); } +/* Function: IsPathWithinWindir() + * in: char *aTargetPath + * out: returns a BOOL type indicating whether the install path chosen + * by the user is within the %windir% or not. + * purpose: To see if aTargetPath is within the %windir% path. + */ +BOOL IsPathWithinWindir(char *aTargetPath) +{ + char windir[MAX_PATH]; + char targetPath[MAX_PATH]; + + assert(aTargetPath); + + if(GetWindowsDirectory(windir, sizeof(windir))) + { + MozCopyStr(aTargetPath, targetPath, sizeof(targetPath)); + RemoveBackSlash(targetPath); + CharUpperBuff(targetPath, sizeof(targetPath)); + RemoveBackSlash(windir); + CharUpperBuff(windir, sizeof(windir)); + if(strstr(targetPath, windir) == targetPath) + return(TRUE); + } + else + { + /* If we can't get the windows path, just show error message and assume + * the install path is not within the windows dir. */ + char szEGetWindirFailed[MAX_BUF]; + + if(GetPrivateProfileString("Messages", "ERROR_GET_WINDOWS_DIRECTORY_FAILED", "", szEGetWindirFailed, sizeof(szEGetWindirFailed), szFileIniInstall)) + PrintError(szEGetWindirFailed, ERROR_CODE_SHOW); + } + return(FALSE); +} + +/* Function: IsOkToRemoveFileOrDir() + * in: char *aFileOrDirname + * out: bool return type + * purpose: To check if the file or dirname is not in the ExcludeRemoveList. + */ +BOOL IsOkToRemoveFileOrDirname(char *aFileOrDirname) +{ + int i; + + i = 0; + while(*ExcludeRemoveList[i] != '\0') + { + if(lstrcmpi(aFileOrDirname, ExcludeRemoveList[i]) == 0) + return(FALSE); + + ++i; + } + return(TRUE); +} + +/* Function: CleanupOnUpgrade() + * in: none. + * out: none. + * purpose: To cleanup/remove files and dirs within the user chosen + * installation path, excluding the list in + * ExcludeRemoveList. + */ +void CleanupOnUpgrade() +{ + HANDLE fileHandle; + WIN32_FIND_DATA fdFile; + char destPathTemp[MAX_BUF]; + char targetPath[MAX_BUF]; + char buf[MAX_BUF]; + BOOL found; + + MozCopyStr(sgProduct.szPath, targetPath, sizeof(targetPath)); + RemoveBackSlash(targetPath); + + if(!FileExists(targetPath)) + return; + + UpdateInstallStatusLog("\n Files/Dirs deleted on upgrade:\n"); + + /* Check to see if the installation path is within the %windir%. If so, + * warn the user and do not delete any file! */ + if(IsPathWithinWindir(targetPath)) + { + if(sgProduct.mode == NORMAL) + { + GetPrivateProfileString("Strings", "Message Cleanup On Upgrade Windir", "", + buf, sizeof(buf), szFileIniConfig); + MessageBox(hWndMain, buf, NULL, MB_ICONEXCLAMATION); + } + + _snprintf(buf, sizeof(buf), " None. Installation path is within %windir%:\n %s\n", targetPath); + buf[sizeof(buf) - 1] = '\0'; + UpdateInstallStatusLog(buf); + return; + } + + _snprintf(destPathTemp, sizeof(destPathTemp), "%s\\*", targetPath); + destPathTemp[sizeof(destPathTemp) - 1] = '\0'; + + found = TRUE; + fileHandle = FindFirstFile(destPathTemp, &fdFile); + while((fileHandle != INVALID_HANDLE_VALUE) && (found == TRUE)) + { + if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0)) + { + /* create full path */ + _snprintf(destPathTemp, sizeof(destPathTemp), "%s\\%s", targetPath, fdFile.cFileName); + destPathTemp[sizeof(destPathTemp) - 1] = '\0'; + + if(IsOkToRemoveFileOrDirname(fdFile.cFileName)) + { + if(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + AppendBackSlash(destPathTemp, sizeof(destPathTemp)); + DirectoryRemove(destPathTemp, TRUE); + } + else + DeleteFile(destPathTemp); + + /* Check to see if the file/dir was deleted successfully */ + if(!FileExists(destPathTemp)) + _snprintf(buf, sizeof(buf), " ok: %s\n", destPathTemp); + else + _snprintf(buf, sizeof(buf), " failed: %s\n", destPathTemp); + } + else + _snprintf(buf, sizeof(buf), " skipped: %s\n", destPathTemp); + + buf[sizeof(buf) - 1] = '\0'; + UpdateInstallStatusLog(buf); + } + + found = FindNextFile(fileHandle, &fdFile); + } + + FindClose(fileHandle); +} + /* Function: ProcessGre() * in: none. * out: path to where gre is installed at. @@ -3047,6 +3191,8 @@ HRESULT InitSetupGeneral() sgProduct.mode = NOT_SET; sgProduct.bSharedInst = FALSE; sgProduct.bInstallFiles = TRUE; + sgProduct.checkCleanupOnUpgrade = FALSE; + sgProduct.doCleanupOnUpgrade = FALSE; sgProduct.greType = GRE_TYPE_NOT_SET; sgProduct.dwCustomType = ST_RADIO0; sgProduct.dwNumberOfComponents = 0; @@ -3572,6 +3718,20 @@ void RestoreAdditionalFlag(siC *siCNode) siCNode->dwAttributes &= ~SIC_ADDITIONAL; } +void RestoreEnabledFlag(siC *siCNode) +{ + char szBuf[MAX_BUF_TINY]; + char szAttribute[MAX_BUF_TINY]; + + GetPrivateProfileString(siCNode->szReferenceName, "Attributes", "", szBuf, sizeof(szBuf), szFileIniConfig); + lstrcpy(szAttribute, szBuf); + CharUpperBuff(szAttribute, sizeof(szAttribute)); + + if(strstr(szAttribute, "ENABLED") && !strstr(szAttribute, "DISABLED")) + siCNode->dwAttributes |= SIC_DISABLED; + else + siCNode->dwAttributes &= ~SIC_DISABLED; +} // This function: // - Zeros the SELECTED and ADDITIONAL attributes of all components. @@ -3651,6 +3811,11 @@ void SiCNodeSetItemsSelected(DWORD dwSetupType) if(!siCNode->bSupersede) siCNode->dwAttributes |= SIC_SELECTED; + /* We need to restore the ENBLED/DISABLED flag for this component + * from config.ini because it could have been altered in + * ResolveForceUpgrade(). We need to restore it here so the override + * attribute can override it here. */ + RestoreEnabledFlag(siCNode); if(*szOverrideAttributes != '\0') siCNode->dwAttributes = ParseComponentAttributes(szOverrideAttributes, siCNode->dwAttributes, TRUE); } @@ -4699,22 +4864,25 @@ BOOL ResolveForceUpgrade(siC *siCObject) siCObject->bForceUpgrade = FALSE; if(siCObject->dwAttributes & SIC_FORCE_UPGRADE) { - dwIndex = 0; - BuildNumberedString(dwIndex, NULL, "Force Upgrade File", szKey, sizeof(szKey)); - GetPrivateProfileString(siCObject->szReferenceName, szKey, "", szForceUpgradeFile, sizeof(szForceUpgradeFile), szFileIniConfig); - while(*szForceUpgradeFile != '\0') + if(!sgProduct.doCleanupOnUpgrade) { - DecryptString(szFilePath, szForceUpgradeFile); - if(FileExists(szFilePath)) - { - siCObject->bForceUpgrade = TRUE; - - /* Found at least one file, so break out of while loop */ - break; - } - - BuildNumberedString(++dwIndex, NULL, "Force Upgrade File", szKey, sizeof(szKey)); + dwIndex = 0; + BuildNumberedString(dwIndex, NULL, "Force Upgrade File", szKey, sizeof(szKey)); GetPrivateProfileString(siCObject->szReferenceName, szKey, "", szForceUpgradeFile, sizeof(szForceUpgradeFile), szFileIniConfig); + while(*szForceUpgradeFile != '\0') + { + DecryptString(szFilePath, szForceUpgradeFile); + if(FileExists(szFilePath)) + { + siCObject->bForceUpgrade = TRUE; + + /* Found at least one file, so break out of while loop */ + break; + } + + BuildNumberedString(++dwIndex, NULL, "Force Upgrade File", szKey, sizeof(szKey)); + GetPrivateProfileString(siCObject->szReferenceName, szKey, "", szForceUpgradeFile, sizeof(szForceUpgradeFile), szFileIniConfig); + } } if(siCObject->bForceUpgrade) @@ -5745,13 +5913,13 @@ DWORD ParseCommandLine(LPSTR aMessageToClose, LPSTR lpszCmdLine) lstrcpy(sgProduct.szRegPath, szArgVBuf); } else if(!lstrcmpi(szArgVBuf, "-showBanner") || !lstrcmpi(szArgVBuf, "/showBanner")) - { gShowBannerImage = TRUE; - } else if(!lstrcmpi(szArgVBuf, "-hideBanner") || !lstrcmpi(szArgVBuf, "/hideBanner")) - { gShowBannerImage = FALSE; - } + else if(!lstrcmpi(szArgVBuf, "-cleanupOnUpgrade") || !lstrcmpi(szArgVBuf, "/cleanupOnUpgrade")) + sgProduct.checkCleanupOnUpgrade = TRUE; + else if(!lstrcmpi(szArgVBuf, "-noCleanupOnUpgrade") || !lstrcmpi(szArgVBuf, "/noCleanupOnUpgrade")) + sgProduct.checkCleanupOnUpgrade = FALSE; #ifdef XXX_DEBUG itoa(i, szBuf, 10); @@ -6368,9 +6536,14 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine) /* find out if we are doing a shared install */ GetPrivateProfileString("General", "Shared Install", "", szBuf, sizeof(szBuf), szFileIniConfig); if(lstrcmpi(szBuf, "TRUE") == 0) - { sgProduct.bSharedInst = TRUE; - } + + /* find out if we need to cleanup previous installation on upgrade + * (installing ontop of - not related to cleaning up olde GRE's + * installed elsewhere) */ + GetPrivateProfileString("General", "Cleanup On Upgrade", "", szBuf, sizeof(szBuf), szFileIniConfig); + if(lstrcmpi(szBuf, "TRUE") == 0) + sgProduct.checkCleanupOnUpgrade = TRUE; /* this is a default value so don't change it if it has already been set */ if(*sgProduct.szAppID == '\0') @@ -6973,6 +7146,7 @@ HRESULT ParseInstallIni() GetPrivateProfileString("General", "CANCEL", "", sgInstallGui.szCancel, sizeof(sgInstallGui.szCancel), szFileIniInstall); GetPrivateProfileString("General", "NEXT_", "", sgInstallGui.szNext_, sizeof(sgInstallGui.szNext_), szFileIniInstall); GetPrivateProfileString("General", "BACK_", "", sgInstallGui.szBack_, sizeof(sgInstallGui.szBack_), szFileIniInstall); + GetPrivateProfileString("General", "IGNORE_", "", sgInstallGui.szIgnore_, sizeof(sgInstallGui.szIgnore_), szFileIniInstall); GetPrivateProfileString("General", "PROXYSETTINGS_", "", sgInstallGui.szProxySettings_, sizeof(sgInstallGui.szProxySettings_), szFileIniInstall); GetPrivateProfileString("General", "PROXYSETTINGS", "", sgInstallGui.szProxySettings, sizeof(sgInstallGui.szProxySettings), szFileIniInstall); GetPrivateProfileString("General", "SERVER", "", sgInstallGui.szServer, sizeof(sgInstallGui.szServer), szFileIniInstall); @@ -7004,6 +7178,8 @@ HRESULT ParseInstallIni() GetPrivateProfileString("General", "CURRENTSETTINGS", "", sgInstallGui.szCurrentSettings, sizeof(sgInstallGui.szCurrentSettings), szFileIniInstall); GetPrivateProfileString("General", "INSTALL_", "", sgInstallGui.szInstall_, sizeof(sgInstallGui.szInstall_), szFileIniInstall); GetPrivateProfileString("General", "DELETE_", "", sgInstallGui.szDelete_, sizeof(sgInstallGui.szDelete_), szFileIniInstall); + GetPrivateProfileString("General", "CONTINUE_", "", sgInstallGui.szContinue_, sizeof(sgInstallGui.szContinue_), szFileIniInstall); + GetPrivateProfileString("General", "SKIP_", "", sgInstallGui.szSkip_, sizeof(sgInstallGui.szSkip_), szFileIniInstall); GetPrivateProfileString("General", "EXTRACTING", "", sgInstallGui.szExtracting, sizeof(sgInstallGui.szExtracting), szFileIniInstall); GetPrivateProfileString("General", "README", "", sgInstallGui.szReadme_, sizeof(sgInstallGui.szReadme_), szFileIniInstall); GetPrivateProfileString("General", "PAUSE_", "", sgInstallGui.szPause_, sizeof(sgInstallGui.szPause_), szFileIniInstall); diff --git a/xpinstall/wizard/windows/setup/extra.h b/xpinstall/wizard/windows/setup/extra.h index c3496b675b3..4ab548542fa 100644 --- a/xpinstall/wizard/windows/setup/extra.h +++ b/xpinstall/wizard/windows/setup/extra.h @@ -199,6 +199,7 @@ int CRCCheckArchivesStartup(char *szCorruptedArchiveList, BOOL ResolveForceUpgrade(siC *siCObject); void RestoreInvisibleFlag(siC *siCNode); void RestoreAdditionalFlag(siC *siCNode); +void RestoreEnabledFlag(siC *siCNode); void SwapFTPAndHTTP(char *szInUrl, DWORD dwInUrlSize); void ClearWinRegUninstallFileDeletion(void); int AppendToGlobalMessageStream(char *szInfo); @@ -226,6 +227,8 @@ void GetXpinstallPath(char *aPath, int aPathBufSize); BOOL GreInstallerNeedsReboot(void); void ReplacePrivateProfileStrCR(LPSTR aInputOutputStr); void UpdateGREAppInstallerProgress(int percent); +BOOL IsPathWithinWindir(); +void CleanupOnUpgrade(); #endif /* _EXTRA_H_ */ diff --git a/xpinstall/wizard/windows/setup/setup.h b/xpinstall/wizard/windows/setup/setup.h index 51feeb8be07..9fbedb4d40e 100644 --- a/xpinstall/wizard/windows/setup/setup.h +++ b/xpinstall/wizard/windows/setup/setup.h @@ -306,6 +306,7 @@ typedef int PRInt32; #define SETUP_STATE_DOWNLOAD "downloading" #define SETUP_STATE_UNPACK_XPCOM "unpacking xpcom" #define SETUP_STATE_INSTALL_XPI "installing xpi" +#define SETUP_STATE_REMOVING_PREV_INST "removing previous installation" typedef struct dlgSetup @@ -471,6 +472,8 @@ typedef struct setupStruct BOOL bLockPath; BOOL bSharedInst; BOOL bInstallFiles; + BOOL checkCleanupOnUpgrade; + BOOL doCleanupOnUpgrade; LPSTR szAppID; LPSTR szAppPath; LPSTR szRegPath; @@ -562,6 +565,7 @@ typedef struct dlgInstall char szCancel[MAX_BUF]; char szNext_[MAX_BUF]; char szBack_[MAX_BUF]; + char szIgnore_[MAX_BUF]; char szProxySettings_[MAX_BUF]; char szProxySettings[MAX_BUF]; char szServer[MAX_BUF]; @@ -593,6 +597,8 @@ typedef struct dlgInstall char szCurrentSettings[MAX_BUF]; char szInstall_[MAX_BUF]; char szDelete_[MAX_BUF]; + char szContinue_[MAX_BUF]; + char szSkip_[MAX_BUF]; char szExtracting[MAX_BUF]; char szReadme_[MAX_BUF]; char szPause_[MAX_BUF]; diff --git a/xpinstall/wizard/windows/setuprsc/setuprsc.h b/xpinstall/wizard/windows/setuprsc/setuprsc.h index bc0465e8710..e69de29bb2d 100644 --- a/xpinstall/wizard/windows/setuprsc/setuprsc.h +++ b/xpinstall/wizard/windows/setuprsc/setuprsc.h @@ -1,147 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by setuprsc.rc -// - -#ifndef WINVER -#define WINVER 0x0400 -#endif -#include "winresrc.h" - -#define IDS_ERROR_FILE_NOT_FOUND 3 -#define IDRESUME 3 -#define IDPAUSE 4 -#define IDS_MSG_RETRIEVE_INSTALLINI 11 -#define IDI_ICON1 105 -#define IDI_SETUP 105 -#define IDB_BITMAP_WELCOME 108 -#define DLG_MESSAGE 110 -#define IDB_BITMAP_BANNER 114 -#define IDB_QUICK_LAUNCH 115 -#define DLG_BROWSE_DIR 503 -#define IDC_STATUS 1001 -#define IDC_STATUS1 1001 -#define ID_DELETE 1001 -#define IDC_STATUS_URL 1001 -#define IDC_GAUGE 1002 -#define IDC_GAUGE_FILE 1002 -#define ID_IGNORE 1002 -#define IDC_STATUS2 1003 -#define IDC_STATUS_URL2 1003 -#define IDC_STATUS_TO 1003 -#define IDC_STATUS0 1004 -#define IDC_STATUS3 1005 -#define ID_YES_TO_ALL 1005 -#define IDC_STATUS_URL3 1005 -#define IDC_GAUGE_ARCHIVE 1006 -#define IDC_EDIT_DESTINATION 1009 -#define IDC_BUTTON_BROWSE 1010 -#define IDC_EDIT_COMPONENT1 1013 -#define IDC_EDIT_SUBCOMPONENT 1014 -#define IDC_STATIC_SUBCOMPONENT 1016 -#define IDC_CHECK1 1017 -#define IDC_STATIC_DESCRIPTION 1018 -#define IDC_EDIT_PROGRAM_FOLDER 1019 -#define IDC_CHECK2 1023 -#define IDC_LIST2 1023 -#define IDC_LIST 1023 -#define IDC_CHECK3 1024 -#define IDC_EDIT_LICENSE 1024 -#define IDC_CHECK0 1025 -#define IDC_CURRENT_SETTINGS 1026 -#define IDC_LIST_COMPONENTS 1027 -#define IDC_LIST_SUBCOMPONENTS 1029 -#define IDC_STATIC_DRIVE_SPACE_REQUIRED 1030 -#define IDC_SPACE_AVAILABLE 1030 -#define IDC_STATIC_DRIVE_SPACE_AVAILABLE 1031 -#define IDC_STATIC_DESTINATION 1032 -#define IDC_STATIC0 1033 -#define IDC_STATIC1 1034 -#define IDC_STATIC2 1035 -#define IDC_STATIC3 1036 -#define IDC_STATIC4 1037 -#define IDC_PERCENTAGE 1038 -#define IDC_MESSAGE1 1040 -#define IDC_PICT0 1041 -#define IDC_MESSAGE0 1042 -#define IDC_STATIC_ST0_DESCRIPTION 1042 -#define IDC_STATIC_ST1_DESCRIPTION 1043 -#define IDC_MESSAGE2 1043 -#define IDC_STATIC_ST2_DESCRIPTION 1044 -#define IDC_STATIC_ST3_DESCRIPTION 1045 -#define IDC_STATIC_MSG0 1046 -#define IDC_MESSAGE 1049 -#define IDC_LIST1 1053 -#define IDC_BUTTON1 1055 -#define IDC_README 1055 -#define IDC_BUTTON_SITE_SELECTOR 1055 -#define IDC_DOWNLOAD_SIZE 1058 -#define IDC_SITE_SELECTOR 1059 -#define IDC_LIST_SITE_SELECTOR 1059 -#define IDC_CHECK_SAVE_INSTALLER 1061 -#define IDC_CHECK_SAVE_INSTALLER_FILES 1061 -#define IDC_EDIT_PROXY_SERVER 1062 -#define IDC_EDIT_PROXY_PORT 1063 -#define IDC_TAB1 1064 -#define IDC_EDIT_PROXY_USER 1064 -#define IDC_DELETE_PATH 1065 -#define IDC_EDIT_PROXY_PASSWD 1065 -#define IDC_LOCAL_INSTALLER_PATH 1066 -#define IDC_EDIT_LOCAL_INSTALLER_PATH 1066 -#define IDC_BUTTON_ADDITIONAL_SETTINGS 1067 -#define IDC_BUTTON_PROXY_SETTINGS 1067 -#define IDC_STATUS_FILE 1070 -#define IDC_STATUS_STATUS 1071 -#define IDC_USE_HTTP 1073 -#define IDC_USE_FTP 1074 -#define IDC_DESTINATION 1074 -#define IDC_CHECK_TURBO_MODE 1075 -#define IDC_CHECK_RECAPTURE_HOMEPAGE 1076 -#define DLG_WELCOME 2001 -#define DLG_LICENSE 2002 -#define DLG_SETUP_TYPE 2003 -#define DLG_SELECT_COMPONENTS_SINGLE 2004 -#define DLG_SELECT_COMPONENTS 2004 -#define DLG_SELECT_COMPONENTS_MULTI 2005 -#define DLG_WINDOWS_INTEGRATION 2006 -#define DLG_PROGRAM_FOLDER 2007 -#define DLG_START_INSTALL 2008 -#define DLG_EXTRACTING 2009 -#define DLG_QUICK_LAUNCH 2010 -#define DLG_RESTART 10206 -#define DLG_SITE_SELECTOR 10207 -#define DLG_ADVANCED_SETTINGS 10207 -#define DLG_SELECT_ADDITIONAL_COMPONENTS 10208 -#define DLG_UPGRADE 10209 -#define DLG_ADDITIONAL_OPTIONS 10210 -#define DLG_DOWNLOADING 10211 -#define DLG_START_INSTALL1 10212 -#define IDB_BOX_CHECKED 10304 -#define IDB_BOX_UNCHECKED 10306 -#define IDB_BOX_CHECKED_DISABLED 10307 -#define IDC_RADIO_TYPICAL 11007 -#define IDC_RADIO_ST0 11007 -#define IDC_RADIO_CUSTOM 11008 -#define IDC_RADIO_ST2 11008 -#define IDC_RADIO_COMPACT 11009 -#define IDC_RADIO_ST1 11009 -#define IDC_RADIO_ST3 11010 -#define IDC_RADIO_YES 11011 -#define IDC_RADIO_NO 11012 -#define IDWIZBACK 11013 -#define IDWIZNEXT 11014 -#define IDS_MSG_CREATE_DIRECTORY 11015 -#define IDWIZNEXT2 11015 -#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 116 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1079 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/xpinstall/wizard/windows/setuprsc/setuprsc.rc b/xpinstall/wizard/windows/setuprsc/setuprsc.rc index 76483436f83..1d5333bb21e 100644 --- a/xpinstall/wizard/windows/setuprsc/setuprsc.rc +++ b/xpinstall/wizard/windows/setuprsc/setuprsc.rc @@ -370,13 +370,14 @@ DLG_UPGRADE DIALOG DISCARDABLE 51, 56, 310, 166 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION FONT 8, "MS Sans Serif" BEGIN - DEFPUSHBUTTON "",IDWIZBACK,162,139,53,14 - PUSHBUTTON "",ID_DELETE,95,139,53,14 - LTEXT "",IDC_MESSAGE0,17,13,276,31,NOT WS_GROUP - LTEXT "",IDC_MESSAGE1,17,48,276,21,NOT WS_GROUP - LTEXT "",IDC_MESSAGE2,17,73,276,21,NOT WS_GROUP - GROUPBOX "",IDC_STATIC,16,102,276,25 - LTEXT "",IDC_DELETE_PATH,22,111,264,13,SS_CENTERIMAGE + DEFPUSHBUTTON "",IDCONTINUE,65,147,53,14 + PUSHBUTTON "",IDSKIP,128,147,53,14 + PUSHBUTTON "",IDWIZBACK,191,147,53,14 + LTEXT "",IDC_MESSAGE0,9,9,291,93,NOT WS_GROUP + GROUPBOX "",IDC_STATIC,9,109,291,25 + LTEXT "",IDC_DELETE_PATH,13,118,282,12,SS_CENTERIMAGE + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,9,140,292,1, + WS_EX_STATICEDGE END DLG_ADDITIONAL_OPTIONS DIALOG DISCARDABLE 51, 56, 315, 205 diff --git a/xpinstall/wizard/windows/uninstall/dialogs.c b/xpinstall/wizard/windows/uninstall/dialogs.c index 649e83ee1a5..1f26fc26771 100644 --- a/xpinstall/wizard/windows/uninstall/dialogs.c +++ b/xpinstall/wizard/windows/uninstall/dialogs.c @@ -319,6 +319,7 @@ LRESULT CALLBACK DlgProcUninstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara EnableWindow(GetDlgItem(hDlg, IDWIZNEXT), FALSE); EnableWindow(GetDlgItem(hDlg, IDCANCEL), FALSE); ParseAllUninstallLogs(); + VerifyAndDeleteInstallationFolder(); DestroyWindow(hDlg); PostQuitMessage(0); break; diff --git a/xpinstall/wizard/windows/uninstall/extra.c b/xpinstall/wizard/windows/uninstall/extra.c index a8b189b2b3d..81d78fcdac9 100644 --- a/xpinstall/wizard/windows/uninstall/extra.c +++ b/xpinstall/wizard/windows/uninstall/extra.c @@ -1576,11 +1576,10 @@ HRESULT GetAppPath() hkRoot = HKEY_CURRENT_USER; GetWinReg(hkRoot, szKey, "PathToExe", szTmpAppPath, sizeof(szTmpAppPath)); - if(FileExists(szTmpAppPath)) - { lstrcpy(ugUninstall.szAppPath, szTmpAppPath); - } + + GetWinReg(hkRoot, szKey, "Install Directory", ugUninstall.szInstallPath, sizeof(ugUninstall.szInstallPath)); return(0); } @@ -1788,6 +1787,133 @@ void RemovePathToExeXX(HKEY hkRootKey, LPSTR szKey, DWORD dwIndex, const DWORD d DeleteWinRegValue(hkRootKey, szKey, szName); } +/* Function: ReplacePrivateProfileStrCR() + * + * in: LPSTR aInputOutputStr: In/out string to containing "\\n" to replace. + * + * purpose: To parse for and replace "\\n" string with "\n". Strings stored + * in .ini files cannot contain "\n" because it's a key delimiter. + * To work around this limination, "\\n" chars can be used to + * represent '\n'. This function will look for "\\n" and replace + * them with a true "\n". + * If it encounters a string of "\\\\n" (which looks like '\\n'), + * then this function will strip out the extra '\\' and just show + * "\\n"; + */ +void ReplacePrivateProfileStrCR(LPSTR aInputOutputStr) +{ + LPSTR pSearch = aInputOutputStr; + LPSTR pSearchEnd = aInputOutputStr + lstrlen(aInputOutputStr); + LPSTR pPreviousSearch = NULL; + + while (pSearch < pSearchEnd) + { + if (('\\' == *pSearch) || ('n' == *pSearch)) + { + // found a '\\' or 'n'. check to see if the prefivous char is also a '\\'. + if (pPreviousSearch && ('\\' == *pPreviousSearch)) + { + if ('n' == *pSearch) + *pSearch = '\n'; + + memmove(pPreviousSearch, pSearch, pSearchEnd-pSearch+1); + + // our string is shorter now ... + pSearchEnd -= pSearch - pPreviousSearch; + } + } + + pPreviousSearch = pSearch; + pSearch = CharNext(pSearch); + } +} + +/* Function: IsPathWithinWindir() + * in: char *aTargetPath + * out: returns a BOOL type indicating whether the install path chosen + * by the user is within the %windir% or not. + * purpose: To see if aTargetPath is within the %windir% path. + */ +BOOL IsPathWithinWindir(char *aTargetPath) +{ + char windir[MAX_PATH]; + char targetPath[MAX_PATH]; + HRESULT rv; + + assert(aTargetPath); + + rv = GetWindowsDirectory(windir, sizeof(windir)); + assert(rv); + MozCopyStr(aTargetPath, targetPath, sizeof(targetPath)); + RemoveBackSlash(targetPath); + CharUpperBuff(targetPath, sizeof(targetPath)); + RemoveBackSlash(windir); + CharUpperBuff(windir, sizeof(windir)); + + if(strstr(targetPath, windir)) + return(TRUE); + + return(FALSE); +} + +/* Function: VerifyAndDeleteInstallationFolder() + * in: none + * out: none + * purpose: To verify that the installation folder has been completely + * deleted, else prompt the user if they would like to delete + * the folder and it's left over contents. + * It will also check to make sure that the installation + * folder is not within the %windir% folder. If it is, + * it will warn the user and not perform the deletion of the + * installation folder. + */ +void VerifyAndDeleteInstallationFolder() +{ + if(FileExists(ugUninstall.szInstallPath)) + { + char buf[MAX_BUF]; + char msg[MAX_BUF]; + char msgBoxTitle[MAX_BUF]; + char installationPath[MAX_BUF]; + + MozCopyStr(ugUninstall.szInstallPath, installationPath, sizeof(installationPath)); + RemoveBackSlash(installationPath); + + if(ugUninstall.mode == NORMAL) + { + GetPrivateProfileString("Messages", "MB_ATTENTION_STR", "", msgBoxTitle, sizeof(msgBoxTitle), szFileIniUninstall); + GetPrivateProfileString("Messages", "MSG_DELETE_INSTALLATION_PATH", "", buf, sizeof(buf), szFileIniUninstall); + _snprintf(msg, sizeof(msg), buf, installationPath); + msg[sizeof(msg) - 1] = '\0'; + ReplacePrivateProfileStrCR(msg); + + /* Prompt user on if they want the completely remove the + * installation folder */ + if(MessageBox(hWndMain, msg, msgBoxTitle, MB_ICONQUESTION | MB_YESNO) == IDYES) + { + if(IsPathWithinWindir(installationPath)) + { + GetPrivateProfileString("Messages", "MSG_INSTALLATION_PATH_WITHIN_WINDIR", + "", msg, sizeof(msg), szFileIniUninstall); + MessageBox(hWndMain, msg, NULL, MB_ICONEXCLAMATION); + return; + } + + /* Remove the installation folder here */ + AppendBackSlash(installationPath, sizeof(installationPath)); + DirectoryRemove(installationPath, TRUE); + } + } + else + { + /* If uninstall is running in !NORMAL mode, assume user wants to + * completely delete the installation folder */ + AppendBackSlash(installationPath, sizeof(installationPath)); + DirectoryRemove(installationPath, TRUE); + } + } +} + HRESULT GetUninstallLogPath() { char szBuf[MAX_BUF]; diff --git a/xpinstall/wizard/windows/uninstall/extra.h b/xpinstall/wizard/windows/uninstall/extra.h index cd742e7d440..953581a9ae1 100644 --- a/xpinstall/wizard/windows/uninstall/extra.h +++ b/xpinstall/wizard/windows/uninstall/extra.h @@ -98,5 +98,9 @@ void RemovePathToExeXX(HKEY hkRootKey, LPSTR szKey, DWORD dwIndex, HRESULT GetUninstallLogPath(); BOOL WinRegNameExists(HKEY hkRootKey, LPSTR szKey, LPSTR szName); void DeleteWinRegValue(HKEY hkRootKey, LPSTR szKey, LPSTR szName); -#endif +void ReplacePrivateProfileStrCR(LPSTR aInputOutputStr); +BOOL IsPathWithinWindir(char *aTargetPath); +void VerifyAndDeleteInstallationFolder(void); + +#endif /* _EXTRA_H_ */ diff --git a/xpinstall/wizard/windows/uninstall/uninstall.h b/xpinstall/wizard/windows/uninstall/uninstall.h index f9e672acc7d..5cecddce638 100644 --- a/xpinstall/wizard/windows/uninstall/uninstall.h +++ b/xpinstall/wizard/windows/uninstall/uninstall.h @@ -163,6 +163,7 @@ typedef struct uninstallStruct BOOL bUninstallFiles; BOOL bSharedInst; HFONT definedFont; + char szInstallPath[MAX_BUF]; } uninstallGen; typedef struct sInfoLine sil;