MsgBox("Une mise à jour est disponible, elle va être téléchgargée.", MsgBoxStyle.Information)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionImports System.Xml.XPath Imports ICSharpCode.SharpZipLib.Zip Imports System.IO Public Class Form1 Dim Url_MàJ As String = "http://www.vexome.fr/Launcher/dofus/Mylaise/Update.zip" Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing IO.File.Delete("Version.xml") IO.File.Delete("Update.zip") End End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load My.Computer.Network.DownloadFile("http://www.vexome.fr/Launcher/dofus/Mylaise/text.txt", ("text.txt")) Dim up As New System.IO.StreamReader("text.txt") Label8.Text = up.ReadToEnd up.Close() Kill("text.txt") If IO.File.Exists("Loader.swf") Then My.Computer.Network.DownloadFile("http://www.vexome.fr/Launcher/dofus/Mylaise/Version.xml", "Version.xml") Else MsgBox("<Erreur> : Veuillez placez l'upluncher dans le dossier dofus", MsgBoxStyle.Critical) End End If If IO.File.Exists("ICSharpCode.SharpZipLib.dll") Then Else My.Computer.Network.DownloadFile("http://www.vexome.fr/Launcher/dofus/Mylaise/ICSharpCode.SharpZipLib.dll", "ICSharpCode.SharpZipLib.dll") End If Dim Files As XPathDocument = New XPathDocument("Version.xml") Dim Navigateur As XPathNavigator = Files.CreateNavigator Dim Choose As XPathNodeIterator = Navigateur.Select("Config/Maj") While Choose.MoveNext Label6.Text = Choose.Current.SelectSingleNode("Ancienne").Value Label5.Text = Choose.Current.SelectSingleNode("Nouvelle").Value If Label6.Text >= Label5.Text Then MsgBox(" : Mise à Jour indisponible.") Else MsgBox(" : Mise à Jour disponible.") End If End While End Sub Sub Main() UnZip("", "Update.zip") End Sub Public Sub UnZip(ByVal destinationDirectory As String, ByVal myzipfile As String) Timer1.Start() Label1.Text = "Début de la mise à jour." Dim Un As ZipInputStream = New ZipInputStream(File.OpenRead(myzipfile)) Dim Go As ZipEntry Do While (1) Go = Un.GetNextEntry() If Go Is Nothing Then Exit Do If Go.IsFile Then Dim Files As New FileInfo(destinationDirectory & "" & Go.Name) Directory.CreateDirectory(Files.DirectoryName) Dim Full As FileStream = New FileStream(Files.FullName, FileMode.Create) Dim Size As Integer = 2048 Dim Data As Byte() = New Byte(Size) {} ListBox1.Items.Add(Files) Do Until (Size <= 0) Size = Un.Read(Data, 0, Data.Length) Full.Write(Data, 0, Size) ListBox1.Items.Add(Files) Loop Full.Flush() Full.Close() End If Loop Un.Close() MsgBox("Mise à jour terminé !") Label1.Text = "Fin de la mise à jour." Button2.Enabled = False Button1.Enabled = True WebBrowser1.Visible = True ListBox1.Visible = False End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click WebBrowser1.Visible = False ListBox1.Visible = True My.Computer.Network.DownloadFile(Url_MàJ, "Update.zip") Main() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If Me.ProgressBar1.Value = 100 Then Me.Timer1.Enabled = False Me.Button1.Enabled = True Else Me.ProgressBar1.Value = Me.ProgressBar1.Value + 1 End If End Sub #Region "Mouse Move Form" Dim doDrag As Boolean Dim x As Integer Dim y As Integer Private Sub Accueil_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown doDrag = True x = Windows.Forms.Cursor.Position.X - Me.Left y = Windows.Forms.Cursor.Position.Y - Me.Top Me.Cursor = Cursors.NoMove2D End Sub Private Sub Accueil_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove If doDrag = True Then Me.Top = Windows.Forms.Cursor.Position.Y - y Me.Left = Windows.Forms.Cursor.Position.X - x Me.Cursor = Cursors.NoMove2D End If End Sub Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp doDrag = False Me.Cursor = Cursors.Default End Sub #End Region End Class
Imports ICSharpCode.SharpZipLib.Zip Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.exe", TextBox1.Text & " " & TextBox2.Text & " serveur.vexome.fr") End End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click MsgBox("Avez-vous pensé à fermer minecraft ? Veuillez attendre le message de confirmation de la mise à jour.", MsgBoxStyle.Exclamation) Timer1.Start() Button1.Enabled = False Button2.Enabled = False Button3.Enabled = False Label1.Visible = False Label2.Visible = False ProgressBar1.Visible = True If System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\mVexome.txt") = True Then Kill(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\mVexome.txt") Kill(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.jar") Kill(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.exe") My.Computer.Network.DownloadFile("http://www.vexome.fr/Launcher/minecraft/vexome/officiel/mVexome.txt", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\mVexome.txt") My.Computer.Network.DownloadFile("http://www.vexome.fr/Launcher/minecraft/vexome/officiel/minecraft.jar", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.jar") My.Computer.Network.DownloadFile("https://s3.amazonaws.com/MinecraftDownload/launcher/Minecraft.exe", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.exe") ElseIf System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\mVexome.txt") = False Then Kill(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.jar") My.Computer.Network.DownloadFile("http://www.vexome.fr/Launcher/minecraft/vexome/officiel/mVexome.txt", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\mVexome.txt") My.Computer.Network.DownloadFile("http://www.vexome.fr/Launcher/minecraft/vexome/officiel/minecraft.jar", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.jar") My.Computer.Network.DownloadFile("https://s3.amazonaws.com/MinecraftDownload/launcher/Minecraft.exe", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.exe") End If Timer1.Stop() MsgBox("Mise à jour terminé.", MsgBoxStyle.Information) Button1.Enabled = True Button2.Enabled = True Button3.Enabled = True ProgressBar1.Visible = False Label1.Visible = True Label2.Visible = True End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load My.Computer.Network.DownloadFile("http://www.vexome.fr/Launcher/minecraft/vexome/text.txt", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\text.txt") Dim up As New System.IO.StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\text.txt") Label2.Text = up.ReadToEnd up.Close() Kill(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\text.txt") My.Computer.Network.DownloadFile("http://www.vexome.fr/Launcher/minecraft/vexome/cracker/mVexome.txt", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\resources\mVexome.txt") Dim op As New System.IO.StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\resources\mVexome.txt") Label7.Text = op.ReadToEnd op.Close() Kill(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\resources\mVexome.txt") If System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\mVexome.txt") = True Then My.Computer.Network.DownloadFile("http://www.vexome.fr/Launcher/minecraft/vexome/officiel/mVexome.txt", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\mVexome.txt") Dim vn As New System.IO.StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\mVexome.txt") Dim vni As New System.IO.StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\mVexome.txt") Label7.Text = vni.ReadToEnd Dim nk As String Dim nki As String nk = vn.ReadLine nki = vni.ReadLine vn.Close() vni.Close() Kill(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\mVexome.txt") If nk < nki Then MsgBox("Une mise à jour est disponible, elle va être téléchgargée.", MsgBoxStyle.Information) Button2.PerformClick() End If End If If System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\mVexome.txt") = False Then MsgBox("Le launcher va télécharger les fichiers nécessaires à son fonctionnement.", MsgBoxStyle.Information) Button2.PerformClick() End If End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If Me.ProgressBar1.Value = 100 Then Me.Timer1.Enabled = False Else Me.ProgressBar1.Value = Me.ProgressBar1.Value + 1 End If End Sub Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked Process.Start("http://www.vexome.fr") End Sub #Region "Mouse Move Form" Dim doDrag As Boolean Dim x As Integer Dim y As Integer Private Sub Accueil_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown doDrag = True x = Windows.Forms.Cursor.Position.X - Me.Left y = Windows.Forms.Cursor.Position.Y - Me.Top Me.Cursor = Cursors.NoMove2D End Sub Private Sub Accueil_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove If doDrag = True Then Me.Top = Windows.Forms.Cursor.Position.Y - y Me.Left = Windows.Forms.Cursor.Position.X - x Me.Cursor = Cursors.NoMove2D End If End Sub Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp doDrag = False Me.Cursor = Cursors.Default End Sub #End Region Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End Sub End Class
Dim TextFile As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\text.txt" If IO.File.Exists(TextFile) IO.File.Delete(TextFile) End If Dim FS As Stream = IO.File.Create(TextFile)
If IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\text.txt") IO.File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\text.txt") End If Dim FS As Stream = IO.File.Create(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\text.txt")