Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 5024350814076928: Issue 1103 - Migrate Simple Adblock users

Created:
March 24, 2015, 7:44 a.m. by Oleksandr
Modified:
Aug. 10, 2015, 5:08 p.m.
Reviewers:
sergei, Eric
CC:
Felix Dahlke
Visibility:
Public.

Description

1. This should probably be committed into a branch. 2. This adds the mechanics for the upgrade from Simple Adblock to Adblock Plus. The actual FRP changes will come later. Currently only the title is different. 3. The idea is to detect if Simple Adblock is installed in the installer. If is is then: a) remove it b) remove leftover files from "%APPDATA%\LocalLow\Simple Adblock" c) deliver the prefs.json with {currentVersion: "simpleadblock"}. d) On first start, in the plugin, detect if there was an upgrade from Simple Adblock based on currentVersion.

Patch Set 1 #

Total comments: 13

Patch Set 2 : Make it less Simple Adblock specific, and add the FRP changes #

Total comments: 8

Patch Set 3 : Added comments in code #

Total comments: 12

Patch Set 4 : Rebase and cleanup #

Total comments: 2

Patch Set 5 : Rebased #

Patch Set 6 : Use registry instead of prefs for storing the Simple Adblock mark #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -14 lines) Patch
M html/static/css/firstRun.css View 1 4 1 chunk +6 lines, -0 lines 0 comments Download
M html/static/js/firstRun.js View 1 2 3 4 2 chunks +8 lines, -2 lines 0 comments Download
M html/static/js/ieFirstRun.js View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M html/templates/firstRun.html View 1 4 1 chunk +6 lines, -0 lines 0 comments Download
M installer/src/custom-action/close_application.cpp View 1 4 1 chunk +2 lines, -2 lines 0 comments Download
M installer/src/msi/adblockplusie.wxs View 1 2 3 4 5 4 chunks +43 lines, -6 lines 0 comments Download
M locales/en.ini View 1 4 1 chunk +3 lines, -0 lines 0 comments Download
M src/engine/Main.cpp View 1 2 3 4 5 2 chunks +22 lines, -0 lines 1 comment Download
M src/plugin/AdblockPlusClient.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/plugin/AdblockPlusClient.cpp View 1 2 3 4 5 2 chunks +14 lines, -0 lines 0 comments Download
M src/plugin/PluginClass.cpp View 1 2 3 4 5 2 chunks +7 lines, -3 lines 0 comments Download
M src/plugin/PluginUserSettings.cpp View 1 2 3 4 5 3 chunks +15 lines, -0 lines 0 comments Download
M src/shared/Communication.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 17
Oleksandr
March 24, 2015, 8:08 a.m. (2015-03-24 08:08:37 UTC) #1
Eric
Overall, I'm uncomfortable with sprinkling a lot of calls entirely specific to Simple Adblock all ...
March 27, 2015, 12:51 p.m. (2015-03-27 12:51:45 UTC) #2
Oleksandr
After these changes I now think that it would be best to just release one ...
April 16, 2015, 9:58 a.m. (2015-04-16 09:58:09 UTC) #3
sergei
http://codereview.adblockplus.org/5024350814076928/diff/5629499534213120/installer/src/msi/adblockplusie.wxs File installer/src/msi/adblockplusie.wxs (right): http://codereview.adblockplus.org/5024350814076928/diff/5629499534213120/installer/src/msi/adblockplusie.wxs#newcode137 installer/src/msi/adblockplusie.wxs:137: Schedule="afterInstallInitialize" On 2015/04/16 09:58:09, Oleksandr wrote: > On 2015/03/27 ...
April 22, 2015, 10:37 a.m. (2015-04-22 10:37:08 UTC) #4
sergei
BTW, are you sure that it works, last time I tried to supply custom prefs.json ...
April 22, 2015, 2:11 p.m. (2015-04-22 14:11:43 UTC) #5
Oleksandr
On 2015/04/22 14:11:43, sergei wrote: > BTW, are you sure that it works, last time ...
April 24, 2015, 11:50 a.m. (2015-04-24 11:50:04 UTC) #6
Oleksandr
http://codereview.adblockplus.org/5024350814076928/diff/5629499534213120/installer/src/msi/adblockplusie.wxs File installer/src/msi/adblockplusie.wxs (right): http://codereview.adblockplus.org/5024350814076928/diff/5629499534213120/installer/src/msi/adblockplusie.wxs#newcode137 installer/src/msi/adblockplusie.wxs:137: Schedule="afterInstallInitialize" On 2015/04/22 10:37:08, sergei wrote: > On 2015/04/16 ...
April 24, 2015, 11:50 a.m. (2015-04-24 11:50:31 UTC) #7
sergei
On 2015/04/24 11:50:04, Oleksandr wrote: > call to getPref is sure to be executed after ...
April 28, 2015, 2:30 p.m. (2015-04-28 14:30:29 UTC) #8
sergei
http://codereview.adblockplus.org/5024350814076928/diff/5653164804014080/installer/src/custom-action/close_application.cpp File installer/src/custom-action/close_application.cpp (right): http://codereview.adblockplus.org/5024350814076928/diff/5653164804014080/installer/src/custom-action/close_application.cpp#newcode214 installer/src/custom-action/close_application.cpp:214: else if (uilevel == L"2") On 2015/04/24 11:50:32, Oleksandr ...
April 28, 2015, 2:41 p.m. (2015-04-28 14:41:14 UTC) #9
Eric
http://codereview.adblockplus.org/5024350814076928/diff/5631943370604544/html/static/js/firstRun.js File html/static/js/firstRun.js (right): http://codereview.adblockplus.org/5024350814076928/diff/5631943370604544/html/static/js/firstRun.js#newcode131 html/static/js/firstRun.js:131: if (AdblockPlus.isUpgradeFrom("simpleadblock")) { Where is 'isUpgradeFrom' defined? Is it ...
May 17, 2015, 12:29 a.m. (2015-05-17 00:29:24 UTC) #10
Oleksandr
https://codereview.adblockplus.org/5024350814076928/diff/5631943370604544/installer/src/msi/adblockplusie.wxs File installer/src/msi/adblockplusie.wxs (right): https://codereview.adblockplus.org/5024350814076928/diff/5631943370604544/installer/src/msi/adblockplusie.wxs#newcode141 installer/src/msi/adblockplusie.wxs:141: Schedule="afterInstallInitialize" On 2015/05/17 00:29:25, Eric wrote: > This change ...
July 13, 2015, 3:46 a.m. (2015-07-13 03:46:16 UTC) #11
Eric
LGTM. Small caveat. As the review notes point out, there's no first run page specifically ...
July 27, 2015, 2:44 a.m. (2015-07-27 02:44:55 UTC) #12
sergei
https://codereview.adblockplus.org/5024350814076928/diff/29322045/html/static/js/ieFirstRun.js File html/static/js/ieFirstRun.js (left): https://codereview.adblockplus.org/5024350814076928/diff/29322045/html/static/js/ieFirstRun.js#oldcode43 html/static/js/ieFirstRun.js:43: result.getConverssion = function() It does not seem to be ...
July 28, 2015, 8:56 a.m. (2015-07-28 08:56:41 UTC) #13
Oleksandr
Rebased. https://codereview.adblockplus.org/5024350814076928/diff/29322045/html/static/js/ieFirstRun.js File html/static/js/ieFirstRun.js (left): https://codereview.adblockplus.org/5024350814076928/diff/29322045/html/static/js/ieFirstRun.js#oldcode43 html/static/js/ieFirstRun.js:43: result.getConverssion = function() On 2015/07/28 08:56:40, sergei wrote: ...
July 28, 2015, 9:56 a.m. (2015-07-28 09:56:39 UTC) #14
sergei
LGTM https://codereview.adblockplus.org/5024350814076928/diff/5653164804014080/installer/src/custom-action/close_application.cpp File installer/src/custom-action/close_application.cpp (right): https://codereview.adblockplus.org/5024350814076928/diff/5653164804014080/installer/src/custom-action/close_application.cpp#newcode214 installer/src/custom-action/close_application.cpp:214: else if (uilevel == L"2") On 2015/04/28 14:41:15, ...
July 28, 2015, 11:11 a.m. (2015-07-28 11:11:55 UTC) #15
Oleksandr
Since https://codereview.adblockplus.org/6505394822184960/ will give us an engine that is always in Medium Integrity, and storing ...
Aug. 7, 2015, 10:41 a.m. (2015-08-07 10:41:01 UTC) #16
Eric
Aug. 10, 2015, 5:08 p.m. (2015-08-10 17:08:50 UTC) #17
https://codereview.adblockplus.org/5024350814076928/diff/29323392/src/engine/...
File src/engine/Main.cpp (right):

