| OLD | NEW |
| 1 # | 1 # |
| 2 # NMAKE is a 32-bit application, which makes it problematic to make 64-bit regis
try entries with the standard command-line tools such as "reg.exe". | 2 # NMAKE is a 32-bit application, which makes it problematic to make 64-bit regis
try entries with the standard command-line tools such as "reg.exe". |
| 3 # As a 32-bit application, when it loads "reg.exe" from the ordinary directory,
%WINDIR%\System32, the WOW64 system redirects it load from %WINDIR%\SysWOW64. | 3 # As a 32-bit application, when it loads "reg.exe" from the ordinary directory,
%WINDIR%\System32, the WOW64 system redirects it load from %WINDIR%\SysWOW64. |
| 4 # So even if you explicitly put in the 64-bit path, because NMAKE is 32-bit it w
ill load the 32-bit version anyway. | 4 # So even if you explicitly put in the 64-bit path, because NMAKE is 32-bit it w
ill load the 32-bit version anyway. |
| 5 # To get around this, we check for the existence of %WINDIR%\sysnative\reg.exe,
which if present means a few things. | 5 # To get around this, we check for the existence of %WINDIR%\sysnative\reg.exe,
which if present means a few things. |
| 6 # -- 1. We're running on Windows Vista or later, because 64-bit XP doesn't have
"sysnative." | 6 # -- 1. We're running on Windows Vista or later, because 64-bit XP doesn't have
"sysnative." |
| 7 # -- 2. We're running on a 64-bit version of Windows. | 7 # -- 2. We're running on a 64-bit version of Windows. |
| 8 # -- 3. We're running from a 32-bit process, which should always be true about N
MAKE. | 8 # -- 3. We're running from a 32-bit process, which should always be true about N
MAKE. |
| 9 # | 9 # |
| 10 # See http://ovidiupl.wordpress.com/2008/07/11/useful-wow64-file-system-trick/ f
or more details. | 10 # See http://ovidiupl.wordpress.com/2008/07/11/useful-wow64-file-system-trick/ f
or more details. |
| 11 # | 11 # |
| 12 !if [cmd /c if exist %WINDIR%\sysnative\reg.exe exit /b 1] | 12 !if [cmd /c if exist %WINDIR%\sysnative\reg.exe exit /b 1] |
| 13 REG=$(WINDIR)\sysnative\reg.exe | 13 REG=$(WINDIR)\sysnative\reg.exe |
| 14 X64=1 | 14 X64=1 |
| 15 !else | 15 !else |
| 16 REG=$(WINDIR)\reg.exe | 16 REG=$(WINDIR)\reg.exe |
| 17 !message Warning: Developer installation not tested on XP or 32-bit Windows. | 17 !message Warning: Developer installation not tested on XP or 32-bit Windows. |
| 18 !endif | 18 !endif |
| 19 | 19 |
| 20 !message DLL=$(DLL) | 20 !message DLL=$(DLL) |
| 21 | 21 |
| 22 # | 22 # |
| 23 # Default (first) target is a help message, in case anybody runs it outside Visu
al Studio. | 23 # Default (first) target is a help message, in case anybody runs it outside Visu
al Studio. |
| 24 # | 24 # |
| 25 help: | 25 help: |
| 26 @echo This Makefile is intended to be run from within Visual Studio to p
rovide developer installations of Adblock Plus for IE. | 26 @echo This Makefile is intended to be run from within Visual Studio to p
rovide developer installations of Adblock Plus for IE. |
| 27 | 27 |
| 28 build64: register64 check_BHO copy | 28 build64: register64 check_BHO64 copy |
| 29 | 29 |
| 30 rebuild64: clean64 build64 | 30 rebuild64: clean64 build64 |
| 31 | 31 |
| 32 build32: register32 check_BHO copy | 32 build32: register32 check_BHO32 copy |
| 33 | 33 |
| 34 rebuild32: clean32 build32 | 34 rebuild32: clean32 build32 |
| 35 | 35 |
| 36 # | 36 # |
| 37 # We're using "reg.exe" for the HKCU keys because the one with the DLL path name
would need to be backslash-quoted to go into a .REG file. | 37 # We're using "reg.exe" for the HKCU keys because the one with the DLL path name
would need to be backslash-quoted to go into a .REG file. |
| 38 # | 38 # |
| 39 # Note that the CLSID is register in HKCU, which avoids the need to elevate with
UAC to high integrity in order to write. | 39 # Note that the CLSID is register in HKCU, which avoids the need to elevate with
UAC to high integrity in order to write. |
| 40 # Also note that the "Browser Helper Object" key is in HKLM, which is required b
ecause of IE. | 40 # Also note that the "Browser Helper Object" key is in HKLM, which is required b
ecause of IE. |
| 41 # IE only scans in HKLM for BHO entries. | 41 # IE only scans in HKLM for BHO entries. |
| 42 # IE does not scan HKCU for BHO entries, contrary to some sources online. | 42 # IE does not scan HKCU for BHO entries, contrary to some sources online. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 63 @echo Start 'register' action. | 63 @echo Start 'register' action. |
| 64 reg add HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324694ED66
4} /ve /d "Adblock Plus for IE Browser Helper Object" /f >nul | 64 reg add HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324694ED66
4} /ve /d "Adblock Plus for IE Browser Helper Object" /f >nul |
| 65 reg add HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324694ED66
4}\InprocServer32 /ve /d "$(DLL)" /f >nul | 65 reg add HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324694ED66
4}\InprocServer32 /ve /d "$(DLL)" /f >nul |
| 66 reg add HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324694ED66
4}\InprocServer32 /v ThreadingModel /d "Both" /f >nul | 66 reg add HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324694ED66
4}\InprocServer32 /v ThreadingModel /d "Both" /f >nul |
| 67 @date /t >"$(OutDir)registered.timestamp.txt" | 67 @date /t >"$(OutDir)registered.timestamp.txt" |
| 68 @time /t >>"$(OutDir)registered.timestamp.txt" | 68 @time /t >>"$(OutDir)registered.timestamp.txt" |
| 69 | 69 |
| 70 # | 70 # |
| 71 # Fortuitously, the warning message below is actually parsed by Visual Studio an
d show up with a yellow flag in the error list. | 71 # Fortuitously, the warning message below is actually parsed by Visual Studio an
d show up with a yellow flag in the error list. |
| 72 # | 72 # |
| 73 check_BHO: | 73 check_BHO64: |
| 74 !if [$(REG) query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\Browser Helper Objects\{FFCB3198-32F3-4E8B-9539-4324694ED664}" 2>&1 >nu
l] | 74 !if [$(REG) query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\Browser Helper Objects\{FFCB3198-32F3-4E8B-9539-4324694ED664}" 2>&1 >nu
l] |
| 75 @echo Warning: BHO key not registered. IE cannot find the plugin unless
the BHO key is present in the registry. Use "BHO_add.reg" to add the key. | 75 @echo Warning: BHO key not registered. IE cannot find the plugin unless
the BHO key is present in the registry. Use "BHO_add.reg" to add the key. |
| 76 !endif | 76 !endif |
| 77 | 77 |
| 78 check_BHO32: |
| 79 !if [reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Exp
lorer\Browser Helper Objects\{FFCB3198-32F3-4E8B-9539-4324694ED664}" 2>&1 >nul] |
| 80 @echo Warning: BHO key not registered. IE cannot find the plugin unless
the BHO key is present in the registry. Use "BHO_add.reg" to add the key. |
| 81 !endif |
| 82 |
| 78 copy: | 83 copy: |
| 79 @echo Copying files | 84 @echo Copying files |
| 80 copy "$(ProjectDir)files\settings.ini" "$(OutDir)settings.ini" | 85 copy "$(ProjectDir)files\settings.ini" "$(OutDir)settings.ini" |
| 81 xcopy /s /I /y /D "$(ProjectDir)html\*" "$(OutDir)html" | 86 xcopy /s /I /y /D "$(ProjectDir)html\*" "$(OutDir)html" |
| 82 xcopy /s /I /y /D "$(ProjectDir)locales\*" "$(OutDir)locales" | 87 xcopy /s /I /y /D "$(ProjectDir)locales\*" "$(OutDir)locales" |
| 83 @date /t >"$(OutDir)copied.timestamp.txt" | 88 @date /t >"$(OutDir)copied.timestamp.txt" |
| 84 @time /t >>"$(OutDir)copied.timestamp.txt" | 89 @time /t >>"$(OutDir)copied.timestamp.txt" |
| 85 | 90 |
| 86 # | 91 # |
| 87 # N.B. We don't delete the CLSID in HKLM for clean. That wouldn't be our key, bu
t the installer's. | 92 # N.B. We don't delete the CLSID in HKLM for clean. That wouldn't be our key, bu
t the installer's. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 105 -@$(REG) query HKLM\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324
694ED664}\InprocServer32 2>nul | 110 -@$(REG) query HKLM\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324
694ED664}\InprocServer32 2>nul |
| 106 -@$(REG) query HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324
694ED664} /ve 2>nul | 111 -@$(REG) query HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324
694ED664} /ve 2>nul |
| 107 -@$(REG) query HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324
694ED664}\InprocServer32 2>nul | 112 -@$(REG) query HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324
694ED664}\InprocServer32 2>nul |
| 108 !ifdef X64 | 113 !ifdef X64 |
| 109 # WoW64 keys | 114 # WoW64 keys |
| 110 -@$(REG) query HKLM\Software\Wow6432Node\Classes\CLSID\{FFCB3198-32F3-4E
8B-9539-4324694ED664} /ve 2>nul | 115 -@$(REG) query HKLM\Software\Wow6432Node\Classes\CLSID\{FFCB3198-32F3-4E
8B-9539-4324694ED664} /ve 2>nul |
| 111 -@$(REG) query HKLM\Software\Wow6432Node\Classes\CLSID\{FFCB3198-32F3-4E
8B-9539-4324694ED664}\InprocServer32 2>nul | 116 -@$(REG) query HKLM\Software\Wow6432Node\Classes\CLSID\{FFCB3198-32F3-4E
8B-9539-4324694ED664}\InprocServer32 2>nul |
| 112 -@$(REG) query HKCU\Software\Wow6432Node\Classes\CLSID\{FFCB3198-32F3-4E
8B-9539-4324694ED664} /ve 2>nul | 117 -@$(REG) query HKCU\Software\Wow6432Node\Classes\CLSID\{FFCB3198-32F3-4E
8B-9539-4324694ED664} /ve 2>nul |
| 113 -@$(REG) query HKCU\Software\Wow6432Node\Classes\CLSID\{FFCB3198-32F3-4E
8B-9539-4324694ED664}\InprocServer32 2>nul | 118 -@$(REG) query HKCU\Software\Wow6432Node\Classes\CLSID\{FFCB3198-32F3-4E
8B-9539-4324694ED664}\InprocServer32 2>nul |
| 114 !endif | 119 !endif |
| OLD | NEW |