Skip to content

Commit

Permalink
add installer index prefix to menu item (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryfu-msft authored Sep 15, 2021
1 parent a1dfc35 commit f4af949
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
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>

0 comments on commit f4af949

Please sign in to comment.