From 7dd905b6ef4b0e054b15105d1f80e09359d15138 Mon Sep 17 00:00:00 2001 From: Drew Naylor Date: Sat, 24 Oct 2020 22:16:37 -0400 Subject: [PATCH] Fixed the code for getting the packages. Wasn't quite sure how to do it before, but I figured it out. --- libguinget/PackageTools.vb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libguinget/PackageTools.vb b/libguinget/PackageTools.vb index 1647e55e..83040010 100644 --- a/libguinget/PackageTools.vb +++ b/libguinget/PackageTools.vb @@ -71,13 +71,11 @@ Public Class PackageTools ' Define CMD args by going through the list of packages. ' Be sure to only add && if there are packages left to add. - Dim BulkInstallCommandList As String = "/k " - For Each Package As String In PackageIDs - For Each Version As String In PackageVersions - ' Begin adding packages to the list. - BulkInstallCommandList = "winget install --id " & Package & " -v " & Version & InteractiveFlag & " -e" - ' - Next + Dim BulkInstallCommandList As String = String.Empty + For i As Integer = 0 To PackageIDs.Count - 1 + ' Begin adding packages to the list. + BulkInstallCommandList = BulkInstallCommandList & "winget install --id " & PackageIDs(i) & " -v " & PackageVersions(i) & InteractiveFlag & " -e" + ' Next MessageBox.Show(BulkInstallCommandList.ToString)