File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,27 @@ Module Module1
18
18
End Function
19
19
20
20
Sub Main()
21
+ Dim serverSelection As Integer = 0
22
+ Dim serviceId As String = ""
23
+
24
+ Dim arguments As String () = Environment.GetCommandLineArgs()
25
+ If arguments.Length > 1 Then
26
+ Select Case arguments( 1 )
27
+ Case "-microsoft"
28
+ Console.WriteLine( "Microsoft Update source selected." )
29
+ serverSelection = 3
30
+ serviceId = "7971f918-a847-4430-9279-4a52d1efe18d"
31
+ End Select
32
+ End If
33
+
21
34
'https://docs.microsoft.com/en-us/windows/win32/wua_sdk/searching--downloading--and-installing-updates
22
35
Dim winUpdateSession As New UpdateSession()
23
36
winUpdateSession.ClientApplicationID = "WindowsUpdatePush"
24
37
Dim winUpdateSearcher As IUpdateSearcher = winUpdateSession.CreateUpdateSearcher()
38
+ winUpdateSearcher.ServerSelection = serverSelection
39
+ If serviceId <> "" Then
40
+ winUpdateSearcher.ServiceID = serviceId
41
+ End If
25
42
26
43
Try
27
44
Console.WriteLine( "Checking for updates..." )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Imports System.Runtime.InteropServices
12
12
< Assembly : AssemblyDescription( "" )>
13
13
< Assembly : AssemblyCompany( "Jacob Weisz" )>
14
14
< Assembly : AssemblyProduct( "WindowsUpdatePush" )>
15
- < Assembly : AssemblyCopyright( "Copyright © 2019-2021 Jacob Weisz" )>
15
+ < Assembly : AssemblyCopyright( "Copyright © 2019-2022 Jacob Weisz" )>
16
16
< Assembly : AssemblyTrademark( "" )>
17
17
18
18
< Assembly : ComVisible( False )>
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
31
31
' by using the '*' as shown below:
32
32
' <Assembly: AssemblyVersion("1.0.*")>
33
33
34
- < Assembly : AssemblyVersion( "1.0.0.2 " )>
35
- < Assembly : AssemblyFileVersion( "1.0.0.2 " )>
34
+ < Assembly : AssemblyVersion( "1.0.0.3 " )>
35
+ < Assembly : AssemblyFileVersion( "1.0.0.3 " )>
You can’t perform that action at this time.
0 commit comments