Take SpecialPackageRoot into account when installing packages

This commit is contained in:
Paul Chote
2011-01-27 18:48:59 +13:00
parent 817ac42954
commit ef462c5164
3 changed files with 8 additions and 8 deletions

View File

@@ -28,9 +28,9 @@ namespace OpenRA
ExecuteUtilityAsync("--extract-zip \"{0}\" \"{1}\"".F(zipFile, path), parseOutput, onComplete); ExecuteUtilityAsync("--extract-zip \"{0}\" \"{1}\"".F(zipFile, path), parseOutput, onComplete);
} }
public void InstallRAFilesAsync(string cdPath, Action<string> parseOutput, Action onComplete) public void InstallRAFilesAsync(string cdPath, string path, Action<string> parseOutput, Action onComplete)
{ {
ExecuteUtilityAsync("--install-ra-packages \"{0}\"".F(cdPath), parseOutput, onComplete); ExecuteUtilityAsync("--install-ra-packages \"{0}\" \"{1}\"".F(cdPath, path), parseOutput, onComplete);
} }
public void PromptFilepathAsync(string title, Action<string> withPath) public void PromptFilepathAsync(string title, Action<string> withPath)

View File

@@ -165,7 +165,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
}; };
if (Info.InstallMode == "ra") if (Info.InstallMode == "ra")
Game.Utilities.InstallRAFilesAsync(path, parseOutput, onComplete); Game.Utilities.InstallRAFilesAsync(path, FileSystem.SpecialPackageRoot+Info.PackagePath, parseOutput, onComplete);
else else
ShowDownloadError("Installing from CD not supported"); ShowDownloadError("Installing from CD not supported");
} }
@@ -211,7 +211,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
if (!error) if (!error)
Game.RunAfterTick(() => ContinueLoading(Info)); Game.RunAfterTick(() => ContinueLoading(Info));
}; };
Game.RunAfterTick(() => Game.Utilities.ExtractZipAsync(file, FileSystem.SpecialPackageRoot+Info.PackagePath, parseOutput, onComplete)); Game.RunAfterTick(() => Game.Utilities.ExtractZipAsync(file, FileSystem.SpecialPackageRoot+Info.PackagePath, parseOutput, onComplete));
} }
}; };

View File

@@ -57,14 +57,14 @@ namespace OpenRA.Utility
public static void InstallRAPackages(string[] args) public static void InstallRAPackages(string[] args)
{ {
if (args.Length < 2) if (args.Length < 3)
{ {
Console.WriteLine("Error: Invalid syntax"); Console.WriteLine("Error: Invalid syntax");
return; return;
} }
var basePath = "{0}{1}".F(args[1], Path.DirectorySeparatorChar); var basePath = "{0}{1}".F(args[1], Path.DirectorySeparatorChar);
var toPath = "mods{0}ra{0}packages{0}".F(Path.DirectorySeparatorChar); var toPath = args[2];
var directCopy = new string[] {"INSTALL/REDALERT.MIX"}; var directCopy = new string[] {"INSTALL/REDALERT.MIX"};
var extract = new string[] {"conquer.mix", "russian.mix", "allies.mix", "sounds.mix", var extract = new string[] {"conquer.mix", "russian.mix", "allies.mix", "sounds.mix",
"scores.mix", "snow.mix", "interior.mix", "temperat.mix"}; "scores.mix", "snow.mix", "interior.mix", "temperat.mix"};
@@ -87,14 +87,14 @@ namespace OpenRA.Utility
public static void InstallCncPackages(string[] args) public static void InstallCncPackages(string[] args)
{ {
if (args.Length < 2) if (args.Length < 3)
{ {
Console.WriteLine("Error: Invalid syntax"); Console.WriteLine("Error: Invalid syntax");
return; return;
} }
var basePath = "{0}{1}".F(args[1], Path.DirectorySeparatorChar); var basePath = "{0}{1}".F(args[1], Path.DirectorySeparatorChar);
var toPath = "mods{0}cnc{0}packages{0}".F(Path.DirectorySeparatorChar); var toPath = args[2];
var directCopy = new string[] {"CONQUER.MIX", "DESERT.MIX", "GENERAL.MIX", "SCORES.MIX", var directCopy = new string[] {"CONQUER.MIX", "DESERT.MIX", "GENERAL.MIX", "SCORES.MIX",
"SOUNDS.MIX", "TEMPERAT.MIX", "WINTER.MIX"}; "SOUNDS.MIX", "TEMPERAT.MIX", "WINTER.MIX"};
var extract = new string[] {"cclocal.mix", "speech.mix", "tempicnh.mix", "updatec.mix"}; var extract = new string[] {"cclocal.mix", "speech.mix", "tempicnh.mix", "updatec.mix"};