Bonjour,

Je veux créer mon launcher Arma III mais j'ai un petit problème qui me bloque tout le reste :/ Le launcher ne veut par créer de fichier que je demande de créer s'il voit que le fichier n'est pas présent sur mon ordinateur.


Voici le code présent:

Code VB.NET : Sélectionner tout - Visualiser dans une fenêtre à part
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
Imports Microsoft.Win32
Public Class Form1
    Dim directory As String = False
 
    Private Sub Unrar(ByVal filepath As String, ByVal WorkingDir As String)
        Dim objRegKey As RegistryKey
        objRegKey = Registry.ClassesRoot.OpenSubKey("WinRAR\Shell\Open\Command")
 
        Dim obj As Object = objRegKey.GetValue("")
 
        Dim objRarPath As String = obj.ToString()
        objRarPath = objRarPath.Substring(1, objRarPath.Length - 7)
 
        objRegKey.Close()
 
        Dim objArgs As String
        objArgs = " X " & " " & filepath & " " + " " + WorkingDir
 
        Dim objstartInfo As New ProcessStartInfo()
        objstartInfo.UseShellExecute = False
        objstartInfo.FileName = objRarPath
        objstartInfo.Arguments = objArgs
        objstartInfo.WindowStyle = ProcessWindowStyle.Hidden
        objstartInfo.WorkingDirectory = WorkingDir & ""
 
        Dim objPro As New Process()
        objPro.StartInfo = objstartInfo
        objPro.Start()
 
    End Sub
 
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Process.Start("http://EvasionLife.forumactif.fr")
    End Sub
 
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        If My.Computer.FileSystem.FileExists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\LauncherEvasionLife\directory.a3") Then
            directory = My.Computer.FileSystem.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\LauncherEvasionLife\directory.a3")
        Else
            MsgBox("Vous devez Specifier le chemin d'acces de votre Arma III", MsgBoxStyle.Exclamation, "Erreur")
            FolderBrowserDialog1.ShowDialog()
            directory = FolderBrowserDialog1.SelectedPath
 
            My.Computer.FileSystem.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\LaucherEvasionLife")
            My.Computer.FileSystem.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\LauncherEvasionLife\Direcotry.a3", directory, False)
        End If
    End Sub
End Class