Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add index prefix to installer menu item #169

Merged
merged 2 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/WingetCreateCLI/Commands/NewCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private static void DisplayInstallersAsMenuSelection(InstallerManifest installer
private static List<string> GenerateInstallerSelectionList(List<Installer> installers, out Dictionary<string, Installer> installerSelectionMap)
{
installerSelectionMap = new Dictionary<string, Installer>();

int index = 1;
foreach (Installer installer in installers)
{
var installerTuple = string.Join(" | ", new[]
Expand All @@ -307,7 +307,9 @@ private static List<string> GenerateInstallerSelectionList(List<Installer> insta
installer.InstallerUrl,
}.Where(s => !string.IsNullOrEmpty(s)));

installerSelectionMap.Add(installerTuple, installer);
var installerMenuItem = string.Format(Resources.InstallerSelection_MenuItem, index, installerTuple);
installerSelectionMap.Add(installerMenuItem, installer);
index++;
}

List<string> selectionList = new List<string>() { Resources.AllInstallers_MenuItem };
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.

5 changes: 5 additions & 0 deletions src/WingetCreateCLI/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -769,4 +769,9 @@
<data name="DefenderVirus_ErrorMessage" xml:space="preserve">
<value>Operation did not complete successfully because the downloaded file contains a virus or potentially unwanted software. For more information on potentially unwanted software and what options are available, see https://aka.ms/winget-create-security</value>
</data>
<data name="InstallerSelection_MenuItem" xml:space="preserve">
<value>INSTALLER {0}: {1}</value>
<comment>{0} - represents the installer index number
{1} - represents the associated installer metadata</comment>
</data>
</root>