Game launchers are pretty useful, but one problem that I've had with RM launchers is the fact that players can choose not to use it, but instead just run Game.exe, effectively bypassing your launcher.
Here's a simple demo with a custom launcher that demonstrates how to set up your project to use custom launchers.
When you run the game normally, you'll get an error-message (in other games, it may not even say anything and just immediately close)
If you run the game using the RMLauncher, you can then start the game.
This is the source code for the game launcher (Java) if anyone wants to build it themselves.
public class RMLauncher { public static void main(String[] args) throws Exception { String[] cmds = {"Game.exe", "CUSTOM_LAUNCHER"}; Runtime.getRuntime().exec(cmds).waitFor(); }}You can see that it is a very simple technique. Can it be improved?For those that don't want Java, here's a C# version with a simple GUI. It is built on .NET 2.0, so unless you're using a dinosaur version of OS like win95 or something you should be able to run it without installing anything.
https://www.dropbox.com/sh/sz6mpw5n2d6zxi2/pgqp4xzR9e/Library/RMLauncher_C%23.zip
It features the default form with a single button to launch the game.
The launcher is then minimized while your game runs.
When the game finishes running, the launcher runs some clean up processes (in this case, renames Audio to Audio2, if it exists), and then exits.
Source:
Here's a simple demo with a custom launcher that demonstrates how to set up your project to use custom launchers.
When you run the game normally, you'll get an error-message (in other games, it may not even say anything and just immediately close)
If you run the game using the RMLauncher, you can then start the game.
This is the source code for the game launcher (Java) if anyone wants to build it themselves.
public class RMLauncher { public static void main(String[] args) throws Exception { String[] cmds = {"Game.exe", "CUSTOM_LAUNCHER"}; Runtime.getRuntime().exec(cmds).waitFor(); }}You can see that it is a very simple technique. Can it be improved?For those that don't want Java, here's a C# version with a simple GUI. It is built on .NET 2.0, so unless you're using a dinosaur version of OS like win95 or something you should be able to run it without installing anything.
https://www.dropbox.com/sh/sz6mpw5n2d6zxi2/pgqp4xzR9e/Library/RMLauncher_C%23.zip
It features the default form with a single button to launch the game.
The launcher is then minimized while your game runs.
When the game finishes running, the launcher runs some clean up processes (in this case, renames Audio to Audio2, if it exists), and then exits.
Source:
Code:
using System;using System.IO;using System.Windows.Forms;using System.Diagnostics;namespace RMLauncher{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { this.Visible = false; this.ShowInTaskbar = true; ProcessStartInfo procInfo = new ProcessStartInfo("Game.exe", "CUSTOM_LAUNCHER"); Process proc = new Process(); proc.StartInfo = procInfo; proc.Start(); proc.WaitForExit(); try { Directory.Move("Audio", "Audio2"); } catch (IOException) { } Application.Exit(); } private void Form1_Load(object sender, EventArgs e) { } }}
Last edited by a moderator:

