mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
@@ -19,13 +19,11 @@ 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" --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\Update\Update.csproj" -o "$Out"
|
||||
dotnet publish -v minimal -c Release "$PSScriptRoot\src\SyncReleases\SyncReleases.csproj" -o "$Out"
|
||||
|
||||
# Copy over all files we need
|
||||
Copy-Item "$Out\Update.exe" -Destination "$Out\Squirrel.exe"
|
||||
Move-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"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
<dependencies>
|
||||
<group targetFramework="netstandard2.0">
|
||||
<dependency id="DeltaCompressionDotNet" version="2.0.1" />
|
||||
<dependency id="Mono.Cecil" version="0.11.4" />
|
||||
<dependency id="SharpCompress" version="0.28.3" />
|
||||
<dependency id="System.Drawing.Common" version="5.0.2" />
|
||||
@@ -27,6 +28,6 @@
|
||||
<files>
|
||||
<file src="..\build\Release\netstandard2.0\*" target="lib\netstandard2.0" />
|
||||
<file src="..\build\publish\*" target="tools" />
|
||||
<file src="Clowd.Squirrel.props" target="build" />
|
||||
<!--<file src="Clowd.Squirrel.props" target="build" />-->
|
||||
</files>
|
||||
</package>
|
||||
@@ -14,7 +14,7 @@
|
||||
<ProjectGuid>{C1D40624-A484-438A-B846-052F321C89D1}</ProjectGuid>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<RootNamespace>Setup</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<Description>Squirrel</Description>
|
||||
<Title>Squirrel</Title>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>9</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>StubExecutable</RootNamespace>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<SelfContained>false</SelfContained>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<LangVersion>9</LangVersion>
|
||||
<RootNamespace>Squirrel.SyncReleases</RootNamespace>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<SelfContained>true</SelfContained>
|
||||
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
||||
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Squirrel.Update
|
||||
break;
|
||||
#endif
|
||||
case UpdateAction.Releasify:
|
||||
Releasify(opt.target, opt.releaseDir, opt.bootstrapperExe, opt.backgroundGif, opt.signingParameters, opt.baseUrl, opt.setupIcon, !opt.noMsi, opt.packageAs64Bit, opt.frameworkVersion, !opt.noDelta, opt.selfContained);
|
||||
Releasify(opt.target, opt.releaseDir, opt.bootstrapperExe, opt.backgroundGif, opt.signingParameters, opt.baseUrl, opt.setupIcon, !opt.noMsi, opt.packageAs64Bit, opt.frameworkVersion, !opt.noDelta);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ namespace Squirrel.Update
|
||||
}
|
||||
}
|
||||
|
||||
public void Releasify(string package, string targetDir = null, string bootstrapperExe = null, string backgroundGif = null, string signingOpts = null, string baseUrl = null, string setupIcon = null, bool generateMsi = true, bool packageAs64Bit = false, string frameworkVersion = null, bool generateDeltas = true, bool selfContained = false)
|
||||
public void Releasify(string package, string targetDir = null, string bootstrapperExe = null, string backgroundGif = null, string signingOpts = null, string baseUrl = null, string setupIcon = null, bool generateMsi = true, bool packageAs64Bit = false, string frameworkVersion = null, bool generateDeltas = true)
|
||||
{
|
||||
ensureConsole();
|
||||
|
||||
@@ -375,7 +375,7 @@ namespace Squirrel.Update
|
||||
.Where(d => re.IsMatch(d))
|
||||
.OrderBy(d => d.Length)
|
||||
.FirstOrDefault();
|
||||
File.Copy(getUpdateExePath(selfContained), Path.Combine(libDir, "Squirrel.exe"));
|
||||
File.Copy(getUpdateExePath(), Path.Combine(libDir, "Squirrel.exe"));
|
||||
|
||||
// sign all exe's in this package
|
||||
if (signingOpts == null) return;
|
||||
@@ -420,7 +420,7 @@ namespace Squirrel.Update
|
||||
var newestFullRelease = releaseEntries.MaxBy(x => x.Version).Where(x => !x.IsDelta).First();
|
||||
|
||||
File.Copy(bootstrapperExe, targetSetupExe, true);
|
||||
var zipPath = createSetupEmbeddedZip(Path.Combine(di.FullName, newestFullRelease.Filename), di.FullName, signingOpts, setupIcon, selfContained).Result;
|
||||
var zipPath = createSetupEmbeddedZip(Path.Combine(di.FullName, newestFullRelease.Filename), di.FullName, signingOpts, setupIcon).Result;
|
||||
|
||||
var writeZipToSetup = Utility.FindHelperExecutable("WriteZipToSetup.exe");
|
||||
|
||||
@@ -566,26 +566,26 @@ namespace Squirrel.Update
|
||||
}
|
||||
}
|
||||
|
||||
string getUpdateExePath(bool selfContained)
|
||||
string getUpdateExePath()
|
||||
{
|
||||
if (selfContained) {
|
||||
var selfPath = Path.Combine(AssemblyRuntimeInfo.BaseDirectory, "UpdateSelfContained.exe");
|
||||
if (!File.Exists(selfPath)) {
|
||||
this.Log().Error("Could not find UpdateSelfContained.exe in base directory. Am I published?");
|
||||
}
|
||||
return selfPath;
|
||||
}
|
||||
//if (selfContained) {
|
||||
// var selfPath = Path.Combine(AssemblyRuntimeInfo.BaseDirectory, "UpdateSelfContained.exe");
|
||||
// if (!File.Exists(selfPath)) {
|
||||
// this.Log().Error("Could not find UpdateSelfContained.exe in base directory. Am I published?");
|
||||
// }
|
||||
// return selfPath;
|
||||
//}
|
||||
return AssemblyRuntimeInfo.EntryExePath;
|
||||
}
|
||||
|
||||
async Task<string> createSetupEmbeddedZip(string fullPackage, string releasesDir, string signingOpts, string setupIcon, bool selfContained)
|
||||
async Task<string> createSetupEmbeddedZip(string fullPackage, string releasesDir, string signingOpts, string setupIcon)
|
||||
{
|
||||
string tempPath;
|
||||
|
||||
this.Log().Info("Building embedded zip file for Setup.exe");
|
||||
using (Utility.WithTempDirectory(out tempPath, null)) {
|
||||
this.ErrorIfThrows(() => {
|
||||
File.Copy(getUpdateExePath(selfContained), Path.Combine(tempPath, "Update.exe"));
|
||||
File.Copy(getUpdateExePath(), Path.Combine(tempPath, "Update.exe"));
|
||||
File.Copy(fullPackage, Path.Combine(tempPath, Path.GetFileName(fullPackage)));
|
||||
}, "Failed to write package files to temp dir: " + tempPath);
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace Squirrel.Update
|
||||
internal bool packageAs64Bit { get; private set; } = false;
|
||||
internal bool noDelta { get; private set; } = false;
|
||||
internal bool onlyUpdateShortcuts { get; private set; } = false;
|
||||
internal bool selfContained { get; private set; } = false;
|
||||
|
||||
public StartupOption(string[] args)
|
||||
{
|
||||
@@ -69,7 +68,6 @@ namespace Squirrel.Update
|
||||
{ "framework-version=", "Set the required .NET framework version, e.g. net461", v => frameworkVersion = v },
|
||||
{ "msi-win64", "Mark the MSI as 64-bit, which is useful in Enterprise deployment scenarios", _ => packageAs64Bit = true},
|
||||
{ "updateOnly", "Update shortcuts that already exist, rather than creating new ones", _ => onlyUpdateShortcuts = true},
|
||||
{ "selfContained", "(experimental) Generates a release with a fully self-contained updater that does not have any dependencies", _ => selfContained = true},
|
||||
};
|
||||
|
||||
opts.Parse(args);
|
||||
|
||||
@@ -2,16 +2,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<SelfContained>false</SelfContained>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<ApplicationIcon>squirrel.ico</ApplicationIcon>
|
||||
<LangVersion>9</LangVersion>
|
||||
<RootNamespace>Squirrel.Update</RootNamespace>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<ApplicationIcon>squirrel.ico</ApplicationIcon>
|
||||
<NoWarn>CA1416</NoWarn>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<SelfContained>true</SelfContained>
|
||||
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
||||
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- If update.ico exists in project directory it will be used instead of the squirrel icon -->
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>WriteZipToSetup</RootNamespace>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user