forked from RickStrahl/LiveReloadServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-exe.ps1
34 lines (27 loc) · 1.37 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
29
30
31
32
33
34
# Make sure you have this in your project:
#
# <PublishSingleFile>true</PublishSingleFile>
# <PublishTrimmed>true</PublishTrimmed>
# <RuntimeIdentifier>win-x64</RuntimeIdentifier>
#
# and you disable the Package Build
#
# <PackAsTool>false</PackAsTool>
#
# 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 './SingleFileExe' -PathType Container) { remove-item ./SingleFileExe -Recurse -Force }
# Single File Exe output
dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=false -r win-x64 --output SingleFileExe
copy ./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
Move-Item ./SingleFileExe/LiveReloadServer.exe ./LiveReloadWebServer.exe -force
#remove-item ./SingleFileExe -Recurse -Force
# Sign exe
.\signtool.exe sign /v /n "West Wind Technologies" /tr "http://timestamp.digicert.com" /td SHA256 /fd SHA256 ".\LiveReloadWebServer.exe"