-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathupdater.frm
288 lines (254 loc) · 8.6 KB
/
updater.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "ieframe.dll"
Begin VB.Form updater
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "Winunciator Auto Updater"
ClientHeight = 4335
ClientLeft = 60
ClientTop = 450
ClientWidth = 4980
ControlBox = 0 'False
FillStyle = 0 'Solid
Icon = "updater.frx":0000
LinkTopic = "Form1"
ScaleHeight = 4335
ScaleWidth = 4980
StartUpPosition = 3 'Windows Default
Begin InetCtlsObjects.Inet Inet1
Left = 2190
Top = 3300
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
Protocol = 4
RemoteHost = "colsolgrp.com"
URL = "http://colsolgrp.com/rss/winunciator.txt"
Document = "/rss/winunciator.txt"
End
Begin SHDocVwCtl.WebBrowser WebBrowser1
Height = 975
Left = 180
TabIndex = 5
Top = 3210
Width = 1695
ExtentX = 2990
ExtentY = 1720
ViewMode = 0
Offline = 0
Silent = 0
RegisterAsBrowser= 0
RegisterAsDropTarget= 1
AutoArrange = 0 'False
NoClientEdge = 0 'False
AlignLeft = 0 'False
NoWebView = 0 'False
HideFileNames = 0 'False
SingleClick = 0 'False
SingleSelection = 0 'False
NoFolders = 0 'False
Transparent = 0 'False
ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
Location = ""
End
Begin VB.TextBox response
Height = 1695
Left = 120
TabIndex = 4
Text = "Text1"
Top = 1290
Width = 4005
End
Begin MSWinsockLib.Winsock tcpclient
Left = 4320
Top = 600
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
Begin VB.CommandButton Cancel
Caption = "&Cancel"
Height = 315
Left = 3390
TabIndex = 2
Top = 930
Width = 915
End
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 255
Left = 60
TabIndex = 1
Top = 570
Width = 4275
_ExtentX = 7541
_ExtentY = 450
_Version = 393216
BorderStyle = 1
Appearance = 0
Scrolling = 1
End
Begin VB.Label statusreport
BackStyle = 0 'Transparent
Caption = "Status"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 30
TabIndex = 3
Top = 900
Width = 3285
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Checking for updates."
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 0
Top = 120
Width = 4185
End
End
Attribute VB_Name = "updater"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim WithEvents voice As SpVoice
Attribute voice.VB_VarHelpID = -1
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Dim mon As String
''''''''''''''''''''''''
''' CLIENT FUNCTIONS '''
''''''''''''''''''''''''
Private Sub cmdClientConnect_Click()
End Sub
Private Sub cmdClientDisconnect_Click()
tcpclient.Close
AddClientHistory "Disconnected"
End Sub
Private Sub txtClientToSend_Change()
If txtClientToSend.Text <> "" Then ' if there's something entered
If tcpclient.State = sckConnected Then
tcpclient.SendData txtClientToSend.Text
AddClientHistory txtClientToSend.Text
Else
AddClientHistory "Not Connected"
End If
txtClientToSend.Text = ""
End If
End Sub
Private Sub Cancel_Click()
'Shell ("winunciator.exe")
End
End Sub
Private Sub tcpClient_Close()
tcpconnect = False
If Winunciator.Debugcheck.Value = 1 Then logit ("socket closed")
End Sub
Private Sub tcpClient_Connect()
tcpconnect = True
If Winunciator.Debugcheck.Value = 1 Then logit ("socket connected to " & tcpclient.RemoteHostIP & ":" & tcpclient.RemotePort)
End Sub
Private Sub tcpClient_DataArrival(ByVal bytesTotal As Long)
Dim val As String
' tcpclient.GetData val
Dim strResponse As String
tcpclient.GetData strResponse, vbString, bytesTotal
strResponse = FormatLineEndings(strResponse)
' we append this to the response box becuase data arrives
' in multiple packets
response.Text = response.Text & strResponse
If Winunciator.Debugcheck.Value = 1 Then logit ("Arrival: socket: " & val)
End Sub
Private Sub tcpClient_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
If Winunciator.Debugcheck.Value = 1 Then logit ("socket error: " & Source & ":" & Description)
End Sub
Private Function AddClientHistory(val As String)
If Winunciator.Debugcheck.Value = 1 Then logit (val) ' limit us to 2000 lines, otherwise it grows out of control
End Function
Private Sub Form_Load()
ProgressBar1.Value = 0
updater.Show
Pause (0.5)
If Winunciator.Debugcheck.Value = 1 Then logit ("Preparing for Possible Update.")
statusreport.Caption = "Preparing for Possible Update."
ProgressBar1.Value = 5
updater.Refresh
Pause (0.5)
If tcpclient.State <> sckClosed Then
tcpclient.Close
End If
tcpclient.RemoteHost = "colsolgrp.com"
tcpclient.RemotePort = 80 ' what to connect to
If Winunciator.Debugcheck.Value = 1 Then logit ("Connecting to Update Server.")
statusreport.Caption = "Connecting to Update Server."
ProgressBar1.Value = 10
updater.Refresh
tcpclient.Connect
While Not tcpclient.State = sckConnected
DoEvents
Wend
' Pause (4.1)
' While tcpclient.State = sckConnected
'If tcpclient.State = sckConnected Then
tcpclient.SendData "GET /rss/winunciator.txt HTTP/1.1" & vbCrLf & "Host:colsolgrp.com:80" & vbCrLf
If Winunciator.Debugcheck.Value = 1 Then logit ("get http://colsolgrp.com/rss/winunciator.txt")
'End If
' Pause (2.1)
'tcpclient.SendData "GET /rss/winunciator.txt HTTP/1.1" & vbCrLf & "Host: www.colsolgrp.com" & vbCrLf
' Wend
' Next step is to oGET THE PAGE
End Sub
' this function converts all line endings to Windows CrLf line endings
Private Function FormatLineEndings(ByVal str As String) As String
Dim prevChar As String
Dim nextChar As String
Dim curChar As String
Dim strRet As String
Dim X As Long
prevChar = ""
nextChar = ""
curChar = ""
strRet = ""
For X = 1 To Len(str)
prevChar = curChar
curChar = Mid$(str, X, 1)
If nextChar <> vbNullString And curChar <> nextChar Then
curChar = curChar & nextChar
nextChar = ""
ElseIf curChar = vbLf Then
If prevChar <> vbCr Then
curChar = vbCrLf
End If
nextChar = ""
ElseIf curChar = vbCr Then
nextChar = vbLf
End If
strRet = strRet & curChar
Next X
FormatLineEndings = strRet
End Function
Private Sub geturl()
Info = Inet2.OpenURL(StrUrl)
End Sub
Info = Inet2.OpenURL(StrUrl)