mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
update support, 64bit support, better naming
This commit is contained in:
@@ -23,6 +23,16 @@ Options:
|
||||
installation
|
||||
-n, --signWithParams=VALUE Sign the installer via SignTool.exe with the
|
||||
parameters given
|
||||
--setupIcon=VALUE Path to an ICO file that will be used for the
|
||||
Setup executable's icon
|
||||
-b --baseUrl=VALUE Provides a base URL to prefix the RELEASES file
|
||||
packages with
|
||||
--no-msi Don't generate an MSI package
|
||||
--msi-win64 Mark the MSI as 64-bit, which is useful in
|
||||
Enterprise deployment scenarios
|
||||
--no-delta Don't generate delta packages to save time
|
||||
--framework-version=VALUE
|
||||
Set the required .NET framework version, e.g. net461
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
@@ -100,6 +100,7 @@ namespace Squirrel.Update
|
||||
bool shouldWait = false;
|
||||
bool noMsi = (Environment.OSVersion.Platform != PlatformID.Win32NT); // NB: WiX doesn't work under Mono / Wine
|
||||
bool noDelta = false;
|
||||
bool packageAs64Bit = false;
|
||||
|
||||
opts = new OptionSet() {
|
||||
"Usage: Squirrel.exe command [OPTS]",
|
||||
@@ -134,6 +135,7 @@ namespace Squirrel.Update
|
||||
{ "no-msi", "Don't generate an MSI package", v => noMsi = true},
|
||||
{ "no-delta", "Don't generate delta packages to save time", v => noDelta = true},
|
||||
{ "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},
|
||||
};
|
||||
|
||||
opts.Parse(args);
|
||||
@@ -184,7 +186,7 @@ namespace Squirrel.Update
|
||||
break;
|
||||
#endif
|
||||
case UpdateAction.Releasify:
|
||||
Releasify(target, releaseDir, packagesDir, bootstrapperExe, backgroundGif, signingParameters, baseUrl, setupIcon, !noMsi, frameworkVersion, !noDelta);
|
||||
Releasify(target, releaseDir, packagesDir, bootstrapperExe, backgroundGif, signingParameters, baseUrl, setupIcon, !noMsi, packageAs64Bit, frameworkVersion, !noDelta);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -343,7 +345,7 @@ namespace Squirrel.Update
|
||||
}
|
||||
}
|
||||
|
||||
public void Releasify(string package, string targetDir = null, string packagesDir = null, string bootstrapperExe = null, string backgroundGif = null, string signingOpts = null, string baseUrl = null, string setupIcon = null, bool generateMsi = true, string frameworkVersion = null, bool generateDeltas = true)
|
||||
public void Releasify(string package, string targetDir = null, string packagesDir = 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();
|
||||
|
||||
@@ -466,7 +468,7 @@ namespace Squirrel.Update
|
||||
}
|
||||
|
||||
if (generateMsi) {
|
||||
createMsiPackage(targetSetupExe, new ZipPackage(package)).Wait();
|
||||
createMsiPackage(targetSetupExe, new ZipPackage(package), packageAs64Bit).Wait();
|
||||
|
||||
if (signingOpts != null) {
|
||||
signPEFile(targetSetupExe.Replace(".exe", ".msi"), signingOpts).Wait();
|
||||
@@ -720,7 +722,7 @@ namespace Squirrel.Update
|
||||
}
|
||||
}
|
||||
|
||||
static async Task createMsiPackage(string setupExe, IPackage package)
|
||||
static async Task createMsiPackage(string setupExe, IPackage package, bool packageAs64Bit)
|
||||
{
|
||||
var pathToWix = pathToWixTools();
|
||||
var setupExeDir = Path.GetDirectoryName(setupExe);
|
||||
@@ -736,7 +738,10 @@ namespace Squirrel.Update
|
||||
{ "Author", company },
|
||||
{ "Version", Regex.Replace(package.Version.ToString(), @"-.*$", "") },
|
||||
{ "Summary", package.Summary ?? package.Description ?? package.Id },
|
||||
{ "Codepage", $"{culture}" }
|
||||
{ "Codepage", $"{culture}" },
|
||||
{ "Platform", packageAs64Bit ? "x64" : "x86" },
|
||||
{ "ProgramFilesFolder", packageAs64Bit ? "ProgramFiles64Folder" : "ProgramFilesFolder" },
|
||||
{ "Win64YesNo", packageAs64Bit ? "yes" : "no" }
|
||||
};
|
||||
|
||||
// NB: We need some GUIDs that are based on the package ID, but unique (i.e.
|
||||
|
||||
19
vendor/wix/template.wxs
vendored
19
vendor/wix/template.wxs
vendored
@@ -1,8 +1,9 @@
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
|
||||
<Product Id="*" Name="{{Title}} Machine-Wide Installer" Language="1033" Codepage="{{Codepage}}" Version="!(bind.FileVersion.{{Id}}.exe)" UpgradeCode="{{IdAsGuid1}}" Manufacturer="{{Author}}">
|
||||
<Product Id="*" Name="{{Title}} Deployment Tool" Language="1033" Codepage="{{Codepage}}" Version="!(bind.FileVersion.{{Id}}.exe)" UpgradeCode="{{IdAsGuid1}}" Manufacturer="{{Author}}">
|
||||
|
||||
<Package Description="#Description" Comments="Comments" InstallerVersion="200" Compressed="yes"/>
|
||||
<Media Id="1" Cabinet="contents.cab" EmbedCab="yes" CompressionLevel="high"/>
|
||||
<Package Description="This package installs a deployment tool for {{Title}}. Not {{Title}} itself. {{Title}} is only installed if a user logs into the machine." Comments="Comments" InstallerVersion="200" Compressed="yes" Platform="{{Platform}}"/>
|
||||
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A later version of this product is already installed. Setup will now exit."/>
|
||||
<Media Id="1" Cabinet="contents.cab" EmbedCab="yes" CompressionLevel="high"/>
|
||||
|
||||
<PropertyRef Id="NETFRAMEWORK45" />
|
||||
|
||||
@@ -11,21 +12,21 @@
|
||||
</Condition>
|
||||
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="ProgramFilesFolder">
|
||||
<Directory Id="APPLICATIONROOTDIRECTORY" Name="{{Title}} Installer" />
|
||||
<Directory Id="{{ProgramFilesFolder}}">
|
||||
<Directory Id="APPLICATIONROOTDIRECTORY" Name="{{Title}} Deployment" />
|
||||
</Directory>
|
||||
</Directory>
|
||||
|
||||
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
|
||||
<Component Id="{{Id}}.exe" Guid="{{IdAsGuid2}}">
|
||||
<File Id="{{Id}}.exe" Name="{{Id}}.exe" Source="./Setup.exe" KeyPath="yes" />
|
||||
<Component Id="{{Id}}.exe" Guid="{{IdAsGuid2}}" Win64="{{Win64YesNo}}">
|
||||
<File Id="{{Id}}.exe" Name="{{Id}}DeploymentTool.exe" Source="./Setup.exe" KeyPath="yes"/>
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<DirectoryRef Id="TARGETDIR">
|
||||
<Component Id="RegistryEntries" Guid="{{IdAsGuid3}}">
|
||||
<Component Id="RegistryEntries" Guid="{{IdAsGuid3}}" Win64="{{Win64YesNo}}">
|
||||
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Run">
|
||||
<RegistryValue Type="expandable" Name="{{Id}}MachineInstaller" Value="%ProgramFiles%\{{Title}} Installer\{{Id}}.exe --checkInstall" />
|
||||
<RegistryValue Type="expandable" Name="{{Id}}MachineInstaller" Value="%ProgramFiles%\{{Title}} Deployment\{{Id}}DeploymentTool.exe --checkInstall" />
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
Reference in New Issue
Block a user