Skip to content

Commit

Permalink
Prompt for zipped binaries in NewCommand flow (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanish-kh authored Dec 10, 2024
1 parent 94c5d21 commit 6926ca4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/WingetCreateCLI/Commands/NewCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,7 @@ private static void PromptInstallerProperties<T>(T manifest, PropertyInfo proper
}
}

PromptForPortableAliasIfApplicable(installer);

PromptForPortableFieldsIfApplicable(installer);
foreach (var requiredProperty in requiredInstallerProperties)
{
var currentValue = requiredProperty.GetValue(installer);
Expand Down Expand Up @@ -447,7 +446,7 @@ private static void PromptInstallerSwitchesForExe<T>(T manifestInstaller)
}
}

private static void PromptForPortableAliasIfApplicable(Installer installer)
private static void PromptForPortableFieldsIfApplicable(Installer installer)
{
if (installer.InstallerType == InstallerType.Portable)
{
Expand All @@ -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;
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/WingetCreateCLI/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/WingetCreateCLI/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,7 @@
<data name="ArchiveBinariesDependOnPath_KeywordDescription" xml:space="preserve">
<value>Indicates whether the install location should be added directly to the PATH environment variable. Only applies to an archive containing portable packages.</value>
</data>
<data name="ConfirmZippedBinary_Message" xml:space="preserve">
<value>Does this executable depend on DLLs or any other files present in the zip archive?</value>
</data>
</root>

0 comments on commit 6926ca4

Please sign in to comment.