From 61597127a4d6b6eaea247f9948051b77061ec5fe Mon Sep 17 00:00:00 2001 From: "locka%iol.ie" Date: Mon, 29 Oct 2001 19:22:19 +0000 Subject: [PATCH] NOT PART OF BUILD. More updates to get a working CAB file packaging and signing working for control for hosting plugins --- .../activex/src/pluginhostctrl/cab/README.txt | 38 +++++++++++--- .../src/pluginhostctrl/cab/makecab.bat | 50 +++++++++++++------ .../src/pluginhostctrl/cab/pluginhostctrl.inf | 4 +- .../activex/src/pluginhostctrl/cab/verify.htm | 12 +++++ 4 files changed, 81 insertions(+), 23 deletions(-) create mode 100644 embedding/browser/activex/src/pluginhostctrl/cab/verify.htm diff --git a/embedding/browser/activex/src/pluginhostctrl/cab/README.txt b/embedding/browser/activex/src/pluginhostctrl/cab/README.txt index 11ccccd1c6a..907607f77eb 100644 --- a/embedding/browser/activex/src/pluginhostctrl/cab/README.txt +++ b/embedding/browser/activex/src/pluginhostctrl/cab/README.txt @@ -2,20 +2,42 @@ Want to generate a CAB file for the plugin host control? First off you need the Cabinet SDK: -http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncabsdk/html/cabdl.asp + http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncabsdk/html/cabdl.asp -Install that and edit makecab.bat and specify the path to your cabarc.exe program in the CABARCEXE variable. +And if you want to sign the CAB file you need the signing tool: + + http://msdn.microsoft.com/MSDN-FILES/027/000/219/codesign.exe + +More blurb about signing is here: + + http://www.verisign.com/support/tlc/codesign/install.html + +Please don't email me questions about signing since I'm just following the +instructions in the above link. + +Install the tools somewhere and edit the line setting the PATH in makecab.bat +to specify the correct path(s) to these programs. Next build the pluginhostctrl.dll (e.g. the ReleaseMinSize target) and type makecab ..\ReleaseMinSize\pluginhostctrl.dll -This produces pluginhostctrl.cab which you can place on a webserver somewhere so IE can download it -when it's specified in the tag. +This produces pluginhostctrl.cab which you can place on a webserver somewhere +so IE can download it when it's specified in the tag, e.g. + + + + +If you want to sign the CAB file with a certificate, type + + makecab ..\ReleaseMinSize\pluginhostctrl.dll xx.cer xx.key xx.spc + +Where xx.* files are your certificate, key and your software publisher +certificate. STILL TO DO - o Installation from CAB file has not been tested - o Signing the CAB file. I'm still looking for the signing tool. It's - in a crypto SDK I think. - + o Installation from CABs will probably fails until these scripts have been + sorted out \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/cab/makecab.bat b/embedding/browser/activex/src/pluginhostctrl/cab/makecab.bat index ca834fb93ab..94d0c44b6f4 100755 --- a/embedding/browser/activex/src/pluginhostctrl/cab/makecab.bat +++ b/embedding/browser/activex/src/pluginhostctrl/cab/makecab.bat @@ -1,20 +1,19 @@ @echo off -set CABARCEXE=d:\m\cabsdk\bin\cabarc.exe -set SIGNCODEXE= + +set OLDPATH=%PATH% +set PATH=d:\m\cabsdk\bin;d:\m\codesign\bin;%PATH% set OUTDIR=.\out +set OUTCAB=.\pluginhostctrl.cab set PLUGINHOSTCTRLDLL=%1 set CERTFILE=%2 set KEYFILE=%3 - -if EXIST %CABARCEXE% goto got_cabarc -echo ERROR: The CABARC tool is not at %CABARCEXE%, so can't proceed. -goto end -:got_cabarc +set SPCFILE=%4 if NOT .%PLUGINHOSTCTRLDLL%.==.. goto have_pluginhostctrl -echo Usage : %0 pluginhostctrl [certfile keyfile] +echo Usage : %0 pluginhostctrl [certfile keyfile spcfile] +echo echo Specify the path to the pluginhostctrl.dll file as the first argument echo and optionally the certificate and keyfile as extra arguments. goto end @@ -24,22 +23,45 @@ echo ERROR: The specified pluginhostctrl.dll file "%PLUGINHOSTCTRLDLL%" does not goto end :valid_pluginhostctrl + +REM === Make the CAB file === + mkdir %OUTDIR% -copy %PLUGINHOSTCTRLDLL% %OUTDIR%\pluginhostctrl.dll +copy %PLUGINHOSTCTRLDLL% %OUTDIR% copy redist\*.* %OUTDIR% copy pluginhostctrl.inf %OUTDIR% -%CABARCEXE% -s 6144 -r -P out\ N pluginhostctrl.cab out\*.* +cabarc -s 6144 -r -P %OUTDIR%\ N %OUTCAB% out\*.* + + +REM === Generate a test certificate to sign this thing with === + +if NOT .%TESTCERT%.==.. goto end_testcert +set KEYFILE=.\test.key +set CERTFILE=.\test.cer +set SPCFILE=.\test.spc +makecert -sv %KEYFILE% -n "CN=My Publisher Name" %CERTFILE% +cert2spc %CERTFILE% %SPCFILE% +:end_testcert + + +REM === Sign the CAB file === if .%CERTFILE%.==.. goto the_end if .%KEYFILE%.==.. goto the_end +if .%SPCFILE%.==.. goto the_end if NOT EXIST %CERTFILE% goto the_end if NOT EXIST %KEYFILE$ goto the_end -if NOT EXIST %SIGNCODEEXE% goto the_end +if NOT EXIST %SPCFILE$ goto the_end -REM TODO signing stuff here +signcode -spc %SPCFILE% -v %KEYFILE% -n "Mozilla ActiveX control for hosting plugins" %OUTCAB% + + +REM == THE END === :the_end +set PATH=%OLDPATH% +set OLDPATH= +set OUTCAB= set CERTFILE= set KEYFILE= -set CABARCEXE= -set SIGNCODEEXE= \ No newline at end of file +set SPCFILE= diff --git a/embedding/browser/activex/src/pluginhostctrl/cab/pluginhostctrl.inf b/embedding/browser/activex/src/pluginhostctrl/cab/pluginhostctrl.inf index c9ee6012cb5..19759d051b6 100644 --- a/embedding/browser/activex/src/pluginhostctrl/cab/pluginhostctrl.inf +++ b/embedding/browser/activex/src/pluginhostctrl/cab/pluginhostctrl.inf @@ -13,8 +13,10 @@ atl.dll=atl.dll file-win32-x86=thiscab DestDir=11 RegisterServer=yes +FileVersion=6,00,0,8449 [pluginhostctrl.dll] file-win32-x86=thiscab clsid={DBB2DE32-61F1-4F7F-BEB8-A37F5BC24EE2} -RegisterServer=yes \ No newline at end of file +FileVersion=1,0,0,0 +RegisterServer=yes diff --git a/embedding/browser/activex/src/pluginhostctrl/cab/verify.htm b/embedding/browser/activex/src/pluginhostctrl/cab/verify.htm new file mode 100644 index 00000000000..cfcdd216d50 --- /dev/null +++ b/embedding/browser/activex/src/pluginhostctrl/cab/verify.htm @@ -0,0 +1,12 @@ + + + CAB file verification + + +

Test page to verify CAB file was created and signed correctly

+ + + + \ No newline at end of file