Bug 1592968 Followup 2 - Only clean installer pref registry values that are pref names. r=agashlin

The previous patch writes the registry value correctly, but the Firefox
InstallerPrefs module deletes it during startup because it's in the
same key where the actual pref values go and the module unconditionally
deletes every value there. So making it only delete values that are
recognizably actual prefs should fix this.

Differential Revision: https://phabricator.services.mozilla.com/D53693

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Molly Howell 2019-11-20 23:47:55 +00:00
parent 60fcabc3d4
commit 0aadc17b15

View File

@ -100,7 +100,10 @@ InstallerPrefs.prototype = {
_cleanRegistryKey(regKey) {
for (let i = regKey.valueCount - 1; i >= 0; --i) {
regKey.removeValue(regKey.getValueName(i));
const name = regKey.getValueName(i);
if (name.startsWith(INSTALLER_PREFS_BRANCH)) {
regKey.removeValue(name);
}
}
},