Skip to content

Commit

Permalink
Update packaging script to sign and create .cab
Browse files Browse the repository at this point in the history
The package_etw.bat script now signs UIforETW.exe and UIforETW32.exe.
It then puts the .zip file in a .cab file so that the .cab file can
be signed. This adds an extra step to downloading UIforETW, but
should avoid Smart Screen problems and should allow greater trust.

Having the two binaries that require elevation now signed is obviously
a good thing.
  • Loading branch information
randomascii committed Mar 28, 2017
1 parent 47af88a commit b75199a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ flamegraph.txt
#Created by package_etw.bat
etwpackage/
etwpackage*.zip
etwpackage*.cab
etwsymbols*.zip
sourceindex.txt
makeandsigncab.bat

Debug/
Release/
Expand Down
11 changes: 11 additions & 0 deletions package_etw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,18 @@ powershell ..\GitHub-Source-Indexer\github-sourceindexer.ps1 -symbolsFolder etws
@echo %temp%\srcsrv\pdbstr -r -p:etwsymbols\UIforETWStatic_devrel32.pdb -s:srcsrv
:NoSourceIndexing

@rem Sign the important (requiring elevation) binaries
set path=%path%;C:\Program Files (x86)\Windows Kits\10\bin\x64
signtool sign /d "UIforETW" /du "https://github.com/google/UIforETW/releases" /n "Bruce Dawson" /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 %~dp0bin\UIforETW.exe %~dp0bin\UIforETW32.exe
@if not %errorlevel% equ 0 goto signing_failure

del *.zip 2>nul
call python make_zip_file.py etwpackage.zip etwpackage
@echo on
call python make_zip_file.py etwsymbols.zip etwsymbols
@echo on
call python rename_to_version.py UIforETW\Version.h
call makeandsigncab.bat
@echo on

@echo Now upload the new etwpackage*.zip and etwsymbols*.zip
Expand Down Expand Up @@ -178,3 +185,7 @@ call python rename_to_version.py UIforETW\Version.h
:copyfailure
@echo Failed to copy file. Aborting.
@exit /b

:signing_failure
@echo Failed to sign files. Aborting.
@exit /b
4 changes: 4 additions & 0 deletions rename_to_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
print 'Renaming zip files to version "%s"' % version
os.rename('etwpackage.zip', 'etwpackage%s.zip' % version)
os.rename('etwsymbols.zip', 'etwsymbols%s.zip' % version)
open('makeandsigncab.bat', 'wt').write(
'makecab.exe etwpackage%s.zip etwpackage%s.cab\r\n'
'signtool sign /d "UIforETW Package" /du "https://github.com/google/UIforETW/releases" /n "Bruce Dawson" /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 etwpackage%s.cab\r\n'
% (version, version, version))
sys.exit(0)
assert(0)

0 comments on commit b75199a

Please sign in to comment.