Skip to content
Mr.Assetto edited this page Jan 29, 2024 · 4 revisions

Welcome to Mr.Assetto's Assetto Corsa Server Manager Wiki!

This wiki provides instructions, background information, and frequently asked questions about the Assetto Corsa Server Manager.

Background

This application is developed in Java using Apache NetBeans 20 and was initiated on June 5th, 2023. As a novice in coding, I am learning throughout the development process. The project has evolved significantly from its initial concept, with a focus on functionality over aesthetics.

Instructions

Initial Setup

  1. Java Requirements: For optimal compatibility, download Java and Java JDK-19. The launcher checks for these installations, providing download links if absent.

  2. Installation:

    • Download the project zip file.
    • Create a new folder and transfer all files and folders from the zip into this folder. Alternatively, move the zip file to the desired location and use the 'Extract\ Folder' option.
  3. Launching the Application:

    • Execute 'MrAssettoManager Launcher.exe', a batch script that performs compatibility checks and launches the manager. This approach prevents the command prompt from remaining open. The batch file contains:
      @echo off
      start "" /B wscript.exe "run_program.vbs"
      exit

    What run_program.vbs does:

    • The Script is used to check for the presence of the Java Runtime Environment (JRE) and a specific version of the Java Development Kit (JDK) on a user's system before running:
      ' This script is to not have the command prompt stay open when running the program. 
      ' It checks if JRE is installed, if not, prompts to download it.
      ' If JRE is present but not the specific JDK version, it prompts to download the JDK and uses the local JDK to start the program.
      Set WshShell = CreateObject("WScript.Shell")
      Set objFSO = CreateObject("Scripting.FileSystemObject")
      
      ' Path to the local JDK
      jdkPath = ".\jdk-19.0.1\bin\java.exe" 
      
      ' Path to Server Manager
      jarPath = "MrAssettoManager.jar"
      
      ' Java Runtime is installed
      Function IsJREInstalled()
          On Error Resume Next
          Dim strOutput
          strOutput = WshShell.Exec("java -version").StdErr.ReadAll
          If Err.Number = 0 And InStr(strOutput, "java version") > 0 Then
              IsJREInstalled = True
          Else
              IsJREInstalled = False
          End If
          On Error GoTo 0
      End Function
      
      ' Install Java Runtime
      Function PromptToInstallJRE()
          Dim intMsgBox
          intMsgBox = MsgBox("Java Runtime (JRE) is not installed on your system. Would you like to install it now?", vbYesNo + vbExclamation, "Java Runtime Not Found")
      
          If intMsgBox = vbYes Then
              ' Open the default web browser to the Java download page
              WshShell.Run "https://www.java.com/download/"
          End If
      End Function
      
      ' Install JDK
      Function PromptToInstallJDK()
          Dim intMsgBox
          intMsgBox = MsgBox("The required JDK version 19.0.1 is not installed on your system. Would you like to download it now?", vbYesNo + vbExclamation, "JDK Not Found")
      
          If intMsgBox = vbYes Then
              ' Open the default web browser to the JDK download page
              WshShell.Run "https://download.oracle.com/java/19/archive/jdk-19.0.1_windows-x64_bin.exe"
          End If
      End Function
      
      ' Java Runtime is installed
      If IsJREInstalled() Then
          ' Check if the local JDK exists
          If objFSO.FileExists(jdkPath) Then
              ' Run using the local JDK
              WshShell.Run """" & jdkPath & """ -jar """ & jarPath & """", 0
          Else
              ' Prompt to download JDK
              PromptToInstallJDK
          End If
      Else
          ' Prompt to install Java Runtime
          PromptToInstallJRE
      End If

The Server Manager now should have started. For More Help Click Here