zDoom Launcher Configurations

CONFIGURATION FILE BASICS:
The
above eight lines are the configuration lines for the zDoom Launcher
configurations. Each item you want in the menu will have to have
a separate configuration file. This may seem like a pain.
However, this enables someone to add new items simply by copying the
files to the correct places. The launcher will populate the list
from there. You can remove items by removing the configuration
file. This will also make deployment of new addons easy to
integrate by including a zDL configuration file with your addon.
Each
of the above lines is required at least until the bracket " ] ".
When the lines are read, the launcher keeps all the information beyond
15 places. In other words, the first 15 spaces are not used, but
must be there to keep an error from happening. If this does
happen, the program will not crash or anything, but it will fail to
load the item. It will also tell you that there is a problem with
the file and tell you what file it is. There is a template that
can be copied and the additional items added as needed. The first
line MUST be at the top of the file. The program starts with the
top line and reads each item on each separate line. It looks for
carriage returns to designate new lines. That means that a long
description can be entered. However, it must be all one paragraph
with no returns. This isn't much of an issue since the window is
relatively small and the description should be a short one of the game
or addon to be run.
If you have trouble getting some of
the configurations to run and load all the wads and patches, check the
parameters being passed. You can do this by selecting the item,
typing "Show Parameters" in the text box at the bottom, then clicking
the button to launch. You'll see the passed parameters in the
description window. Make sure it matches what's in your
configuration. If it doesn't, try opening and editing the
configuration with something other then notepad.exe. Notepad does
not always show all the data formatted. Use something like pspad
or some other text editor that shows it formatted. I ran into
formatting problems during development where it showed everything was
fine in notepad. However, when I opened it in another program, it
had some extra stuff that was messing things up. I fixed it there
and it worked great. The other option is to open it in notepad,
select the 8 lines, use CTRL+C to copy them, then backspace to get rid
of them while keeping the data on the clipboard, then CTRL+S to save
the empty file, then CTRL+V to pase the data back. I've found it
to then show what's really there which can then be edited properly.
FILE AND TITLE ORGANIZATION:
When
zDoom Launcher starts up, it reads the files located in the
subdirectory under it of "Configs". It reads ANY file in that
directory with the extension ".cfg". If you have other files with
this extension in the directory that are not in the proper format, it
could cause some problems. Other files without this extension are
ignored. It then populates the drop down list using the FILES in
alphabetical order. Notice that the FILE NAMES are what is
ordered and not the titles within the files. For this reason, you
normally want the name of the file to at least start with the title
within. This also lets you order things as you want. For example,
if you want to have your normal Doom games listed first in the menu but
with their actual titles, you can name the files "001-Doom.cfg",
"002-Doom2.cfg", "003-Heretic.cfg", and so on. As long as no
other files fall before them, they will be first in the drop down list
irregardless of the title. Personally, I like not having to scroll
through the list just to play basic Doom. I prefer it at the
top. However, this can be organized however suites your
preference.
EXPLANATION OF THE ABOVE LINES:
Line
01: File label: The first 15 bytes of this line indicate that
this is a zDoom Launcher configuration file. The
"LABELZDOOMLNCH]" must be there or the program will not go any further
assuming it is a configuration file for a different program. This
will avoid oops's if another program or launcher uses the same
extension. It will add it to the menu, but will show an "Invalid
Config" listing and give you the name of the file. If you try and
launch it, a message will appear telling you the file name, again, and
to fix it or remove it from the "Configs" directory.
Line 02: Program title: This is the title that is displayed in the drop down menu of the zDoom Launcher.
Line 03: Program description
Line
04: Starting Directory: This is the starting directory of the
program. It is normally going to be the same directory as the
executable file below. The parameters are normally relative to this
directory location.
Line 05: Main executable to start:
This is the name of the file that is actually opened or executed.
It can be any executable from a batch file to a command file. If
it's a media file, it will be opened using the default windows program
used to open that type of file. Normally, this is simply
"zDoom.exe" or "gzDoom.exe".
Line 06: Main paramaters:
This is where the iwad, pwads, and deh patches. Also included any
other parameters to be run every time the program is launched.
Items placed into the bottom text box of the launcher are added to
these items and run as parameters.
Line 07: Local
configuration: This is the configuration file to use when the
program is run from a writable location. This is likely local and
can be in a subdirectory or the same one as above. The command
line "-config " is used to specify the file used. This will be
added to the parameters if the "IsCD.txt" is renamed or not in the
directory with the launcher.
Line 08: CD Configuration
Pre-Launch: If the program is run from a directory with
"IsCD.txt" signifying that it's a read-only location, any items here
will be executed prior to the program being launched. The
contents of "CDConfigCopy.bat" are below and are run to copy the zDoom
".ini" file used and save games placed there. Normally, you will
want to copy and set these items to either "C:\zDoomdat" or
"C:\gzDoomdat" as these are automatically used for save games by
zDoom. The location of the configuration can be changed, but not
the save games. Also, make sure "-cdrom" is there. These
are all included in the configuration template.
CONTENTS OF "CDConfigCopy.bat"
echo off
if exist c:\zdoomdat\zdoom.ini goto Exist
if Not exist c:\zdoomdat\zdoom.ini goto NoExist
:Exist
goto End
:NoExist
if not exist c:\zdoomdat md C:\zdoomdat
copy zdoom.ini c:\zdoomdat\zdoom.ini
Goto End
:End
Remember
that when setting up the copy batch file, zDoom Launcher will only
delete the directories "C:\zDoomdat" and "C:\gzDoomdat" if you select
to do so on exit. Other directories will stay there. So, if
you want to have the option to get rid of the program's leftovers,
place them in one of those two directories.
Line 09: CD
Configuration: This is the location of the configuration file if
the program is being run from a read-only location. This is
normally like it is above. For specific game setups, you may want
to change the name of the ".ini" file and copy if there from a
different location with a modified "CDConfigCopy.bat".
Line
10+: Anything after line 9 are just comments. You can add as much
as you need to and make as many lines as you need after that. If
you have specific notes regaring configuration setup, this is a good
place to put them.
TEMPLATE CONTENTS: "Configs\_Template.txt"

GETTING RID OF THE LEFTOVERS:
When
zDoom Launcher closes, it checks to see if it is using the options from
a read-only location. If it is, it will ask if you want to delete
configuration and save games from your hard drive when you exit.
If you choose yes, the directories "C:\zDoomdat" and "C:\gzDoomdat"
will be deleted.
DIRECTORY SETUP:
Configurations
should reflect the directory setup. I've found it easiest to
place the launcher in one directory with everything else below it
allowing for relative paths to be used. The configuration file
examples with this are all set up this way. You'll see the
directory tree I have below. The launcher is placed in
"DoomLauncher" with the zDoom and the normal iwads in the "zDoom"
directory below it. The directories below zDoom are all the pWad
directories. All the configuration files are under the "Configs"
directory below the launcher as required. The other directories,
"Foreverhood" and "Action2" are stand-alone Doom engine conversions
using zDoom that don't require the original iWads. I kept them
separate.

You'll
also see below that you can have specific zDoom config (.ini) files
referred to along with special copy batch files for them. Just
place them in a separate folder and refer to them in your zDoom
Launcher configurations and the specific batch file itself. The
setup below is from a great pWad called "Cold As Hell". I have a
specific "CAH.ini" for it along with a separate "CDConfigCopy.bat" to
copy that file for a read only drive.
