mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug #267726 -->
old version of thunderbird remains in the Add New Programs control panel
This commit is contained in:
parent
3b9813f31a
commit
9e4d8fa027
@ -155,9 +155,9 @@ function createShortcuts()
|
||||
|
||||
/* explicitly create the fFolderPath even though the windowsShortcut function creates the folder.
|
||||
* This is so that the folder creation gets logged for uninstall to remove it. */
|
||||
if(!File.exists(fFolderPath))
|
||||
if(winreg.getValueNumber(subkey, "Create Start Menu Shortcut") != 0 && !File.exists(fFolderPath))
|
||||
File.dirCreate(fFolderPath);
|
||||
if(!File.exists(fDefShortcuts))
|
||||
if(winreg.getValueNumber(subkey, "Create Start Menu Shortcut") != 0 && !File.exists(fDefShortcuts))
|
||||
File.dirCreate(fDefShortcuts);
|
||||
|
||||
/* create the shortcuts */
|
||||
@ -181,6 +181,11 @@ function createShortcuts()
|
||||
if (winreg.getValueNumber(subkey, "Create Quick Launch Shortcut") != 0 && folderQuickLaunchExists)
|
||||
File.windowsShortcut(fileExe, fFolderQuickLaunch, scExeDesc, fProgram, "", fileExe, 0);
|
||||
|
||||
// Clean up after ourselves
|
||||
winreg.deleteValue(subkey, "Create Desktop Shortcut");
|
||||
winreg.deleteValue(subkey, "Create Quick Launch Shortcut");
|
||||
winreg.deleteValue(subkey, "Create Start Menu Shortcut");
|
||||
|
||||
if(!restrictedAccess)
|
||||
{
|
||||
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
|
||||
@ -425,14 +430,7 @@ function IsWinnt()
|
||||
subkey = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
|
||||
szCurrentVersion = winreg.getValueString(subkey, "CurrentVersion");
|
||||
logComment("szCurrentVersion: " + szCurrentVersion);
|
||||
if((szCurrentVersion == "") || (szCurrentVersion == null))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return szCurrentVersion != "";
|
||||
}
|
||||
|
||||
function registerMainKeys(winreg)
|
||||
@ -680,6 +678,52 @@ function upgradeCleanup()
|
||||
deleteThisFile("Program", "defaults/pref/winpref.js");
|
||||
deleteThisFile("Program", "defaults/pref/xpinstall.js");
|
||||
deleteThisFile("Program", "defaults/pref/thunderbird.js");
|
||||
|
||||
// Now clean up Uninstall entries that may be laying around in the
|
||||
// registry for older versions of the software that we're overwriting/
|
||||
// upgrading...
|
||||
var wr = getWinRegistry();
|
||||
wr.setRootKey(wr.HKEY_LOCAL_MACHINE);
|
||||
var i = 0;
|
||||
const uninstallKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
|
||||
do {
|
||||
var key = wr.enumKeys(uninstallKey, i++);
|
||||
if (!key)
|
||||
break;
|
||||
key = uninstallKey + "\\" + key;
|
||||
|
||||
// For us to remove the entry from the ARP uninstall list, the install
|
||||
// folder paths must *match* and the display version strings must *NOT
|
||||
// MATCH* - i.e. we don't want to remove the entry we just created for
|
||||
// this version.
|
||||
var itemInstallFolder = wr.getValueString(key, "InstallLocation");
|
||||
var thisInstallFolder = wr.getValueString("SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$\\Main",
|
||||
"Install Directory");
|
||||
var itemInstallFolderShortName = File.windowsGetShortName(getFolder("file:///", itemInstallFolder));
|
||||
var thisInstallFolderShortName = File.windowsGetShortName(getFolder("file:///", thisInstallFolder));
|
||||
|
||||
var itemDisplayVersion = wr.getValueString(key, "DisplayVersion");
|
||||
var thisDisplayVersion = "$UserAgent$";
|
||||
|
||||
// It is possible that a user might have installed several products into
|
||||
// the same directory that have the same "DisplayVersion" (e.g. "1.0")...
|
||||
// in this case we don't want to trash the Uninstall info for the others
|
||||
// so we have to be sure to make sure Comment matches... we use Comment
|
||||
// instead of DisplayName since DisplayName varies from version to version
|
||||
// as it contains the version number, and this instance of javascript is
|
||||
// crippled so as not to contain any useful string parsing.
|
||||
var itemComment = wr.getValueString(key, "Comment");
|
||||
var thisComment = "$ProductName$";
|
||||
|
||||
if ((itemComment == thisComment || itemComment == "Reclaim Your Inbox.") &&
|
||||
itemInstallFolderShortName == thisInstallFolderShortName &&
|
||||
thisDisplayVersion != itemDisplayVersion &&
|
||||
wr.isKeyWritable(key)) {
|
||||
wr.deleteKey(key);
|
||||
logComment("Removing obsolete uninstall key with upgrade: " + key);
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
}
|
||||
|
||||
// main
|
||||
|
Loading…
Reference in New Issue
Block a user