Skip to content

Commit

Permalink
code sign published installer
Browse files Browse the repository at this point in the history
  • Loading branch information
stchan committed Feb 21, 2023
1 parent b089b4a commit f984576
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
14 changes: 2 additions & 12 deletions .gitignore
@@ -1,15 +1,4 @@
obj
bin
obj
bin
TestResult.xml
*.suo
PdfScribeCore.csproj.user
PdfScribe.csproj.user
/PdfScribeInstall/PrimaryOutputHarvest/*.pdb
/PdfScribeInstall/PrimaryOutputHarvest/*.exe
/PdfScribeInstall/PrimaryOutputHarvest/*.config
/PdfScribeInstall/PrimaryOutputHarvest/*.dll
TestResult.xml

#Ignore thumbnails created by Windows
Thumbs.db
Expand Down Expand Up @@ -42,3 +31,4 @@ _ReSharper*/
.vs/
#Nuget packages folder
packages/
publish/
14 changes: 11 additions & 3 deletions PdfScribeInstall/PdfScribeInstall.wixproj
Expand Up @@ -95,10 +95,18 @@
</CreateProperty>
</Target>
<PropertyGroup>
<PostBuildEvent>powershell -command "(Get-FileHash -Algorithm SHA512 %27!(TargetPath)%27).Hash + %27 %2a%27 + (Split-Path %27!(TargetPath)%27 -leaf) | Out-File -filePath %27!(TargetPath).sha512%27 -encoding Default"
powershell -command "((Get-Content %27!(TargetPath).sha512%27) -join \"`n\") + \"`n\" | Set-Content -NoNewline %27!(TargetPath).sha512%27"</PostBuildEvent>
<PreBuildEvent>powershell -command "del ((Split-Path %27!(TargetPath)%27 -parent) + %27\%2a.sha512%27)"</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>powershell -command "del ((Split-Path %27!(TargetPath)%27 -parent) + %27\%2a.sha512%27)"</PreBuildEvent>
<PostBuildEvent>powershell -command "(Get-FileHash -Algorithm SHA512 %27!(TargetPath)%27).Hash + %27 %2a%27 + (Split-Path %27!(TargetPath)%27 -leaf) | Out-File -filePath %27!(TargetPath).sha512%27 -encoding Default"
powershell -command "((Get-Content %27!(TargetPath).sha512%27) -join \"`n\") + \"`n\" | Set-Content -NoNewline %27!(TargetPath).sha512%27"
if $(ConfigurationName) == Release (
cd /d $(SolutionDir)
if NOT EXIST "publish\" mkdir "publish"
if NOT EXIST "publish\unsigned" mkdir "publish\unsigned"
del /q "publish\unsigned\%2a"
copy /y "!(TargetPath)" "publish\unsigned"
copy /y "!(TargetPath).sha512" "publish\unsigned"
)</PostBuildEvent>
</PropertyGroup>
</Project>
6 changes: 3 additions & 3 deletions README.md
@@ -1,4 +1,4 @@
# PdfScribe v1.3.1
# PdfScribe v1.3.2

PdfScribe is a PDF virtual printer. Check the [releases](https://github.com/stchan/PdfScribe/releases) page to download a prebuilt MSI package.

Expand All @@ -9,7 +9,7 @@ PdfScribe is a PDF virtual printer. Check the [releases](https://github.com/stch

## Building from source

Visual Studio 2019/Votive 2019 (or newer), and Wix 3.11 (or newer) are required to build PdfScribe.
Visual Studio 2022/Votive 2022, and Wix 3.11 (or newer) are required to build PdfScribe.

PdfScribe links to, and distributes the following third party components:

Expand All @@ -35,7 +35,7 @@ In the application config file (PdfScribe.exe.config), there are the following s
* Check repo [issues](https://github.com/stchan/PdfScribe/issues) for the latest.

## Release notes
#### v1.3.1
#### v1.3.2
* Set GS AutoRotatePages to /None (issue #32)
#### v1.3.0
* Added **StripNoRedistill** option (fix for issue #33).
Expand Down
14 changes: 14 additions & 0 deletions publishrelease.bat
@@ -0,0 +1,14 @@
echo off
if EXIST "%ProgramFiles%\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" (
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat"
echo on
msbuild PdfScribe.sln -t:Rebuild -p:Configuration=Release -r
if NOT EXIST "publish\signed" mkdir "publish\signed"
del /q "publish\signed\*"
copy /y "publish\unsigned\PdfScribeInstall_*.msi" "publish\signed\"
cd "publish\signed\"
signtool sign /n "Open Source Developer, Sherman Chan" /t http://time.certum.pl /fd sha256 /v PdfScribeInstall_*.msi
) ELSE (
echo Could not set build tools environment.
exit 1
)

0 comments on commit f984576

Please sign in to comment.