Skip to content

Commit

Permalink
Sign the Windows driver and installer with the provided certificate.
Browse files Browse the repository at this point in the history
  • Loading branch information
shumatech committed May 14, 2017
1 parent 6361af1 commit 2123dc7
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ bossac
bin
*.swp
tags
*.bak
install/*.crt
install/*.p12
39 changes: 28 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,38 @@ COMMON_LDFLAGS=-Wl,--enable-auto-import -static -static-libstdc++ -static-libgcc
COMMON_LIBS=-ltermcap -Wl,--as-needed -lsetupapi
BOSSA_RC=BossaRes.rc
WIXDIR="C:\Program Files (x86)\WiX Toolset v3.10\bin"
CROSS_CA=$(INSTALLDIR)\\cross_ca.crt
CODE_SIGN=$(INSTALLDIR)\\code_sign.p12
TIMESTAMP=http://timestamp.comodoca.com/authenticode
SIGNTOOL="C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe"
INF2CAT="C:\Program Files (x86)\Windows Kits\10\bin\x86\Inf2Cat.exe"

define bossa_msi
$(OBJDIR)\\bossa-$(1)-$(VERSION).wixobj: $(INSTALLDIR)\\bossa.wxs
$(WIXDIR)\\candle.exe -dVersion=$(VERSION) -arch $(1) -out $$@ -ext $(WIXDIR)\\WixUIExtension.dll -ext $(WIXDIR)\\WixDifxAppExtension.dll $$<

$(BINDIR)\\bossa-$(1)-$(VERSION).msi: $(OBJDIR)\\bossa-$(1)-$(VERSION).wixobj
$(WIXDIR)\\light.exe -cultures:null -out $$@ -pdbout $(OBJDIR)\\bossa.wixpdb -sice:ICE57 -ext $(WIXDIR)\\WixUIExtension.dll -ext $(WIXDIR)\\WixDifxAppExtension.dll $(WIXDIR)\\difxapp_$(1).wixlib $$<
$$(Q)read -p "Password:" -rs PASSWORD; \
cmd /C '$(SIGNTOOL) sign /v /fd sha256 /ac $(CROSS_CA) /f $(CODE_SIGN) -t $(TIMESTAMP) /p '$$$$PASSWORD' $$@'
endef

$(OBJDIR)\\bossa-$(VERSION).wixobj: $(INSTALLDIR)\\bossa.wxs
$(WIXDIR)\\candle.exe -dVersion=$(VERSION) -arch x86 -out $@ -ext $(WIXDIR)\\WixUIExtension.dll -ext $(WIXDIR)\\WixDifxAppExtension.dll $<

$(OBJDIR)\\bossa64-$(VERSION).wixobj: $(INSTALLDIR)\\bossa.wxs
$(WIXDIR)\\candle.exe -dVersion=$(VERSION) -arch x64 -out $@ -ext $(WIXDIR)\\WixUIExtension.dll -ext $(WIXDIR)\\WixDifxAppExtension.dll $<
$(eval $(call bossa_msi,x86))
$(eval $(call bossa_msi,x64))

$(BINDIR)\\bossa-$(VERSION).msi: $(OBJDIR)\\bossa-$(VERSION).wixobj
$(WIXDIR)\\light.exe -cultures:null -out $@ -pdbout $(OBJDIR)\\bossa.wixpdb -sice:ICE57 -ext $(WIXDIR)\\WixUIExtension.dll -ext $(WIXDIR)\\WixDifxAppExtension.dll $(WIXDIR)\\difxapp_x86.wixlib $<
$(INSTALLDIR)\\bossa.cat: $(INSTALLDIR)\\bossa.inf
export TMP=$$(mktemp -d); \
cp $< $$TMP; \
cmd /C '$(INF2CAT) /v /driver:'$$(cygpath -w $$TMP)' /os:XP_X86,Vista_X86,Vista_X64,7_X86,7_X64,8_X86,8_X64,6_3_X86,6_3_X64,10_x86,10_x64'; \
mv $$TMP/bossa.cat $@; \
rm -rf $$TMP; \
read -p "Password:" -rs PASSWORD; \
cmd /C '$(SIGNTOOL) sign /v /fd sha256 /ac $(CROSS_CA) /f $(CODE_SIGN) -t $(TIMESTAMP) /p '$$PASSWORD' $@'

$(BINDIR)\\bossa64-$(VERSION).msi: $(OBJDIR)\\bossa64-$(VERSION).wixobj
$(WIXDIR)\\light.exe -cultures:null -out $@ -pdbout $(OBJDIR)\\bossa64.wixpdb -sice:ICE57 -ext $(WIXDIR)\\WixUIExtension.dll -ext $(WIXDIR)\\WixDifxAppExtension.dll $(WIXDIR)\\difxapp_x64.wixlib $<
bossa.cat: $(INSTALLDIR)\\bossa.cat

install32: $(BINDIR)\\bossa-$(VERSION).msi
install64: $(BINDIR)\\bossa64-$(VERSION).msi
install32: $(BINDIR)\\bossa-x86-$(VERSION).msi
install64: $(BINDIR)\\bossa-x64-$(VERSION).msi
.PHONY: install
install: strip install32 install64

Expand Down
Binary file added install/bossa.cat
Binary file not shown.
2 changes: 2 additions & 0 deletions install/bossa.inf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Class=Ports ; This is a seri
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} ; Associated GUID
Provider=%SHUMATECH% ; Driver is provided by SHUMATECH
DriverVer=05/18/2011,1.0 ; Driver version
CatalogFile=bossa.cat ; Catalog file
DriverPackageDisplayName=%BOSSA% ; Driver display name

[DestinationDirs] ; DestinationDirs section
DefaultDestDir=12 ; Default install directory is \drivers or \IOSubSys
Expand Down
4 changes: 4 additions & 0 deletions install/bossa.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
Name='bossa.inf'
DiskId='1'
Source='install\bossa.inf' />
<File Id='bossa.cat'
Name='bossa.cat'
DiskId='1'
Source='install\bossa.cat' />
<difx:Driver Legacy='yes'
ForceInstall='yes'
PlugAndPlayPrompt='no'
Expand Down
Binary file modified install/license.rtf
Binary file not shown.

0 comments on commit 2123dc7

Please sign in to comment.