From fbfb9d2250fb1559cac8b3244e07004a4024f455 Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Sat, 21 Aug 2021 12:01:35 +0200 Subject: [PATCH] warning, in case mod zip contains subfolders --- ModPacker.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/ModPacker.cs b/ModPacker.cs index 48c678c..0f4cbff 100644 --- a/ModPacker.cs +++ b/ModPacker.cs @@ -182,6 +182,13 @@ namespace AM2R_ModPacker // Create AM2R.exe and data.win patches if (profile.OperatingSystem == "Windows") { + if (!File.Exists(tempModPath + "/AM2R.exe")) + { + var result = MessageBox.Show("Modded game not found, make sure it's not placed in any subfolders.\nCreated profile will likely not be installable, are you sure you want to continue?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (result != DialogResult.Yes) + AbortPatch(); + } + if (profile.UsesYYC) { CreatePatch(tempOriginalPath + "\\data.win", tempModPath + "\\AM2R.exe", tempProfilePath + "\\AM2R.xdelta"); @@ -195,10 +202,17 @@ namespace AM2R_ModPacker } else if (profile.OperatingSystem == "Linux") { - string runnerName = File.Exists(tempModPath + "\\" + "AM2R") ? "AM2R" : "runner"; + string runnerName = File.Exists(tempModPath + "\\" + "AM2R") ? "AM2R" : "runner"; + + if (!File.Exists(tempModPath + "/" + runnerName)) + { + var result = MessageBox.Show("Modded Linux game not found, make sure it's not placed in any subfolders.\nCreated profile will likely not be installable, are you sure you want to continue?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (result != DialogResult.Yes) + AbortPatch(); + } - CreatePatch(tempOriginalPath + "\\data.win", tempModPath + "\\assets\\game.unx", tempProfilePath + "\\game.xdelta"); - CreatePatch(tempOriginalPath + "\\AM2R.exe", tempModPath + "\\" + runnerName, tempProfilePath + "\\AM2R.xdelta"); + CreatePatch(tempOriginalPath + "\\data.win", tempModPath + "\\assets\\game.unx", tempProfilePath + "\\game.xdelta"); + CreatePatch(tempOriginalPath + "\\AM2R.exe", tempModPath + "\\" + runnerName, tempProfilePath + "\\AM2R.xdelta"); } // Create game.droid patch and wrapper if Android is supported