-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
build-exe.ps1
28 lines (22 loc) · 1.35 KB
/
build-exe.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Make sure you have this in your project:
#
# <DefineConstants>USE_RAZORPAGES;BUILD_EXE</DefineConstants>
#
# Note:
# For Razor Compilation `PublishTrimmed` does not work because
# it relies on dynamic interfaces when compiling Razor at runtime.
# If you compile with Razor disabled, or don't plan on using Razor
# with this LiveReloadServer, you can set /p:PublishTrimmed=true
# to cut the size of the exe in half.
# if (test-path './LiveReloadWebServer.exe' -PathType Leaf) { remove-item ./LiveReloadWebServer.exe }
if (test-path './build/SelfContained' -PathType Container) { remove-item ./build/SelfContained -Recurse -Force }
# Single File Exe output
# Copy-Item ./LiveReloadServer/LiveReloadWebServer.json ./LiveReloadWebServer.json
# Make sure hosted project gets built (in default project output folder)
dotnet publish -c Release /p:PublishSingleFile=false /p:PublishTrimmed=false -o ./build/SelfContained
copy-Item ./build/SelfContained/LiveReloadServer.exe ./build/SelfContained/LiveReloadWebServer.exe
Remove-Item ./build/SelfContained/LiveReloadServer.exe
# Sign exe
.\signtool.exe sign /v /n "West Wind Technologies" /tr "http://timestamp.digicert.com" /td SHA256 /fd SHA256 ".\build\SelfContained\LiveReloadWebServer.exe"
remove-item ".\LiveReloadWebServer-SelfContained.zip"
7z a -tzip -r ".\LiveReloadWebServer-SelfContained.zip" "./build/SelfContained/*.*"