Yet Another Mod Launcher

TC01

Deity
Joined
Jun 28, 2009
Messages
2,216
Location
Irregularly Online
Civ 4 Mod Launcher v4.0 by TC01

I know there are lots of other programs out there for launching mods. So why am I releasing this one, which started out as merely a programming exercise? Because it supports Colonization, and I don't know of any other mod launcher that does.

This program, when ran, tries to automatically detect the Civ 4, Warlords, BTS, and Civ 4 Col install paths from your computer. If it fails, it will prompt you for them, giving you the option to tell the program that you don't have a certain version installed. This data is saved to the program's settings and is never asked for again when the program is ran (unless you click the Reset Settings button).

It does not support mods installed to the My Games directory; this is because of weird issues that sometimes arise when mods are installed here (which is why it's not recommended to use that folder for mods).

It was programmed in Visual Basic .NET, so it requires Microsoft's .NET framework. I think it will work with some combination of 2.0/3.0/3.5, but it also works on my Windows 7 computer with only .NET 4.0 installed. It can also be ran with the open source Mono platform.

Oh, and "Yet Another Mod Launcher" is a deliberate reference to YAML (even though YAML actually stands for "YAML Ain't Markup Language"). That's not actually the name of the program but it was a good title for the thread...

Features:
  • Supports Colonization, as well as Civ 4, Warlords, and BTS
  • Tries to automatically determine the install path through the registry
  • If it can't, prompts the user and then stores these paths to the application's settings
  • Likewise, if a version of Civ isn't installed, it will remember this too
  • Then, you can reset these settings if you do install a version
  • Can launch both modded and unmodded versions of Civilization 4
Version 2.0 Changes:
  • Support for Gold and Complete registry paths
  • A checkbox to close the program after launching a mod
  • A checkbox to have the program remember the last mod it launched when it closed
  • The values of these checkboxes are remembered
  • A message box appears when settings are cleared
Version 3.0 Changes:
  • A "Random Mod" button that launches a randomly selected mod for the selected Civ version
  • Before launching, it will tell you which mod it has selected and allow you to cancel the launch
  • It will remember this mod as the "last mod launched"
Version 4.0 Changes:
Links:
  • Fixed a bug where the prompted alternate paths were not saved to settings
  • Fixed a bug with 64-bit systems where the keys failed to be detected
Download here
.NET Framework 4.0
Mono (Open Source .NET)

To Install:

Unzip and extract the ModLauncher.exe file and put it somewhere, I recommend your Civ 4 folder. Then make a shortcut to your desktop and run it.

You don't need the contents of the Source directory, unless you really want to look at my source code.

Credits/Legal Info:

-TC01 (the programmer- me)

-Lord Tirian (ideas)
-embryodead, phungus420 (help with Complete/Gold registry keys)
-Slips (bug reports)

-Firaxis/2K Games (for Civ 4 and it's expansions, and for the BTS logo used in the program)
-Microsoft (for Visual Studio and the Visual Basic .NET language)

This program is open source. You can do what you want with the source code (I can't think of what anyone would want to do with the source code), but neither me nor anyone else listed above can be held responsible if the program or it's source somehow damages your computer (not that I can think of how).
 
It was programmed in Visual Basic .NET, so it requires Microsoft's .NET framework. I think it will work with some combination of 2.0/3.0/3.5, but it also works on my Windows 7 computer with only .NET 4.0 installed.

You do know that you can write programs that do not require .NET to run, right? Well maybe not with Basic but for Visual C++ you can choose to create a Win32 project instead of a .NET one, which will then run everywhere even without the .NET framework cancer ;)
 
You do know that you can write programs that do not require .NET to run, right? Well maybe not with Basic but for Visual C++ you can choose to create a Win32 project instead of a .NET one, which will then run everywhere even without the .NET framework cancer ;)

Uh, yes, I know that, thank you. The reasons it's in Visual Basic and not C++ or Python (my other language of choice aside from VB) are fourfold:

1. I'm not very good at C++ (I can mod the DLL but I can't write an independent program in it).

2. I've never created a C++ program with an interface before (some console programs though).

