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: Use registry instead of prefs for storing the Simple Adblock mark Created Aug. 7, 2015, 10:34 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"
AllowDowngrades="yes"
/>
+
+ <!--Remove Simple Adblock-->
+ <Property Id="SIMPLEADBLOCKPRODUCTCODE" Secure="yes"/>
+ <Upgrade Id="27D7C170-67AA-40D9-978F-5F14B4D0FEEE">
+ <UpgradeVersion
+ Minimum="0.7.0.0" Maximum="99.0.0.0"
+ Property="SIMPLEADBLOCKPRODUCTCODE"
+ IncludeMinimum="yes" IncludeMaximum="no" IgnoreRemoveFailure="no"/>
+ </Upgrade>
<MediaTemplate EmbedCab="yes"/>
<!--
@@ -173,11 +186,20 @@
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"/>
+ <Binary Id="installer_ca" SourceFile="$(var.installer_dir)\build\$(var.build_dir)\$(var.CA_Configuration)\installer-ca.dll"/>
<InstallUISequence>
<!--
The LaunchConditions action occurs near the beginning, before any of the expensive operations.
@@ -187,6 +209,12 @@
After="LaunchConditions"
/>
</InstallUISequence>
+
+ <InstallExecuteSequence>
+ <Custom
+ Action="CleanupSimpleAdblock"
+ Before="InstallFinalize"><![CDATA[SIMPLEADBLOCKPRODUCTCODE <> ""]]></Custom>
+ </InstallExecuteSequence>
<!--
We have only a single feature, since there aren't any optional parts.
@@ -817,12 +845,21 @@
-->
<ComponentGroup Id="INI_Files">
<ComponentRef Id="ini_settings.ini"/>
+ <ComponentRef Id="simpleAdblockMark"/>
</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="simpleAdblockMark" Guid="cc30c3b0-c713-01e2-7b8b-1800200c9a65">
+ <Condition><![CDATA[SIMPLEADBLOCKPRODUCTCODE <> ""]]></Condition>
+ <RegistryKey Root="HKCU" Key="Software\Adblock Plus for IE">
+ <RegistryKey Key="ConvertedFrom">
+ <RegistryValue Name="name" Type="string" Value="simpleadblock"/>
+ </RegistryKey>
+ </RegistryKey>
+ </Component>
</Directory>
</DirectoryRef>

Powered by Google App Engine
This is Rietveld