Imports System.IO Public Class SYS_UPDATE ReadOnly ds2 As New DataSet Private Sub SYS_UPDATE_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim pProcess1() As Process = System.Diagnostics.Process.GetProcessesByName("HSKIN-MIS-SYS.exe") For Each p As Process In pProcess1 : p.Kill() : Next Dim Strs As String = Application.StartupPath : 資料數 = 104 Target = "https://gcm-smart.com/ERP/HSKIN/" End Sub Private Sub SYS_UPDATE_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown 計算分流.Enabled = True End Sub Private Sub 計算分流_Tick(sender As Object, e As EventArgs) Handles 計算分流.Tick 計算分流.Enabled = False MyModule1.進度條() : Delay(30000) MyModule1.進度條() : Dim Str As String = Application.StartupPath : Dim FS As String '---------------------------------使用網頁插件------------------------------------------------------------------------ MyModule1.進度條() : FS = "CefSharp.BrowserSubprocess.Core.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.BrowserSubprocess.Core.pdb" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.BrowserSubprocess.exe" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.BrowserSubprocess.pdb" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.Core.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.Core.pdb" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.Core.Runtime.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.Core.Runtime.pdb" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.Core.Runtime.xml" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.Core.xml" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.pdb" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.WinForms.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.WinForms.pdb" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.WinForms.xml" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "CefSharp.xml" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "chrome_100_percent.pak" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "chrome_200_percent.pak" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "chrome_elf.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "d3dcompiler_47.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "icudtl.dat" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "libcef.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "libEGL.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "libGLESv2.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "resources.pak" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "snapshot_blob.bin" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "v8_context_snapshot.bin" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "vk_swiftshader.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "vk_swiftshader_icd.json" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "vulkan-1.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "DotNetBarcode.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : If Dir(Str + "\locales", vbDirectory) <> "" Then : Else : MkDir(Str + "\locales") : End If MyModule1.進度條() : FS = "af.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "am.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "ar.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "bg.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "bn.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "ca.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "cs.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "da.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "de.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "el.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "en-GB.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "en-US.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "es.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "es-419.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "et.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "fa.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "fi.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "fil.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "fr.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "gu.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "he.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "hi.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "hr.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "hu.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "id.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "it.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "ja.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "kn.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "ko.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "lt.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "lv.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "ml.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "mr.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "ms.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "nb.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "nl.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "pl.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "pt-BR.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "pt-PT.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "ro.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "ru.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "sk.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "sl.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "sr.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "sv.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "sw.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "ta.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "te.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "th.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "tr.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "uk.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "ur.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "vi.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "zh-CN.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If MyModule1.進度條() : FS = "zh-TW.pak" : If IO.File.Exists(Str & "\locales\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & "/locales/" & FS, Str & "\locales\" & FS) : End If '---------------------------------使用Telerik插件------------------------------------------------------------------------ MyModule1.進度條() : FS = "Telerik.WinControls.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "Telerik.WinControls.PdfViewer.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "Telerik.WinControls.PdfViewer.xml" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "Telerik.WinControls.UI.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "Telerik.WinControls.UI.xml" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "Telerik.WinControls.xml" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "Telerik.Windows.Documents.Core.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "Telerik.Windows.Documents.Core.xml" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "Telerik.Windows.Documents.Fixed.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "Telerik.Windows.Documents.Fixed.xml" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "Telerik.Windows.Zip.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "Telerik.Windows.Zip.xml" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If MyModule1.進度條() : FS = "TelerikCommon.dll" : If IO.File.Exists(Str & "\" & FS) Then : Else : My.Computer.Network.DownloadFile(Target & FS, Str & "\" & FS) : End If '---------------------------------主程式下載------------------------------------------------------------------------ MyModule1.進度條() : If File.Exists(Str + "\HSKIN-MIS-SYS.exe") Then : File.Delete(Str + "\HSKIN-MIS-SYS.exe") : End If MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & "HSKIN-MIS-SYS.exe", Str + "\HSKIN-MIS-SYS.exe") MyModule1.進度條() : Shell(Str + "\HSKIN-MIS-SYS.exe", vbNormalFocus) Me.Close() End Sub Public Sub Delay(ByRef Interval As Double) 'Interval单位为毫秒 Dim time As DateTime = DateTime.Now Dim Span As Double = Interval * 1234 While ((DateTime.Now.Ticks - time.Ticks) < Span) Application.DoEvents() End While End Sub End Class