Produce a SelfContained & non-SelfContained version of Update.exe during build

This commit is contained in:
Caelan Sayler
2021-08-28 13:08:18 +01:00
parent 6f6efc37e7
commit 375608be81
2 changed files with 6 additions and 5 deletions

View File

@@ -19,11 +19,13 @@ foreach ($Folder in $Folders) {
&"$MSBuildPath" /verbosity:minimal /restore /p:Configuration=Release
# Build single-exe packaged projects
dotnet publish -v minimal -c Release "$PSScriptRoot\src\Update\Update.csproj" -o "$Out"
dotnet publish -v minimal -c Release "$PSScriptRoot\src\Update\Update.csproj" -o "$Out" --self-contained true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishTrimmed=true -p:TrimMode=link
Move-Item "$Out\Update.exe" -Destination "$Out\UpdateSelfContained.exe"
dotnet publish -v minimal -c Release "$PSScriptRoot\src\Update\Update.csproj" -o "$Out" --self-contained false
dotnet publish -v minimal -c Release "$PSScriptRoot\src\SyncReleases\SyncReleases.csproj" -o "$Out"
# Copy over all files we need
Move-Item "$Out\Update.exe" -Destination "$Out\Squirrel.exe"
Copy-Item "$Out\Update.exe" -Destination "$Out\Squirrel.exe"
Move-Item "$Out\Update.com" -Destination "$Out\Squirrel.com"
# Move-Item "$Out\Update.pdb" -Destination "$Out\Squirrel.pdb"
@@ -37,7 +39,7 @@ Copy-Item "$In\Win32\WriteZipToSetup.exe" -Destination "$Out"
Copy-Item "$In\Win32\WriteZipToSetup.pdb" -Destination "$Out"
Copy-Item -Path "$PSScriptRoot\vendor\7zip\*" -Destination "$Out" -Recurse
# Copy-Item -Path "$PSScriptRoot\vendor\wix\*" -Destination "$Out" -Recurse
Copy-Item -Path "$PSScriptRoot\vendor\wix\*" -Destination "$Out" -Recurse
Copy-Item "$PSScriptRoot\.nuget\NuGet.exe" -Destination "$Out"
Remove-Item "$Out\*.pdb"

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
@@ -7,7 +7,6 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ApplicationIcon>squirrel.ico</ApplicationIcon>
</PropertyGroup>