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

Unified Diff: installer/src/msi/adblockplusie.wxs

Issue 5024350814076928: Issue 1103 - Migrate Simple Adblock users
Patch Set: Added comments in code Created April 24, 2015, 11:46 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: installer/src/msi/adblockplusie.wxs
===================================================================
--- a/installer/src/msi/adblockplusie.wxs
+++ b/installer/src/msi/adblockplusie.wxs
@@ -128,15 +128,28 @@
implied and allows major upgrades to be performed. Downgrades aren't
allowed by default.
- The @Schedule attribute looks a little opaque.
- Suffice it to say that it's the only option for scheduling where uninstallation of the previous version
- and installation of the present version is _always_ going to act atomically.
- It's a shame that you to even explicitly make that choice.
+ The default value for @Schedule attribute is afterInstallValidate.
+ If we used that it would be possible to endup in a state when one
+ version is uninstalled and another is not installed. We use
+ afterInstallInitialize here and not afterInstallExecute since we need to
+ make sure we uninstall SimpleAdblock *before* we install ABP.
+ SimpleAdblock and ABP for IE are using the same CLSID and SimpleAdblock's
+ uninstallation is running DllUnregisterServer which removes the CLSID
+ from the registry.
-->
<MajorUpgrade
- Schedule="afterInstallExecute"
+ Schedule="afterInstallInitialize"
Eric 2015/05/17 00:29:25 This change remains a bad idea. It's altering the
Oleksandr 2015/07/13 03:46:16 1. MajorUpgrade already schedules RemoveExistingPr
AllowDowngrades="yes"
/>
+
+ <!--Remove Simple Adblock-->
+ <Property Id="SIMPLEADBLOCKDETECTED" Secure="yes"/>
Eric 2015/05/17 00:29:25 The value of this property is set by the 'FindRela
+ <Upgrade Id="27D7C170-67AA-40D9-978F-5F14B4D0FEEE">
+ <UpgradeVersion
+ Minimum="0.7.0.0" Maximum="99.0.0.0"
+ Property="SIMPLEADBLOCKDETECTED"
+ IncludeMinimum="yes" IncludeMaximum="no" IgnoreRemoveFailure="no"/>
+ </Upgrade>
<MediaTemplate EmbedCab="yes"/>
<!--
@@ -173,12 +186,21 @@
DllEntry="AbpCloseIe"
Return="check"
/>
+
+ <CustomAction
+ Id="CleanupSimpleAdblock"
+ Directory="APP_DATA_FOLDER"
+ ExeCommand="cmd /C &quot;rmdir /s /q &quot;.\Simple Adblock&quot;&quot;"
+ Execute="deferred"
+ Return="ignore"
+ HideTarget="no"
+ Impersonate="no" />
<!--
We require a 32-bit DLL for the 32-bit installer, and likewise for 64-bit.
The 64-bit Close_IE action needs to examine 64-bit processes on the system, which are invisible to 32-bit processes.
-->
<Binary Id="installer_ca" SourceFile="$(var.installer_dir)\build\$(var.build_dir)\$(var.CA_Configuration)\installer-ca.dll"/>
- <InstallUISequence>
+ <InstallExecuteSequence>
Eric 2015/05/17 00:29:25 Moving the close-IE action should be done in a sep
sergei 2015/07/28 11:11:54 Actually yes, had someone created an issue for it?
<!--
The LaunchConditions action occurs near the beginning, before any of the expensive operations.
-->
@@ -186,7 +208,11 @@
Action="Close_IE"
After="LaunchConditions"
/>
- </InstallUISequence>
+
+ <Custom
+ Action="CleanupSimpleAdblock"
+ Before="InstallFinalize"><![CDATA[SIMPLEADBLOCKDETECTED <> ""]]></Custom>
+ </InstallExecuteSequence>
<!--
We have only a single feature, since there aren't any optional parts.
@@ -817,12 +843,17 @@
-->
<ComponentGroup Id="INI_Files">
<ComponentRef Id="ini_settings.ini"/>
+ <ComponentRef Id="simpleAdblockPrefs"/>
</ComponentGroup>
<DirectoryRef Id="ABP_APPDATA_FOLDER">
<Directory Id="ini" FileSource="$(var.plugin_dir)\files">
<Component Id="ini_settings.ini" Guid="dc30c3b0-d713-11e2-8b8b-0800200c9a66">
<File Name="settings.ini"/>
</Component>
+ <Component Id="simpleAdblockPrefs" Guid="cc30c3b0-c713-01e2-7b8b-1800200c9a65">
+ <Condition><![CDATA[SIMPLEADBLOCKDETECTED <> ""]]></Condition>
+ <File Name="prefs.json"/>
+ </Component>
</Directory>
</DirectoryRef>

Powered by Google App Engine
This is Rietveld