mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix DAT name; maybe fix Mono?
This commit is contained in:
@@ -26,6 +26,7 @@ namespace SabreTools
|
|||||||
private static string _baseExtract;
|
private static string _baseExtract;
|
||||||
private static ProcessStartInfo _psi;
|
private static ProcessStartInfo _psi;
|
||||||
private static List<RomData> _roms;
|
private static List<RomData> _roms;
|
||||||
|
private static bool _isMono;
|
||||||
|
|
||||||
// User specified variables
|
// User specified variables
|
||||||
private static bool _noMD5;
|
private static bool _noMD5;
|
||||||
@@ -49,6 +50,7 @@ namespace SabreTools
|
|||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
|
//Console.Title = "DATFromDir " + Build.Version;
|
||||||
|
|
||||||
// First things first, take care of all of the arguments that this could have
|
// First things first, take care of all of the arguments that this could have
|
||||||
_noMD5 = false; _noSHA1 = false; _forceunzip = false; _allfiles = false; _old = false;
|
_noMD5 = false; _noSHA1 = false; _forceunzip = false; _allfiles = false; _old = false;
|
||||||
@@ -130,11 +132,12 @@ namespace SabreTools
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set 7za required variables
|
// Set 7za required variables
|
||||||
|
_isMono = (Type.GetType("Mono.Runtime") != null);
|
||||||
_7zPath = Environment.CurrentDirectory + _delim + "7z" + (Environment.Is64BitOperatingSystem ? _delim + "x64" : "") + _delim;
|
_7zPath = Environment.CurrentDirectory + _delim + "7z" + (Environment.Is64BitOperatingSystem ? _delim + "x64" : "") + _delim;
|
||||||
_psi = new ProcessStartInfo
|
_psi = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
Arguments = "",
|
Arguments = "",
|
||||||
FileName = _7zPath + "7za.exe",
|
FileName = _7zPath + (_isMono ? "mono" : "7za.exe"),
|
||||||
RedirectStandardError = true,
|
RedirectStandardError = true,
|
||||||
RedirectStandardOutput = true,
|
RedirectStandardOutput = true,
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
@@ -149,7 +152,7 @@ namespace SabreTools
|
|||||||
// Set local paths and vars
|
// Set local paths and vars
|
||||||
_tempDir = Environment.CurrentDirectory + _delim + "temp" + DateTime.Now.ToString("yyyyMMddHHmmss") + _delim;
|
_tempDir = Environment.CurrentDirectory + _delim + "temp" + DateTime.Now.ToString("yyyyMMddHHmmss") + _delim;
|
||||||
_basePath = (args.Length == 0 ? Environment.CurrentDirectory + _delim : (File.Exists(path) ? path : path + _delim));
|
_basePath = (args.Length == 0 ? Environment.CurrentDirectory + _delim : (File.Exists(path) ? path : path + _delim));
|
||||||
_baseExtract = "x -o\"" + _tempDir + "\"";
|
_baseExtract = (_isMono ? "7za.exe " : "") + "x -o\"" + _tempDir + "\"";
|
||||||
|
|
||||||
// This is where the main loop would go
|
// This is where the main loop would go
|
||||||
if (File.Exists(_basePath))
|
if (File.Exists(_basePath))
|
||||||
@@ -188,7 +191,7 @@ namespace SabreTools
|
|||||||
string[] splitPath = _basePath.Split(_delim);
|
string[] splitPath = _basePath.Split(_delim);
|
||||||
_name = (_name == "" ? (inputs.Count > 1 ? Environment.CurrentDirectory.Split(_delim).Last() :
|
_name = (_name == "" ? (inputs.Count > 1 ? Environment.CurrentDirectory.Split(_delim).Last() :
|
||||||
(_basePath.EndsWith(_delim.ToString()) ? splitPath[splitPath.Length - 2] : splitPath.Last())) : _name);
|
(_basePath.EndsWith(_delim.ToString()) ? splitPath[splitPath.Length - 2] : splitPath.Last())) : _name);
|
||||||
_desc = (_desc == "" ? _name + " (" + _version + ")" : _desc);
|
_desc = (_desc == "" ? _name + " (" + _date + ")" : _desc);
|
||||||
|
|
||||||
// Now write it all out as a DAT
|
// Now write it all out as a DAT
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user