Index: installer/adblockplusie.wxs |
=================================================================== |
--- a/installer/adblockplusie.wxs |
+++ b/installer/adblockplusie.wxs |
@@ -36,10 +36,12 @@ |
<?if $(sys.BUILDARCH)="x86"?> |
<?define Minimum_Version="100"?> |
<?define Program_Files="ProgramFilesFolder"?> |
+ <?define Install_Folder="INSTALLFOLDER32"?> |
<?define Product_Name="!(loc.ProductName32)"?> |
<?elseif $(sys.BUILDARCH)="x64"?> |
<?define Minimum_Version="200"?> |
<?define Program_Files="ProgramFiles64Folder"?> |
+ <?define Install_Folder="INSTALLFOLDER64"?> |
<?define Product_Name="!(loc.ProductName64)"?> |
<?else?> |
<?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?> |
@@ -96,7 +98,11 @@ |
Title="!(loc.Title)" Description="!(loc.UI_Description)" |
Display="hidden"> |
<ComponentGroupRef Id="Installation_Folders"/> |
- <ComponentGroupRef Id="Binaries"/> |
+ <ComponentGroupRef Id="Binaries32"/> |
+ <?if $(sys.BUILDARCH)="x64"?> |
+ <ComponentGroupRef Id="Binaries64"/> |
+ <?endif?> |
+ <ComponentGroupRef Id="BinariesNative"/> |
<ComponentGroupRef Id="HTML_Tree"/> |
<ComponentGroupRef Id="Locale_Files"/> |
<ComponentGroupRef Id="INI_Files"/> |
@@ -156,40 +162,51 @@ |
It should be transparent to the application code, but in case it's not ... |
See http://stackoverflow.com/questions/1882024/wix-will-not-add-hklm-registry-setting-during-windows-7-install |
--> |
- <Property Id="INSTALLFOLDER"> |
- <RegistrySearch Id="Registry_Read_Install_Folder" |
- Root="HKLM" Key="Software\Adblock Plus for IE\$(var.Product_Version)" |
- Name="InstallFolder" Type="raw"/> |
- </Property> |
- <Component Id="Install_Folder.component" Guid="f4e25400-d713-11e2-8b8b-0800200c9a66" Directory="INSTALLFOLDER"> |
+ <Component Id="Install_Folder.component" Guid="f4e25400-d713-11e2-8b8b-0800200c9a66" Directory="$(var.Install_Folder)"> |
<RegistryKey Root="HKLM" Key="Software\Adblock Plus for IE"> |
- <RegistryKey Key="$(var.Product_Version)"> |
- <RegistryValue |
- Name="InstallFolder" Type="string" |
- Value="[INSTALLFOLDER]"/> |
+ <?include location_registry_value.wxi ?> |
+ </RegistryKey> |
+ <?if $(sys.BUILDARCH)="x64"?> |
+ <!-- |
+ Because registry queries from 32-bit processes are redirected, we need to write out a second copy of these entries. |
+ --> |
+ <RegistryKey Root="HKLM" Key="Software\Wow6432Node\Adblock Plus for IE"> |
+ <?include location_registry_value.wxi ?> |
</RegistryKey> |
- </RegistryKey> |
+ <?endif?> |
</Component> |
<!-- |
The top-level directory structure. |
+ |
+ All the INSTALLFOLDER* locationes are within ProgramFilesFolder or ProgramFiles64Folder, which are protected directories. |
+ As a result, this installer requires elevated permissions to operate. |
--> |
<Directory Id="TARGETDIR" Name="SourceDir"> |
- <Directory Id="$(var.Program_Files)"> |
- <!-- |
- INSTALLFOLDER is within ProgramFilesFolder, which is a protected directory. |
- As a result, this installer requires elevated permissions to operate. |
- --> |
- <Directory Id="INSTALLFOLDER" Name="Adblock Plus for IE"> |
- <Directory Id="HTML_Folder" Name="html"></Directory> |
- <Directory Id="Locales_Folder" Name="locales"></Directory> |
+ <!-- |
+ The DLL's go in their respective Program Files directories. |
+ --> |
+ <Directory Id="ProgramFilesFolder"> |
+ <Directory Id="INSTALLFOLDER32" Name="Adblock Plus for IE"/> |
+ </Directory> |
+ <?if $(sys.BUILDARCH)="x64"?> |
+ <Directory Id="ProgramFiles64Folder"> |
+ <Directory Id="INSTALLFOLDER64" Name="Adblock Plus for IE"/> |
</Directory> |
- <Directory Id="APP_DATA_FOLDER"> |
- <Directory Id="ABP_APPDATA_FOLDER" Name="Adblock Plus for IE"></Directory> |
- </Directory> |
+ <?endif?> |
+ <Directory Id="APP_DATA_FOLDER"> |
+ <Directory Id="ABP_APPDATA_FOLDER" Name="Adblock Plus for IE"></Directory> |
</Directory> |
</Directory> |
+ <!-- |
+ Everything else goes in the Program Files directory for the native platform. |
+ We use DirectoryRef here because we'vE already defined the directories above. |
+ --> |
+ <DirectoryRef Id="$(var.Install_Folder)"> |
+ <Directory Id="HTMLFOLDER" Name="html"></Directory> |
+ <Directory Id="LOCALESFOLDER" Name="locales"></Directory> |
+ </DirectoryRef> |
<!-- |
The Binaries component group contains the DLL's. |
@@ -208,7 +225,7 @@ |
That means it writes to HKEY_LOCAL_MACHINE, so that all users on the machine will have the BHO installed. |
It's possible to write keys to HKEY_CURRENT_USER in a situation where that's not desirable, if needed. |
--> |
- <ComponentGroup Id="Binaries" Directory="INSTALLFOLDER"> |
+ <ComponentGroup Id="Binaries32" Directory="INSTALLFOLDER32"> |
<!-- |
The 32-bit version of the DLL is included in both 32- and 64-bit installers. |
We need an explicit value for attribute @Win64 so that the ARCH argument does not override its implicit value. |
@@ -219,29 +236,34 @@ |
</File> |
<?include bho_registry_value.wxi ?> |
</Component> |
- <!-- |
- The 64-bit version of the DLL is only included in the 64-bit installer. |
- We don't really need an explicit value for attribute @Win64, but it's there for resilience. |
- |
- Note that the <Class> element and the <RegistryKey> element are duplicated from the 32-bit version. |
- We use "include" directives to ensure that they are identical. |
- They have to be the same to support both the 32- and 64-bit versions of Internet Explorer on a 64-bit system. |
- IE uses the same algorithm to search for BHO regardless of platform, |
- so with two versions of IE, we need two identical registrations. |
- The 32-bit version on a 64-bit system will be registered under "Wow6432Node" translated keys, |
- while the 64-bit version will be under the keys as they appear in this source, not translated. |
- We don't need to put in the "Wow6432Node" registry key explicitly; |
- something in Windows Installer takes care of the mapping transparently. |
- --> |
- <?if $(sys.BUILDARCH)="x64"?> |
+ </ComponentGroup> |
+ |
+ <?if $(sys.BUILDARCH)="x64"?> |
+ <ComponentGroup Id="Binaries64" Directory="INSTALLFOLDER64"> |
+ <!-- |
+ The 64-bit version of the DLL is only included in the 64-bit installer. |
+ We don't really need an explicit value for attribute @Win64, but it's there for resilience. |
+ |
+ Note that the <Class> element and the <RegistryKey> element are duplicated from the 32-bit version. |
+ We use "include" directives to ensure that they are identical. |
+ They have to be the same to support both the 32- and 64-bit versions of Internet Explorer on a 64-bit system. |
+ IE uses the same algorithm to search for BHO regardless of platform, |
+ so with two versions of IE, we need two identical registrations. |
+ The 32-bit version on a 64-bit system will be registered under "Wow6432Node" translated keys, |
+ while the 64-bit version will be under the keys as they appear in this source, not translated. |
+ We don't need to put in the "Wow6432Node" registry key explicitly; |
+ something in Windows Installer takes care of the mapping transparently. |
+ --> |
<Component Id="AdblockPlus64.dll" Guid="ed77a2c0-d712-11e2-8b8b-0800200c9a66" Win64="yes"> |
<File Id="AdblockPlus64.dll" Name="AdblockPlus64.dll" Source="..\build\x64\$(var.Configuration)\AdblockPlus.dll" KeyPath="yes" Checksum="yes"> |
<?include dll_class.wxi ?> |
</File> |
<?include bho_registry_value.wxi ?> |
</Component> |
- <?endif?> |
+ </ComponentGroup> |
+ <?endif?> |
+ <ComponentGroup Id="BinariesNative" Directory="$(var.Install_Folder)"> |
<!-- |
The engine must go into the same directory as the DLL, since that location is searched explicitly (and uniquely). |
--> |
@@ -255,7 +277,7 @@ |
</Component> |
<?endif?> |
</ComponentGroup> |
- |
+ |
<!-- |
The HTML_Tree component group contains all the files in the HTML folder. |
Individual file entries within a single component group must all be in the same directory. |
@@ -282,7 +304,7 @@ |
<ComponentRef Id="html_templates_index.html"/> |
</ComponentGroup> |
- <DirectoryRef Id="HTML_Folder"> |
+ <DirectoryRef Id="HTMLFOLDER"> |
<Directory Id="html" FileSource="..\html"> |
<Directory Name="static" Id="html_static"> |
<Directory Name="css" Id="html_static_css"> |
@@ -366,7 +388,7 @@ |
<ComponentRef Id="locales_en.ini"/> |
<ComponentRef Id="locales_ru.ini"/> |
</ComponentGroup> |
- <DirectoryRef Id="Locales_Folder"> |
+ <DirectoryRef Id="LOCALESFOLDER"> |
<Directory Id="locales" FileSource="..\locales"> |
<Component Id="locales_en.ini" Guid="c5622430-d713-11e2-8b8b-0800200c9a66"> |
<File Name="en.ini"/> |