https://codereview.adblockplus.org/5024350814076928/diff/29323392/src/engine/...
src/engine/Main.cpp:388: LONG res = RegDeleteKey(HKEY_CURRENT_USER,
updatedFromKeyPath.c_str());
Deleting the key immediately after returning its status means that the
combination of 
  (1) display conversion page and 
  (2) delete the flag that mandates the display
is not an atomic action. In other words if there's an error displaying the page,
or a _de facto_ failure for the user to see it, such as immediate shutdown, then
we don't get another chance to show the page again.

If I understand the comment that introduced this patch set, this change is
possible because a medium integrity engine can delete the registry key whereas a
low integrity one cannot. (This point should be commented in the code, also.)
Assuming that's right, all we need in the engine is to be able to delete the
key. We can still read it in the plugin, where we'd also have access to any
display error.

If we didn't need medium integrity to delete such a key, we wouldn't need this
piece in the engine at all. It could all go in the plugin. This is a design
point worth documenting in the code. I wouldn't consider it obvious, since these
permission are ambient (not directly visible in the code) and their behavior
with respect to the registry is something most don't concern themselves with.

I do understand that there's JavaScript code involved as well, so it's not quite
as simple as I'm making it out, but it's still a design problem to bind query
and delete together as it is here.

Powered by Google App Engine
This is Rietveld