feat(tools): add pack-installer command
Appends a TPK1 payload to Titano.Setup.exe from repeatable --component Id=folder options, as release.yml invokes it. Known components (Titano, Uploader, Server) get display names, default selection, Start menu/desktop shortcuts and the .titano file type; prints file count and sizes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
3 files changed
+112
-2
No files matched your search
@@ -100,7 +100,7 @@ public static class PayloadWriter
|
||||
var root = Path.TrimEndingDirectorySeparator(Path.GetFullPath(component.Folder));
|
||||
if (!Directory.Exists(root)) throw new DirectoryNotFoundException($"Component folder '{component.Folder}' does not exist.");
|
||||
if (output.StartsWith(root + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))
|
||||
throw new ArgumentException($"The installer cannot be written inside the component folder '{component.Folder}'.", nameof(output));
|
||||
throw new ArgumentException($"The installer cannot be written inside the component folder '{component.Folder}'.");
|
||||
inputs.AddRange(Directory.EnumerateFiles(root, "*", options)
|
||||
.Select(f => new Input(component.Id, PayloadPath.FromRelative(Path.GetRelativePath(root, f)), f))
|
||||
.OrderBy(i => i.Path, StringComparer.Ordinal));
|
||||
@@ -189,7 +189,7 @@ public static class PayloadWriter
|
||||
{
|
||||
using (var stub = new FileStream(stubPath, FileMode.Open, FileAccess.Read, FileShare.Read, BufferSize))
|
||||
{
|
||||
if (PayloadReader.HasFooter(stub)) throw new ArgumentException($"'{stubPath}' already carries a payload; use the plain setup program.", nameof(stubPath));
|
||||
if (PayloadReader.HasFooter(stub)) throw new ArgumentException($"'{stubPath}' already carries a payload; use the plain setup program.");
|
||||
var buffer = ArrayPool<byte>.Shared.Rent(BufferSize);
|
||||
try
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user