зеркало из https://github.com/mozilla/pjs.git
NOT PART OF BUILD. More updates to get a working CAB file packaging and signing working for control for hosting plugins
This commit is contained in:
Родитель
e36e61bae8
Коммит
61597127a4
|
@ -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 <OBJECT> tag.
|
||||
This produces pluginhostctrl.cab which you can place on a webserver somewhere
|
||||
so IE can download it when it's specified in the <OBJECT> tag, e.g.
|
||||
|
||||
<OBJECT width="100" height="100"
|
||||
classid="CLSID:DBB2DE32-61F1-4F7F-BEB8-A37F5BC24EE2"
|
||||
codebase="http://www.blahblah.com/pluginhostctrl.cab#Version=1,0,0,0">
|
||||
</OBJECT>
|
||||
|
||||
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
|
|
@ -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=
|
||||
set SPCFILE=
|
||||
|
|
|
@ -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
|
||||
FileVersion=1,0,0,0
|
||||
RegisterServer=yes
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>CAB file verification</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<P>Test page to verify CAB file was created and signed correctly</P>
|
||||
<OBJECT width="100" height="100"
|
||||
classid="CLSID:DBB2DE32-61F1-4F7F-BEB8-A37F5BC24EE2"
|
||||
codebase="./pluginhostctrl.cab#Version=1,0,0,0">
|
||||
</OBJECT>
|
||||
</BODY>
|
||||
</HTML>
|
Загрузка…
Ссылка в новой задаче