BarryG wrote: Tue Mar 04, 2025 10:06 pm
It might be, but we don't have your full snippet to see.
Can't finish until I can get full output from WinGet cmdlet so this is a work in progress:
Code: Select all
;WingetUpdater written by Randy Walker with no promises -- run at your own risk (02/26/2025)
Dim prog$(250)
Dim update$(250,2)
If OpenWindow(0, 0, 0, 322, 450, "WinGet Application Updater", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(0, 8, 8, 306, 433)
SetGadgetText(0,"Please wait while we perform a search . . .")
AddGadgetItem(0, -1, "")
AddGadgetItem(0, -1, " NAME Update Ver Current Ver")
;Exe = RunProgram("powershell.exe","winget upgrade YourAppHer","",#PB_Program_Open)
;Uncomment line above, comment line below and change YourAppHer with name of your preference from list in main window
Exe = RunProgram("powershell.exe","winget list","",#PB_Program_Hide|#PB_Program_Open|#PB_Program_Read|#PB_Program_Error)
If Exe
While ProgramRunning(Exe)
WindowEvent()
If AvailableProgramOutput(Exe)
Output$=ReadProgramString(Exe)
error$ = ReadProgramError(Exe)
name$ = StringField(Output$,1," ")
If FindString(Output$,"|") = 0
If FindString(Output$,"----") = 0
n + 1
prog$(n) = RTrim(Output$)
EndIf
EndIf
Debug Output$ ; comment this line to see no error line output
If error$
Debug error$
EndIf
EndIf
Wend
CloseProgram(exe)
EndIf
For z = 1 To n
s$ = Trim(Mid(prog$(z),102,12)) ; test for new version
If s$
update$(z,0) = RTrim(Mid(prog$(z),1,41)) ;NAME
update$(z,1) = s$ ;NEW VERSION
update$(z,2) = RTrim(Mid(prog$(z),83,19)) ;CURRENT VERSION
;Debug update$(z,0) + " " + update$(z,1) + " " + update$(z,2)
AddGadgetItem(0, -1, update$(z,0) + " " + update$(z,1) + " " + update$(z,2))
EndIf
WindowEvent()
s$ = ""
Next z
; more processng follows here but not required to see results from above.
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf