diff --git a/Sharpii.csproj.user b/Sharpii.csproj.user index 5df420f..966b4ff 100644 --- a/Sharpii.csproj.user +++ b/Sharpii.csproj.user @@ -1,6 +1,6 @@  - false + true \ No newline at end of file diff --git a/Sharpii.sln b/Sharpii.sln index 3dc290d..ac89afa 100644 --- a/Sharpii.sln +++ b/Sharpii.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29709.97 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sharpii", "Sharpii.csproj", "{A5ABD4DA-DBAB-4304-BEB1-A52BC9D6516D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sharpii", "Sharpii.csproj", "{A5ABD4DA-DBAB-4304-BEB1-A52BC9D6516D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Sharpii/Exit Codes.txt b/Sharpii/Exit Codes.txt index a006333..482528a 100644 --- a/Sharpii/Exit Codes.txt +++ b/Sharpii/Exit Codes.txt @@ -153,4 +153,9 @@ Provide a proper id. Exit Code: 16029/31 Not all files needed to pack a wad are present. (SHARPII_NET_CORE_NUSD_MISSING_FILES_01) You need to have all the required .app files, a tmd file, a tik file, and a cert file to pack a wad. -Ensure all files are present. \ No newline at end of file +Ensure all files are present. + +Exit Code: 16030/32 +Invalid ID or Missing CETK (SHARPII_NET_CORE_NUSD_REMOTE_404) +The remote server returned a 404 error. Check your Title ID. +If you have a CETK file, please place it in the same directory as Sharpii saves the NUS Files to. \ No newline at end of file diff --git a/Sharpii/NUSD.cs b/Sharpii/NUSD.cs index 39527a3..33effb4 100644 --- a/Sharpii/NUSD.cs +++ b/Sharpii/NUSD.cs @@ -25,6 +25,7 @@ namespace Sharpii { partial class NUS_Stuff { + public static int ExceptionListRan = 0; public static void NUS(string[] args) { if (args.Length < 2) @@ -319,20 +320,19 @@ namespace Sharpii } return; } - if (ex.Message == "The remote server returned an error: (404) Not Found.") + if (ExceptionListRan == 0) { + Console.WriteLine("An unknown error occured, please try again"); Console.WriteLine(""); - Console.WriteLine("The ID is not a valid title ID"); - Console.WriteLine(""); - Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_BAD_ID_01"); - Console.WriteLine(""); + Console.WriteLine("ERROR DETAILS: {0}", ex.Message); + Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_UNKNOWN_01"); if (OperatingSystem.Windows()) { - Environment.Exit(0x00003E9C); + Environment.Exit(0x00003E82); } else { - Environment.Exit(0x0000001E); + Environment.Exit(0x00000004); } return; } @@ -394,11 +394,11 @@ namespace Sharpii { if (BeQuiet.quiet > 1) Console.Write("Downloading title..."); - + string realout = output; if (wad == true) output = temp; - + nus.DownloadTitle(id, version, output, store.ToArray()); WadIosNamingStuff(wad, temp, id, version, ios, NoOut, output, realout); @@ -412,19 +412,71 @@ namespace Sharpii } catch (Exception ex) { - Console.WriteLine("An unknown error occured, please try again"); - Console.WriteLine(""); - Console.WriteLine("ERROR DETAILS: {0}", ex.Message); - Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_UNKNOWN_01"); - if (OperatingSystem.Windows()) + if (ex.Message == "CETK Doesn't Exist and Downloading Ticket Failed:\nThe remote server returned an error: (404) Not Found.") { - Environment.Exit(0x00003E82); + Console.WriteLine(""); + Console.WriteLine("The remote server returned a 404 error. Check your Title ID."); + Console.WriteLine("If you have a CETK file, please place it in the same directory as Sharpii saves the NUS Files to."); + Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_REMOTE_404"); + Console.WriteLine(""); + if (OperatingSystem.Windows()) + { + Environment.Exit(0x00003E9E); + } + else + { + Environment.Exit(0x00000020); + } + return; } - else + if (ex.Message == "Title ID must be 16 characters long!") { - Environment.Exit(0x00000004); + Console.WriteLine(""); + Console.WriteLine("The ID needs to be 16 Characters."); + Console.WriteLine(""); + Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_BAD_ID_01"); + Console.WriteLine(""); + if (OperatingSystem.Windows()) + { + Environment.Exit(0x00003E9C); + } + else + { + Environment.Exit(0x0000001E); + } + return; + } + if (ex.Message == "Index was outside the bounds of the array.") + { + Console.WriteLine("A WebRequest Error occurred. This usually means that Sharpii can not properly download the file."); + Console.WriteLine("Please ensure you have the proper permissions."); + Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_MISSING_FILES_01"); + ExceptionListRan = 1; + if (OperatingSystem.Windows()) + { + Environment.Exit(0x00003E9D); + } + else + { + Environment.Exit(0x0000001F); + } + } + if (ExceptionListRan == 0) + { + Console.WriteLine("An unknown error occured, please try again"); + Console.WriteLine(""); + Console.WriteLine("ERROR DETAILS: {0}", ex.Message); + Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_UNKNOWN_01"); + if (OperatingSystem.Windows()) + { + Environment.Exit(0x00003E82); + } + else + { + Environment.Exit(0x00000004); + } + return; } - return; } return; diff --git a/Sharpii/Sharpii.csproj b/Sharpii/Sharpii.csproj index 04b99cf..6b0fef7 100644 --- a/Sharpii/Sharpii.csproj +++ b/Sharpii/Sharpii.csproj @@ -11,8 +11,6 @@ Sharpii Sharpii v2.0 - - 512 false publish\ @@ -29,6 +27,12 @@ 1.0.0.%2a false true + true + true + true + link + Size + true x86 @@ -55,10 +59,6 @@ .\libWiiSharp.dll - - - - @@ -69,27 +69,6 @@ - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - @@ -101,12 +80,4 @@ WadInstaller - - \ No newline at end of file diff --git a/Sharpii/libWiiSharp.dll b/Sharpii/libWiiSharp.dll index 9081b8c..c686c11 100644 Binary files a/Sharpii/libWiiSharp.dll and b/Sharpii/libWiiSharp.dll differ