123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- Imports System.IO
- Public Class SYS_UPDATE
- ReadOnly ds2 As New DataSet
- Dim 號1, 號2, 號3, 號4, 號5, fileReader, FS3 As String
- Dim Auto_B, Verify_B As Boolean
- Dim timeNow1, timeNow2 As Integer
- Dim Str As String = Application.StartupPath
- Dim 標 As String = "SYS-UPDATE........"
- Private Sub OK_Tick(sender As Object, e As EventArgs) Handles OK.Tick
- Dim 已開啟 As Boolean = False
- Dim Strs As String = Application.StartupPath
- If File.Exists(My.Computer.FileSystem.SpecialDirectories.Desktop & "\GA-ERP-SYS.exe") Then
- Dim pro() As Process = System.Diagnostics.Process.GetProcesses()
- ' 判斷是否有符合的Process
- For Each process As Process In pro
- If ("GA-ERP-SYS").Equals(process.ProcessName) Then : 已開啟 = True : End If
- Next
- If 已開啟 = False Then
- OK.Enabled = False : MyModule1.進度條() : Shell(Strs + "\GA-ERP-SYS.exe", vbNormalFocus) : Me.Close()
- End If
- ElseIf File.Exists(Strs & "\GA-ERP-SYS.exe") Then
- Dim pro() As Process = System.Diagnostics.Process.GetProcesses()
- ' 判斷是否有符合的Process
- For Each process As Process In pro
- If ("GA-ERP-SYS").Equals(process.ProcessName) Then : 已開啟 = True : End If
- Next
- If 已開啟 = False Then
- OK.Enabled = False : MyModule1.進度條() : Shell(Strs + "\GA-ERP-SYS.exe", vbNormalFocus) : Me.Close()
- End If
- End If
- End Sub
- Private Sub SYS_UPDATE_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- 資料數 = 131 : timeNow1 = 3
- End Sub
- Private Sub SYS_UPDATE_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
- Target = "https://gcm-smart.com/ERP/GA-ERP/"
- Timer1.Enabled = True
- End Sub
- Private Sub 更新路徑01()
- Me.Text = 標 & FS3 : My.Computer.Network.DownloadFile(Target & FS3, Str & "\" & FS3)
- End Sub
- Private Sub 更新路徑02()
- Me.Text = 標 & FS3 : My.Computer.Network.DownloadFile(Target & "DawnCache/" & FS3, Str & "\DawnCache\" & FS3)
- End Sub
- Private Sub 更新路徑03()
- Me.Text = 標 & FS3 : My.Computer.Network.DownloadFile(Target & "GPUCache/" & FS3, Str & "\GPUCache\" & FS3)
- End Sub
- Private Sub 更新路徑04()
- Me.Text = 標 & FS3 : My.Computer.Network.DownloadFile(Target & "locales/" & FS3, Str & "\locales\" & FS3)
- End Sub
- Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
- Timer1.Enabled = False
- MyModule1.進度條() : Dim Str As String = Application.StartupPath
- If (fileReader = 號1 Or fileReader = 號2 Or fileReader = 號3 Or fileReader = 號4 Or fileReader = 號5) And fileReader <> "" Then
- '------------------------------------------系統主體---------------------------------------------------------------------------------
- MyModule1.進度條() : Me.Text = "SYS-UPDATE........GA-ERP-SYS.exe"
- Else
- '------------------------------------------系統主體---------------------------------------------------------------------------------
- MyModule1.進度條() : Me.Text = "SYS-UPDATE........GA-ERP-SYS.exe"
- If Verify_B = True Then : FS3 = "Verify.exe" : MyModule1.進度條() : If File.Exists(Str + "\Verify.exe") Then : File.Delete(Str + "\Verify.exe") : End If : 更新路徑01() : End If
- If Auto_B = True Then : FS3 = "Auto.exe" : MyModule1.進度條() : If File.Exists(Str + "\Auto.exe") Then : File.Delete(Str + "\Auto.exe") : End If : 更新路徑01() : End If
- End If
- FS3 = "CefSharp.BrowserSubprocess.Core.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.BrowserSubprocess.Core.pdb" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.BrowserSubprocess.exe" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.BrowserSubprocess.pdb" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.Core.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.Core.pdb" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.Core.Runtime.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.Core.Runtime.pdb" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.Core.Runtime.xml" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.Core.xml" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.pdb" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.WinForms.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.WinForms.pdb" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.WinForms.xml" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "CefSharp.xml" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "chrome_100_percent.pak" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "chrome_200_percent.pak" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "chrome_elf.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "d3dcompiler_47.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "debug.log" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "DocumentFormat.OpenXml.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "DocumentFormat.OpenXml.xml" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "GA-ERP-SYS.exe.config" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "GA-ERP-SYS.pdb" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "GA-ERP-SYS.xml" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "icudtl.dat" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "Interop.VSTOEE100.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "itextsharp.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "libcef.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "libEGL.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "libGLESv2.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "LICENSE.txt" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "Microsoft.IO.RecyclableMemoryStream.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "Microsoft.IO.RecyclableMemoryStream.xml" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "README.txt" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "resources.pak" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "snapshot_blob.bin" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "v8_context_snapshot.bin" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "vk_swiftshader.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "vk_swiftshader_icd.json" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- FS3 = "vulkan-1.dll" : MyModule1.進度條() : If File.Exists(Str & "\" & FS3) Then : Else : 更新路徑01() : End If
- '---------------------------------------------------------------------------------------------------------------------------------------------------
- MyModule1.進度條() : If Dir(Str + "\DawnCache", vbDirectory) <> "" Then : Else : MkDir(Str + "\DawnCache") : End If
- FS3 = "data_0" : MyModule1.進度條() : If File.Exists(Str & "\DawnCache\" & FS3) Then : Else : 更新路徑02() : End If
- FS3 = "data_1" : MyModule1.進度條() : If File.Exists(Str & "\DawnCache\" & FS3) Then : Else : 更新路徑02() : End If
- FS3 = "data_2" : MyModule1.進度條() : If File.Exists(Str & "\DawnCache\" & FS3) Then : Else : 更新路徑02() : End If
- FS3 = "data_3" : MyModule1.進度條() : If File.Exists(Str & "\DawnCache\" & FS3) Then : Else : 更新路徑02() : End If
- FS3 = "index" : MyModule1.進度條() : If File.Exists(Str & "\DawnCache\" & FS3) Then : Else : 更新路徑02() : End If
- '---------------------------------------------------------------------------------------------------------------------------------------------------
- MyModule1.進度條() : If Dir(Str + "\GPUCache", vbDirectory) <> "" Then : Else : MkDir(Str + "\GPUCache") : End If
- FS3 = "data_0" : MyModule1.進度條() : If File.Exists(Str & "\GPUCache\" & FS3) Then : Else : 更新路徑03() : End If
- FS3 = "data_1" : MyModule1.進度條() : If File.Exists(Str & "\GPUCache\" & FS3) Then : Else : 更新路徑03() : End If
- FS3 = "data_2" : MyModule1.進度條() : If File.Exists(Str & "\GPUCache\" & FS3) Then : Else : 更新路徑03() : End If
- FS3 = "data_3" : MyModule1.進度條() : If File.Exists(Str & "\GPUCache\" & FS3) Then : Else : 更新路徑03() : End If
- FS3 = "index" : MyModule1.進度條() : If File.Exists(Str & "\GPUCache\" & FS3) Then : Else : 更新路徑03() : End If
- '---------------------------------------------------------------------------------------------------------------------------------------------------
- MyModule1.進度條() : If Dir(Str + "\locales", vbDirectory) <> "" Then : Else : MkDir(Str + "\locales") : End If
- FS3 = "af.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "am.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "ar.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "bg.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "bn.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "ca.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "cs.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "da.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "de.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "el.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "en-GB.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "en-US.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "es-419.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "es.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "et.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "fa.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "fi.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "fil.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "fr.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "gu.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "he.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "hi.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "hr.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "hu.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "id.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "it.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "ja.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "kn.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "ko.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "lt.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "lv.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "ml.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "mr.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "ms.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "nb.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "nl.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "pl.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "pt-BR.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "pt-PT.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "ro.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "ru.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "sk.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "sl.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "sr.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "sv.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "sw.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "ta.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "te.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "th.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "tr.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "uk.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "ur.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "vi.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "zh-CN.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- FS3 = "zh-TW.pak" : MyModule1.進度條() : If File.Exists(Str & "\locales\" & FS3) Then : Else : 更新路徑04() : End If
- Timer3.Enabled = True
- End Sub
- Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
- Dim 已開啟 As Boolean = False
- Dim Strs As String = Application.StartupPath
- If File.Exists(My.Computer.FileSystem.SpecialDirectories.Desktop & "\GA-ERP-SYS.exe") Then
- Dim pro() As Process = System.Diagnostics.Process.GetProcesses()
- ' 判斷是否有符合的Process
- For Each process As Process In pro
- If ("GA-ERP-SYS").Equals(process.ProcessName) Then
- 已開啟 = True
- End If
- Next
- If 已開啟 = False Then
- Timer3.Enabled = False
- If File.Exists(Str + "\GA-ERP-SYS.exe") Then : File.Delete(Str + "\GA-ERP-SYS.exe") : End If
- MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & "GA-ERP-SYS.exe", Str + "\GA-ERP-SYS.exe")
- OK.Enabled = True
- End If
- ElseIf File.Exists(Strs & "\GA-ERP-SYS.exe") Then
- Dim pro() As Process = System.Diagnostics.Process.GetProcesses()
- ' 判斷是否有符合的Process
- For Each process As Process In pro
- If ("GA-ERP-SYS").Equals(process.ProcessName) Then
- 已開啟 = True
- End If
- Next
- If 已開啟 = False Then
- Timer3.Enabled = False
- If File.Exists(Str + "\GA-ERP-SYS.exe") Then : File.Delete(Str + "\GA-ERP-SYS.exe") : End If
- MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & "GA-ERP-SYS.exe", Str + "\GA-ERP-SYS.exe")
- OK.Enabled = True
- End If
- End If
- 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
|