私はゲームランチャーに取り組んでいます(はい、すでにありますが、私のものは異なります)。問題は、ログインするとゲームが起動しようとするのですが、コンソール ウィンドウに「jarfile c:\users\max korlaar\dropbox\max にアクセスできません」と表示され、1 ミリ秒後に閉じてしまうことです。私のプロセス引数に指定されたjarファイルがそこにあり、VB.netがその場所で何かをしていると思うので、理由はわかりません。jar ファイルは、私のプログラムに関連するフォルダ Bin にあります。(そして、はい、+ を & に置き換えてみました)
Dim process As New Process
Dim info As New ProcessStartInfo
info.FileName = GetJavaHome() + "\java.exe"
info.CreateNoWindow = True
info.UseShellExecute = True
info.RedirectStandardError = False
info.RedirectStandardOutput = False
Dim args As String = "-jar -natives{1} -lwjgl{2} -mlcfg{3} -mlmod{4} -j{5} -u{6} -s{7}"
info.Arguments = String.Format(args, My.Application.Info.DirectoryPath + "\bin\natives", My.Application.Info.DirectoryPath + "\bin\natives", My.Application.Info.DirectoryPath + "\bin\lwjgl.jar", My.Application.Info.DirectoryPath + "\config\", My.Application.Info.DirectoryPath + "\mods\", My.Application.Info.DirectoryPath + "\bin\minecraft.jar\", TextBox1.Text, result)
info.Arguments = info.Arguments.Replace("\bin\minecraft.jar", My.Application.Info.DirectoryPath + "\bin\minecraft.jar")
process.StartInfo = info
process.Start()
いくつかの提案を試した後、少し修正して、これを得ました:
Dim process As New Process
Dim info As New ProcessStartInfo
info.FileName = GetJavaHome() + "\java.exe"
info.CreateNoWindow = False
info.UseShellExecute = False
info.RedirectStandardError = False
info.RedirectStandardOutput = True
'Got error: Corrupt jar file... Someone with Minecraft Experience can help me to launch it?
Dim args As String = "-jar ""{6}"" -natives ""{1}"" -lwjgl ""{2}"" -mlcfg ""{3}"" -mlmod ""{4}"" -j ""{5}"" -u ""{6}"" -s ""{7}"""
' Got CMD window popping up with error and disappearing
info.Arguments = String.Format(args, "none", My.Application.Info.DirectoryPath & "\bin\natives\", My.Application.Info.DirectoryPath & "\bin\natives", My.Application.Info.DirectoryPath & "\bin\lwjgl.jar", My.Application.Info.DirectoryPath & "\config\", My.Application.Info.DirectoryPath & "\mods\", "'" & Application.StartupPath & "\bin\minecraft.jar'", TextBox1.Text, result)
'info.Arguments = info.Arguments.Replace("\bin\minecraft.jar", My.Application.Info.DirectoryPath + "\bin\minecraft.jar")
process.StartInfo = info
process.Start()
しかし、今私はエラーを受け取ります: jarfile "{minecraft.jar へのパス (正しいパス)}" にアクセスできません 誰も理由を知っていますか? そして、そのエラーを修正する方法は?