Files
2026-06-18 14:15:48 +02:00

73 lines
3.6 KiB
VB.net
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Imports System.IO
Imports System.ComponentModel
Imports System.Net
Public Class Form97
Dim t1 = 0
Dim dl As Integer = 0
Private Sub Form97_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim lines1a() As String = File.ReadAllLines(théme)
If lines1a(0) = 2 Then
Me.BackColor = Color.FromArgb(64, 64, 64)
Label1.ForeColor = Color.White
ElseIf lines1a(0) = 3 Then
Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
Else
End If
FolderBrowserDialog1.Description = "Sélectionner un dossier de destination"
If FolderBrowserDialog1.ShowDialog = 1 Then
Directory.CreateDirectory(FolderBrowserDialog1.SelectedPath & "\lecteur média portable\")
téléchargerfr = New WebClient
dl = 1
téléchargerfr.DownloadFileTaskAsync(New Uri("http://lecteur2.lecteur-media.fr/lecteur/version portable.zip"), (FolderBrowserDialog1.SelectedPath & "\lecteur média portable\" & "\version portable.zip"))
Else
Me.Close()
End If
End Sub
Private Sub téléchargerfr_DownloadProgressChanged(sender As Object, e As DownloadProgressChangedEventArgs) Handles téléchargerfr.DownloadProgressChanged
GunaProgressBar1.Value = e.ProgressPercentage
Label1.Text = e.ProgressPercentage & "%"
End Sub
Private Sub Form97_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
If dl = 1 Then
e.Cancel = True
MsgBox("Un téléchargement est en cours merci de patienter", MsgBoxStyle.Exclamation)
Else
End If
End Sub
Private Sub téléchargerfr_DownloadFileCompleted(sender As Object, e As AsyncCompletedEventArgs) Handles téléchargerfr.DownloadFileCompleted
GunaProgressBar1.Style = Guna.UI.WinForms.ProgressBarStyle.Marquee
Label1.Text = "Installation en cours...."
BackgroundWorker1.RunWorkerAsync()
End Sub
Dim WithEvents téléchargerfr As WebClient
Private Sub BackgroundWorker1_DoWork(sender As Object, e As DoWorkEventArgs) Handles BackgroundWorker1.DoWork
IO.Compression.ZipFile.ExtractToDirectory(FolderBrowserDialog1.SelectedPath & "\lecteur média portable\" & "\version portable.zip", FolderBrowserDialog1.SelectedPath & "\lecteur média portable\")
End Sub
Private Sub BackgroundWorker1_RunWorkerCompleted(sender As Object, e As RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
If File.Exists(FolderBrowserDialog1.SelectedPath & "\lecteur média portable\dsinstallateur lecteur mdia.exe") = True Then
My.Computer.FileSystem.RenameFile(FolderBrowserDialog1.SelectedPath & "\lecteur média portable\dsinstallateur lecteur mdia.exe", "désinstallateur lecteur média.exe")
End If
If File.Exists(FolderBrowserDialog1.SelectedPath & "\lecteur média portable\lecteur mdia.exe") = True Then
My.Computer.FileSystem.RenameFile(FolderBrowserDialog1.SelectedPath & "\lecteur média portable\lecteur mdia.exe", "lecteur média.exe")
End If
File.Delete(FolderBrowserDialog1.SelectedPath & "\lecteur média portable\" & "\version portable.zip")
dl = 0
MsgBox("La version portable du lecteur a bien été installer dans: " & vbNewLine & vbNewLine & FolderBrowserDialog1.SelectedPath & "\lecteur média portable\", MsgBoxStyle.Information)
Close()
End Sub
End Class