Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

With the download edition of Starcraft, the original install.exe file…

…s are instead provided renamed as mpq files in the game install dir.

This patch makes SCSharp scan for these mpq files for preference. It also allows users to put everything in one dir, by renaming their install.exe files to starcraft.mpq and broodwar.mpq

pulled from directhex's master
commit af230ff
  • Loading branch information...
commit 31c3847ecf7b10908d13174dd1a17a87ea42a752 1 parent a996931
Chris Toshok authored
26 SCSharp/SCSharp.UI/Game.cs
View
@@ -140,6 +140,28 @@ public Game (string starcraftDir, string scCDDir, string bwCDDir)
e);
}
}
+ else if (Path.GetFileName (path).ToLower() == "starcraft.mpq") {
+ try {
+ scInstallExe = GetMpq (path);
+ Console.WriteLine ("found starcraft.mpq");
+ }
+ catch (Exception e) {
+ throw new Exception (String.Format ("could not read mpq archive {0}",
+ path),
+ e);
+ }
+ }
+ else if (Path.GetFileName (path).ToLower() == "broodwar.mpq") {
+ try {
+ bwInstallExe = GetMpq (path);
+ Console.WriteLine ("found broodwar.mpq");
+ }
+ catch (Exception e) {
+ throw new Exception (String.Format ("could not read mpq archive {0}",
+ path),
+ e);
+ }
+ }
}
}
@@ -147,7 +169,7 @@ public Game (string starcraftDir, string scCDDir, string bwCDDir)
throw new Exception ("unable to locate stardat.mpq, please check your StarcraftDirectory configuration setting");
}
- if (scCDDir != null) {
+ if (!string.IsNullOrEmpty (scCDDir)) {
foreach (string path in Directory.GetFileSystemEntries (scCDDir)) {
if (Path.GetFileName (path).ToLower() == "install.exe" || Path.GetFileName (path).Equals ("Starcraft Archive")) {
try {
@@ -163,7 +185,7 @@ public Game (string starcraftDir, string scCDDir, string bwCDDir)
}
}
- if (bwCDDir != null) {
+ if (!string.IsNullOrEmpty (bwCDDir)) {
foreach (string path in Directory.GetFileSystemEntries (bwCDDir)) {
if (Path.GetFileName (path).ToLower() == "install.exe" || Path.GetFileName (path).Equals ("Brood War Archive")) {
try {
8 scsharp.exe.config
View
@@ -3,10 +3,14 @@
<!-- directory containing the StarDat.mpq and BrooDat.mpq files -->
<add key="StarcraftDirectory" value="C:\Program Files\Starcraft"/>
- <!-- directory containing the install.exe file from the Starcraft CD -->
+ <!-- directory containing the install.exe file from the Starcraft CD,
+ empty to use Starcraft.mpq from StarcraftDirectory
+ -->
<add key="StarcraftCDDirectory" value="D:\"/>
- <!-- directory containing the install.exe file from the Brood Wars CD -->
+ <!-- directory containing the install.exe file from the Brood Wars CD,
+ empty to use BroodWar.mpq from StarcraftDirectory
+ -->
<add key="BroodwarCDDirectory" value="C:\BroodwarCD"/>
<!-- debugging/development options.
2  src/scsharp.cs
View
@@ -46,7 +46,7 @@ public static void Main (string[] args)
string bw_cd_dir = ConfigurationManager.AppSettings["BroodwarCDDirectory"];
/* catch this pathological condition where someone has set the cd directories to the same location. */
- if (sc_cd_dir != null && bw_cd_dir != null && bw_cd_dir == sc_cd_dir) {
+ if (!string.IsNullOrEmpty (sc_cd_dir) && !string.IsNullOrEmpty (bw_cd_dir) && bw_cd_dir == sc_cd_dir) {
Console.WriteLine ("The StarcraftCDDirectory and BroodwarCDDirectory configuration settings must have unique values.");
return;
}
Please sign in to comment.
Something went wrong with that request. Please try again.