Revert "Accomodate for zips where the game is packed one directory below"

This reverts commit 62ff7a51f4.
pull/21/head
Miepee 5 years ago
parent 62ff7a51f4
commit cb158a42a1

@ -1118,17 +1118,9 @@ namespace AM2RLauncher
string tmpPath = Path.GetTempPath() + Path.GetFileNameWithoutExtension(zipPath); string tmpPath = Path.GetTempPath() + Path.GetFileNameWithoutExtension(zipPath);
// clean up in case folder exists already
if (Directory.Exists(tmpPath))
Directory.Delete(tmpPath, true);
//extract zip to tmp path first //extract zip to tmp path first
ZipFile.ExtractToDirectory(zipPath, tmpPath); ZipFile.ExtractToDirectory(zipPath, tmpPath);
// If the game is packed into a subfolder, accomodate for that
if (Directory.GetDirectories(tmpPath).Length == 1 && Directory.GetDirectories(tmpPath).First() != "lang")
tmpPath = Directory.GetDirectories(tmpPath).First();
// check if exe exists // check if exe exists
if (!File.Exists(tmpPath + "/AM2R.exe")) if (!File.Exists(tmpPath + "/AM2R.exe"))
return IsZipAM2R11ReturnCodes.MissingAM2RExe; return IsZipAM2R11ReturnCodes.MissingAM2RExe;

Loading…
Cancel
Save