3. I'm much better at Python programming, including independent programs, but I'm not very good at making an interface in Python either.

4. I made the first version of this late last year, when I had just figured out how to compile a DLL and hadn't even touched independent Python programming.

If you really hate .NET, you can always use the open source Mono instead. If what you actually hate is the idea that sometimes programs do require external libraries, then sorry. Use another mod launcher that doesn't.
 
Hey, TC01, I've found the mod launcher to be pretty useful. In case you want feedback, some possible improvements:
  • It could remember the last settings (useful for modders that start the same mod over and over again ;) )
  • Have an option to close after the Civ4 launch (this should also be remembered between sessions)
  • It's not detecting the Civ 4 Complete version so far

Apart from that, it's actually pretty nifty, especially the Civ4Col support. :goodjob:

Cheers, LT.
 
Hey, TC01, I've found the mod launcher to be pretty useful. In case you want feedback, some possible improvements:
  • It could remember the last settings (useful for modders that start the same mod over and over again ;) )
  • Have an option to close after the Civ4 launch (this should also be remembered between sessions)
  • It's not detecting the Civ 4 Complete version so far

Apart from that, it's actually pretty nifty, especially the Civ4Col support. :goodjob:

Cheers, LT.

Hmm, remembering last settings might be useful, I'll add a checkbox for that, and for the "close after launch".

The reason it's not detecting Civ 4 Complete is that I don't know the registry path for it. I probably can figure it out though.

Thanks for the feedback!
 
Version 2.0 has been released!

It implements Lord Tirian's ideas- two checkboxes, one to make the program close on launch and another to make it remember the last mod it launched.

It adds autodetecting support for Complete and Gold too (thanks to help from embryodead and phungus420)- at least, it should. That is untested, as I don't have Complete or Gold.

I also added a popup (message box) when clicking "Reset Settings", just to make the user think something is actually happening (before, the user couldn't see anything happening when that button was clicked).
 
Version 3.0 has been released!

It adds a "Launch Random" button, which launches a randomly-selected mod for the currently-selected Civ version. (So you must select a Civ version to launch first).

It then prompts you saying what mod is being launched and gives you an option to cancel the launch.
 
I've been having some problems with this application.


Every time I start the app, it requests the install directories again.
It recalls all the options I have previously entered (pressing "Cancel" preserves the old choice), it will even skip on requesting the ones marked as not installed previously.

The app also does not detect any of my mods located at %DEFAULTUSERPROFILE%/My Documents/My Games/Civilization 4/MODS; etc.


OS: Windows 7 Ultimate x64, application ran as Administrator

Edit:
While debugging your source myself, I discovered that your code does not check for 64 bit (this can cause problems when working with .NET framework 4.0)

I added the following into FindInstallPath after your Dims, then modified your RLocalMachine and RCurrentUser variables as follows:
Code:
        Dim OSType As String
        If IntPtr.Size = 8 Then
            OSType = "\SOFTWARE\Wow6432Node\"
        Else
            OSType = "\Software\"
        End If

        'Construct the root of both registry strings
        RLocalMachine = LocalMachine & OSType & RegRoot
        RCurrentUser = CurrentUser & OSType & RegRoot

Also, changing your RegRoot to be defined as only "Firaxis Games\"

This got over the problem.

This however, only incidentally addresses part of the issues I was having.
I would change more but VB is an icky language and I don't like going near it when I don't need to. :p
 
Well, sorry about the huge delay in responding to this; I've been rather busy.

I've released version 4.0 with that change added. I have Win 7 Ultimate x64 as well, so I'm a bit embarrased about this; when I first moved this program from my old Windows XP install to Windows 7 and found it wasn't working, I added the keys manually to where they are on 32-bit systems.

I also fixed the bug where the alternate, prompted paths weren't stored to settings.

However, I have not and most likely will not made it launch mods from the My Games directory. This is the wrong way to install a mod; there are reports of weirdness with some mods that have been installed there. This is why installation instructions generally say to install to Program Files.

If there's a reason why some mods need to be installed to My Games instead, I'll consider adding support for it.
 
Top Bottom