From 1e88d8812e1f1c55d7e5faebe3de6060ad0a82fa Mon Sep 17 00:00:00 2001 From: Muhammad Danish <88161975+mdanish-kh@users.noreply.github.com> Date: Sat, 7 Dec 2024 18:02:22 +0500 Subject: [PATCH] Prompt for zipped binaries in NewCommand flow --- src/WingetCreateCLI/Commands/NewCommand.cs | 11 ++++++++--- src/WingetCreateCLI/Properties/Resources.Designer.cs | 9 +++++++++ src/WingetCreateCLI/Properties/Resources.resx | 3 +++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/WingetCreateCLI/Commands/NewCommand.cs b/src/WingetCreateCLI/Commands/NewCommand.cs index 169ff5e7..06259ad6 100644 --- a/src/WingetCreateCLI/Commands/NewCommand.cs +++ b/src/WingetCreateCLI/Commands/NewCommand.cs @@ -386,8 +386,7 @@ private static void PromptInstallerProperties(T manifest, PropertyInfo proper } } - PromptForPortableAliasIfApplicable(installer); - + PromptForPortableFieldsIfApplicable(installer); foreach (var requiredProperty in requiredInstallerProperties) { var currentValue = requiredProperty.GetValue(installer); @@ -447,7 +446,7 @@ private static void PromptInstallerSwitchesForExe(T manifestInstaller) } } - private static void PromptForPortableAliasIfApplicable(Installer installer) + private static void PromptForPortableFieldsIfApplicable(Installer installer) { if (installer.InstallerType == InstallerType.Portable) { @@ -468,6 +467,12 @@ private static void PromptForPortableAliasIfApplicable(Installer installer) { installer.NestedInstallerFiles.First().PortableCommandAlias = portableCommandAlias.Trim(); } + + // No need to set explicitly in else case as WinGet CLI defaults to using false + if (Prompt.Confirm(Resources.ConfirmZippedBinary_Message)) + { + installer.ArchiveBinariesDependOnPath = true; + } } } diff --git a/src/WingetCreateCLI/Properties/Resources.Designer.cs b/src/WingetCreateCLI/Properties/Resources.Designer.cs index 5010840b..5e7fb4b1 100644 --- a/src/WingetCreateCLI/Properties/Resources.Designer.cs +++ b/src/WingetCreateCLI/Properties/Resources.Designer.cs @@ -393,6 +393,15 @@ public static string ConfirmPortablePackage_Message { } } + /// + /// Looks up a localized string similar to Does this executable depend on DLLs or any other files present in the zip archive?. + /// + public static string ConfirmZippedBinary_Message { + get { + return ResourceManager.GetString("ConfirmZippedBinary_Message", resourceCulture); + } + } + /// /// Looks up a localized string similar to The package copyright. /// diff --git a/src/WingetCreateCLI/Properties/Resources.resx b/src/WingetCreateCLI/Properties/Resources.resx index 65f945fc..c1faa830 100644 --- a/src/WingetCreateCLI/Properties/Resources.resx +++ b/src/WingetCreateCLI/Properties/Resources.resx @@ -1392,4 +1392,7 @@ Indicates whether the install location should be added directly to the PATH environment variable. Only applies to an archive containing portable packages. + + Does this executable depend on DLLs or any other files present in the zip archive? + \ No newline at end of file