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

Unified Diff: dev_install.cmd

Issue 11058028: Developer installation, gyp version
Patch Set: Created July 2, 2013, 3:13 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
« adblockplus.gyp ('K') | « adblockplus.gyp ('k') | dev_query.cmd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dev_install.cmd
===================================================================
new file mode 100644
--- /dev/null
+++ b/dev_install.cmd
@@ -0,0 +1,54 @@
+@echo off
+setlocal
+set argc=0
+for %%x in (%*) do set /a argc+=1
+if %argc% geq 4 goto check1
+:: Not enough arguments. Print help text.
+echo usage:
+echo dev_install.cmd ^<DLL path^> ^<project path^> ^<reg.exe 32 directory^> ^<reg.exe 64 directory^>
+echo(
+echo Install Adblock Plus for IE in the developer mode
+echo * Register the DLL as a per-user COM object with CSLID of the Adblock Plus for IE BHO
+echo * Copy html/ and locale/ directories to the DLL directory
+echo * Copy files/settings.ini to the DLL directory
+echo(
+echo arguments:
+echo ^<DLL path^> Path to the DLL to be registered.
+echo ^<project path^> Path to the project directory, assumed to be in ^<root^>/build/^<Configuration^>
+echo ^<reg.exe 32 directory^> ^| The directory for reg.exe to write into for 32 (resp. 64) bit registry
+echo ^<reg.exe 64 directory^> ^| One of "system32", "SysWOW64", or "sysnative"
+exit /b 0
+:check1
+:: We have at least one argument, which is for the DLL. Verify its existence.
+set DLL="%~1"
+if exist %DLL% goto check2
+echo DLL %DLL% not found. Aborting.
+exit /b 1
+:check2
+if exist %2 goto checkend
+echo project path "%~2" not found. Aborting.
+exit /b 1
+:checkend
+
+:: Set REG. It's based on either the third or fourth argument.
+:: We test against "x86" because there are two possible 64-bit values.
+if /i %PROCESSOR_ARCHITECTURE% equ x86 (set R=%3) else set R=%4
+set REG="%WINDIR%\%R%\reg.exe"
+if exist %REG% goto regend
+echo File %REG% not found. Aborting.
+exit /b 1
+:regend
+
+set OUTDIR=%~dp1
+set SOURCEDIR=%~2%..\..\
+echo DLL=%DLL%
+echo REG=%REG%
+echo SOURCEDIR=%SOURCEDIR%
+echo OUTDIR=%OUTDIR%
+%REG% add HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324694ED664} /ve /d "Adblock Plus for IE Browser Helper Object" /f >nul
+%REG% add HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324694ED664}\InprocServer32 /ve /d %DLL% /f >nul
+%REG% add HKCU\Software\Classes\CLSID\{FFCB3198-32F3-4E8B-9539-4324694ED664}\InprocServer32 /v ThreadingModel /d "Both" /f >nul
+copy "%SOURCEDIR%files\settings.ini" "%OUTDIR%settings.ini" >nul
+xcopy /s /I /y /D "%SOURCEDIR%html\*" "%OUTDIR%html" >nul
+xcopy /s /I /y /D "%SOURCEDIR%locales\*" "%OUTDIR%locales" >nul
+echo Done
« adblockplus.gyp ('K') | « adblockplus.gyp ('k') | dev_query.cmd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld