Used nfs2iso2nfs dll instead of cmd process

This commit is contained in:
ZestyTS 2022-08-09 14:19:16 -07:00
parent 5b5d34a0b3
commit 3d4a339212
4 changed files with 53 additions and 76 deletions

View file

@ -5,6 +5,10 @@ VisualStudioVersion = 17.2.32630.192
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UWUVCI AIO WPF", "UWUVCI AIO WPF\UWUVCI AIO WPF.csproj", "{6A60AB0E-4597-4ECA-AEFB-D63A26CA7B54}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nfs2iso2nfs", "..\nfs2iso2nfs\nfs2iso2nfs\nfs2iso2nfs.csproj", "{054A0C78-F483-4113-AC03-A59DEB92B965}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WiiUDownloaderLibrary", "..\WiiUDownloaderLibrary\WiiUDownloaderLibrary\WiiUDownloaderLibrary.csproj", "{F27311A9-F383-4E2F-B82A-FD78D488E25D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -15,6 +19,14 @@ Global
{6A60AB0E-4597-4ECA-AEFB-D63A26CA7B54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6A60AB0E-4597-4ECA-AEFB-D63A26CA7B54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6A60AB0E-4597-4ECA-AEFB-D63A26CA7B54}.Release|Any CPU.Build.0 = Release|Any CPU
{054A0C78-F483-4113-AC03-A59DEB92B965}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{054A0C78-F483-4113-AC03-A59DEB92B965}.Debug|Any CPU.Build.0 = Debug|Any CPU
{054A0C78-F483-4113-AC03-A59DEB92B965}.Release|Any CPU.ActiveCfg = Release|Any CPU
{054A0C78-F483-4113-AC03-A59DEB92B965}.Release|Any CPU.Build.0 = Release|Any CPU
{F27311A9-F383-4E2F-B82A-FD78D488E25D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F27311A9-F383-4E2F-B82A-FD78D488E25D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F27311A9-F383-4E2F-B82A-FD78D488E25D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F27311A9-F383-4E2F-B82A-FD78D488E25D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -540,29 +540,20 @@ namespace UWUVCI_AIO_WPF
File.Move(Path.Combine(tempPath, "game.iso"), gamePath);
File.Copy(Path.Combine(toolsPath, "nfs2iso2nfs.exe"), nfsPath);
using (Process iso2nfs = new Process())
string extra = "";
if (mvm.Index == 2)
{
if (!mvm.debug)
{
iso2nfs.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
}
iso2nfs.StartInfo.FileName = nfsPath;
string extra = "";
if (mvm.Index == 2)
{
extra = "-horizontal ";
}
if (mvm.Index == 3) { extra = "-wiimote "; }
if (mvm.Index == 4) { extra = "-instantcc "; }
if (mvm.Index == 5) { extra = "-nocc "; }
if (mvm.LR) { extra += "-lrpatch "; }
iso2nfs.StartInfo.Arguments = $"-enc -homebrew {extra}-iso " + gamePath;
iso2nfs.Start();
iso2nfs.WaitForExit();
File.Delete(nfsPath);
File.Delete(gamePath);
extra = "-horizontal ";
}
if (mvm.Index == 3) { extra = "-wiimote "; }
if (mvm.Index == 4) { extra = "-instantcc "; }
if (mvm.Index == 5) { extra = "-nocc "; }
if (mvm.LR) { extra += "-lrpatch "; }
nfs2iso2nfs.Program.Main(new string[] { "-enc", "-homebrew", extra, "-iso", gamePath });
File.Delete(nfsPath);
File.Delete(gamePath);
mvm.Progress = 80;
@ -638,27 +629,18 @@ namespace UWUVCI_AIO_WPF
string nfsPath = Path.Combine(baseRomPath, "content", "nfs2iso2nfs.exe");
File.Move(Path.Combine(tempPath, "game.iso"), gamePath);
File.Copy(Path.Combine(toolsPath, "nfs2iso2nfs.exe"), nfsPath);
using (Process iso2nfs = new Process())
string pass = "-passthrough ";
if (mvm.passtrough != true)
{
if (!mvm.debug)
{
iso2nfs.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
}
iso2nfs.StartInfo.FileName = nfsPath;
string pass = "-passthrough ";
if (mvm.passtrough != true)
{
pass = "";
}
iso2nfs.StartInfo.Arguments = $"-enc -homebrew {pass}-iso " + gamePath;
iso2nfs.Start();
iso2nfs.WaitForExit();
File.Delete(gamePath);
File.Delete(nfsPath);
pass = "";
}
mvm.Progress = 80;
nfs2iso2nfs.Program.Main(new string[] { "-enc", "-homebrew", pass, "-iso", gamePath });
File.Delete(gamePath);
File.Delete(nfsPath);
mvm.Progress = 80;
}
@ -994,29 +976,21 @@ namespace UWUVCI_AIO_WPF
File.Move(Path.Combine(tempPath, "game.iso"), gamePath);
File.Copy(Path.Combine(toolsPath, "nfs2iso2nfs.exe"), nfsPath);
using (Process iso2nfs = new Process())
string extra = "";
if (mvm.Index == 2)
{
if (!mvm.debug)
{
iso2nfs.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
}
iso2nfs.StartInfo.FileName = nfsPath;
string extra = "";
if (mvm.Index == 2)
{
extra = "-horizontal ";
}
if (mvm.Index == 3) { extra = "-wiimote "; }
if (mvm.Index == 4) { extra = "-instantcc "; }
if (mvm.Index == 5) { extra = "-nocc "; }
if (mvm.LR) { extra += "-lrpatch "; }
iso2nfs.StartInfo.Arguments = $"-enc {extra}-iso " + gamePath;
iso2nfs.Start();
iso2nfs.WaitForExit();
File.Delete(nfsPath);
File.Delete(gamePath);
extra = "-horizontal ";
}
if (mvm.Index == 3) { extra = "-wiimote "; }
if (mvm.Index == 4) { extra = "-instantcc "; }
if (mvm.Index == 5) { extra = "-nocc "; }
if (mvm.LR) { extra += "-lrpatch "; }
nfs2iso2nfs.Program.Main(new string[] { "-enc", "-homebrew", extra, "-iso", gamePath });
File.Delete(nfsPath);
File.Delete(gamePath);
mvm.Progress = 80;
}
private static void GC(string romPath, MainViewModel mvm, bool force)
@ -1320,22 +1294,12 @@ namespace UWUVCI_AIO_WPF
File.Move(Path.Combine(tempPath, "game.iso"), gamePath);
File.Copy(Path.Combine(toolsPath, "nfs2iso2nfs.exe"), nfsPath);
using (Process iso2nfs = new Process())
{
if (!mvm.debug)
{
nfs2iso2nfs.Program.Main(new string[] { "-enc", "-homebrew", "-passthrough", "-iso", gamePath });
File.Delete(nfsPath);
File.Delete(gamePath);
iso2nfs.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
}
iso2nfs.StartInfo.FileName = nfsPath;
iso2nfs.StartInfo.Arguments = $"-enc -homebrew -passthrough -iso " + gamePath;
iso2nfs.Start();
iso2nfs.WaitForExit();
File.Delete(nfsPath);
File.Delete(gamePath);
}
mvm.Progress = 80;
}
private static void WIIold(string romPath, MainViewModel mvm, bool force)
{
@ -1771,6 +1735,7 @@ namespace UWUVCI_AIO_WPF
private static void EditXML(string gameNameOr, int index, string code)
{
string gameName = string.Empty;
//This line of code gives me cancer
if (gameNameOr != null || !String.IsNullOrWhiteSpace(gameNameOr))
{

View file

@ -29,7 +29,6 @@ namespace UWUVCI_AIO_WPF.Classes
"BuildPcePkg.exe",
"BuildTurboCdPcePkg.exe",
"goomba.gba",
"nfs2iso2nfs.exe",
"nintendont.dol",
"nintendont_force.dol",
"GetExtTypePatcher.exe",

View file

@ -18,7 +18,7 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<UseWindowsForms>True</UseWindowsForms>
<UseWPF>true</UseWPF>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
</PropertyGroup>
@ -180,6 +180,7 @@
<Compile Remove="Settings.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\nfs2iso2nfs\nfs2iso2nfs\nfs2iso2nfs.csproj" />
<ProjectReference Include="..\..\WiiUDownloaderLibrary\WiiUDownloaderLibrary\WiiUDownloaderLibrary.csproj" />
</ItemGroup>
</Project>