VOGONS


First post, by Malvineous

User metadata
Rank Oldbie
Rank
Oldbie

Hi all,

I am writing a program that can modify some DOS games (e.g. so you can make your own levels) and I would like it to be able to launch DOSBox so you can preview your changes in the game itself.

Under Linux this is fairly easy as the binary is almost always in /usr/bin, but under Windows it looks like the folder name depends on the DOSBox version, and the user is given the option to change it during installation.

Is there some sure-fire way of working out where DOSBox was installed to? Are there any registry keys or file associations that can be examined for this? If not it's no big deal, it just means users will have to browse for dosbox.exe first. But if there's an easy way to avoid this step and automatically locate DOSBox, that'd be great.

Reply 1 of 5, by collector

User metadata
Rank l33t
Rank
l33t

Not really. This is something that has relevance to me because my installers automatically set games up in DOSBox. The DOSBox installer does not really make Registry entries. There is no reliable trace of it in the Registry. It might end up in the MuiCache. Most exe installers make registry entries to keep track of things like where the user set the Start Menu, but this location is hardwired into the DOSBox installer based upon its version. Even if the installer made the normal entries that most installers make, i.e. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall some users may bypass the installer by unzipping it and since the application itself makes no registry entries, you would still have the same problem.

In the end, I fell back on user interaction to choose the location of DOSBox they want to use and the option my installers have to download and install DOSBox if they don't have it installed. I do set a standard location of "%ProgramFiles%\DOSBox" if they let the installer download and install it.

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 2 of 5, by Stiletto

User metadata
Rank l33t++
Rank
l33t++
collector wrote:

It might end up in the MuiCache. Most exe installers make registry entries to keep track of things like where the user set the Start Menu, but this location is hardwired into the DOSBox installer based upon its version. Even if the installer made the normal entries that most installers make, i.e. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall some users may bypass the installer by unzipping it and since the application itself makes no registry entries, you would still have the same problem.

Not only that, some users use "registry cleaners" that often target MuiCache among other locations. 😀

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 3 of 5, by collector

User metadata
Rank l33t
Rank
l33t

True, but that was my point. MuiCache is mostly a temporary entry, so it cannot be relied on for path information.

Reply 4 of 5, by Malvineous

User metadata
Rank Oldbie
Rank
Oldbie

Thanks for the info. I hadn't thought of the Uninstall registry entry but you're right - it creates an uninstaller but doesn't then put it in Add/Remove programs.

Well it looks like there really isn't a guaranteed way of locating the .exe! I'm not that keen on searching for %ProgramFiles%\DOSBox* because as you say, it could be unzipped somewhere else, but maybe that would cover the majority of cases?

Reply 5 of 5, by collector

User metadata
Rank l33t
Rank
l33t

Unless the installer for the official build starts to at least include an entry for App Path, there is not much more to do than work around it.

One thing I do with my installers is to first look for it in "%ProgramFiles%\DOSBox". If it finds it, It will ask the user if he wants to use that version. If not, it will check the version in "%ProgramFiles%\DOSBox". If it finds an outdated version, it offers to download and install the latest. Upon upgrading, it first will rename the folder to DOSBox-0.** depending on the old version, then install the new version in "DOSBox". This encourages the users of my installers to use the latest. If it does not find it in "%ProgramFiles%\DOSBox", it asks the user to if he wants to use a copy of DOSBox installed in a different location.

This allows ease of use for less advanced users while providing flexibility for more seasoned users that may wish to use a special build or want to keep their retro gaming stuff out of system folders. Also, setting a default location a folder named just "DOSBox" that the contents can be replaced with newer versions makes it easy to upgrade DOSBox without breaking the shortcuts my installers create. And since the custom dosbox.confs they write are fairly minimal, the confs are not likely to become dated with every new DOSBox upgrade.