Added Unique Error for 404 HTTP Responces. Updated libWiiSharp.dll

This commit is contained in:
Michael 2021-02-06 12:33:50 -06:00
parent 894554baf6
commit 8f1fb753d2
6 changed files with 84 additions and 56 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ShowAllFiles>false</ShowAllFiles> <ShowAllFiles>true</ShowAllFiles>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View file

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 16
VisualStudioVersion = 16.0.29709.97 VisualStudioVersion = 16.0.29709.97
MinimumVisualStudioVersion = 10.0.40219.1 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 EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View file

@ -153,4 +153,9 @@ Provide a proper id.
Exit Code: 16029/31 Exit Code: 16029/31
Not all files needed to pack a wad are present. (SHARPII_NET_CORE_NUSD_MISSING_FILES_01) 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. 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. 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.

View file

@ -25,6 +25,7 @@ namespace Sharpii
{ {
partial class NUS_Stuff partial class NUS_Stuff
{ {
public static int ExceptionListRan = 0;
public static void NUS(string[] args) public static void NUS(string[] args)
{ {
if (args.Length < 2) if (args.Length < 2)
@ -319,20 +320,19 @@ namespace Sharpii
} }
return; 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("");
Console.WriteLine("The ID is not a valid title ID"); Console.WriteLine("ERROR DETAILS: {0}", ex.Message);
Console.WriteLine(""); Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_UNKNOWN_01");
Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_BAD_ID_01");
Console.WriteLine("");
if (OperatingSystem.Windows()) if (OperatingSystem.Windows())
{ {
Environment.Exit(0x00003E9C); Environment.Exit(0x00003E82);
} }
else else
{ {
Environment.Exit(0x0000001E); Environment.Exit(0x00000004);
} }
return; return;
} }
@ -394,11 +394,11 @@ namespace Sharpii
{ {
if (BeQuiet.quiet > 1) if (BeQuiet.quiet > 1)
Console.Write("Downloading title..."); Console.Write("Downloading title...");
string realout = output; string realout = output;
if (wad == true) if (wad == true)
output = temp; output = temp;
nus.DownloadTitle(id, version, output, store.ToArray()); nus.DownloadTitle(id, version, output, store.ToArray());
WadIosNamingStuff(wad, temp, id, version, ios, NoOut, output, realout); WadIosNamingStuff(wad, temp, id, version, ios, NoOut, output, realout);
@ -412,19 +412,71 @@ namespace Sharpii
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine("An unknown error occured, please try again"); if (ex.Message == "CETK Doesn't Exist and Downloading Ticket Failed:\nThe remote server returned an error: (404) Not Found.")
Console.WriteLine("");
Console.WriteLine("ERROR DETAILS: {0}", ex.Message);
Console.WriteLine("Error: SHARPII_NET_CORE_NUSD_UNKNOWN_01");
if (OperatingSystem.Windows())
{ {
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; return;

View file

@ -11,8 +11,6 @@
<RootNamespace>Sharpii</RootNamespace> <RootNamespace>Sharpii</RootNamespace>
<AssemblyName>Sharpii</AssemblyName> <AssemblyName>Sharpii</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper> <IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl> <PublishUrl>publish\</PublishUrl>
@ -29,6 +27,12 @@
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
<TrimMode>link</TrimMode>
<IlcOptimizationPreference>Size</IlcOptimizationPreference>
<IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
@ -55,10 +59,6 @@
<Reference Include="libWiiSharp"> <Reference Include="libWiiSharp">
<HintPath>.\libWiiSharp.dll</HintPath> <HintPath>.\libWiiSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="NUSD.cs" /> <Compile Include="NUSD.cs" />
@ -69,27 +69,6 @@
<Compile Include="BNS.cs" /> <Compile Include="BNS.cs" />
<Compile Include="WAD.cs" /> <Compile Include="WAD.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="LICENSE.txt" /> <None Include="LICENSE.txt" />
@ -101,12 +80,4 @@
<Name>WadInstaller</Name> <Name>WadInstaller</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project> </Project>

Binary file not shown.