diff --git a/UWUVCI AIO WPF/App.xaml.cs b/UWUVCI AIO WPF/App.xaml.cs index cf8f016..07e9ec5 100644 --- a/UWUVCI AIO WPF/App.xaml.cs +++ b/UWUVCI AIO WPF/App.xaml.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Threading.Tasks; using System.Timers; using System.Windows; +using UWUVCI_AIO_WPF.Classes; using UWUVCI_AIO_WPF.UI.Windows; namespace UWUVCI_AIO_WPF @@ -98,12 +99,13 @@ namespace UWUVCI_AIO_WPF } if (Environment.Is64BitOperatingSystem) { - + } else { + //wnd.is32(); - Custom_Message cm = new Custom_Message("Warning", "Some features may cause issues on a 32Bit System. Upgrading to 64Bit would be recommended. \nReport any issues in the UWUVCI Discord, or ping @NicoAICP in #wiiu-assistance in the Nintendo Homebrew discord. "); + Custom_Message cm = new Custom_Message("Warning", "Some features may cause issues on a 32Bit System. Upgrading to 64Bit would be recommended.\nDue to an Issue with packing on 32Bit Systems, you need Java installed for packing. \nReport any issues in the UWUVCI Discord, or ping @NicoAICP in #wiiu-assistance in the Nintendo Homebrew discord. "); cm.ShowDialog(); } diff --git a/UWUVCI AIO WPF/Classes/Injection.cs b/UWUVCI AIO WPF/Classes/Injection.cs index 1f12e6f..e9f66f6 100644 --- a/UWUVCI AIO WPF/Classes/Injection.cs +++ b/UWUVCI AIO WPF/Classes/Injection.cs @@ -1682,7 +1682,7 @@ namespace UWUVCI_AIO_WPF mvvm.foldername = $"[WUP]{reg.Replace(gameName, "").Replace("|", " ")}_{i}"; i++; } - + var oldpath = Directory.GetCurrentDirectory(); mvm.Progress = 40; mvm.msg = "Packing..."; using (Process cnuspacker = new Process()) @@ -1692,12 +1692,19 @@ namespace UWUVCI_AIO_WPF cnuspacker.StartInfo.UseShellExecute = false; cnuspacker.StartInfo.CreateNoWindow = true; } - - cnuspacker.StartInfo.FileName = Path.Combine(toolsPath, "CNUSPACKER.exe"); - cnuspacker.StartInfo.Arguments = $"-in \"{baseRomPath}\" -out \"{outputPath}\" -encryptKeyWith {Properties.Settings.Default.Ckey}"; - + if (Environment.Is64BitOperatingSystem) + { + cnuspacker.StartInfo.FileName = Path.Combine(toolsPath, "CNUSPACKER.exe"); + cnuspacker.StartInfo.Arguments = $"-in \"{baseRomPath}\" -out \"{outputPath}\" -encryptKeyWith {Properties.Settings.Default.Ckey}"; + } + else + { + cnuspacker.StartInfo.FileName = "java"; + cnuspacker.StartInfo.Arguments = $"-jar \"{Path.Combine(toolsPath, "NUSPacker.jar")}\" -in \"{baseRomPath}\" -out \"{outputPath}\" -encryptKeyWith {Properties.Settings.Default.Ckey}"; + } cnuspacker.Start(); cnuspacker.WaitForExit(); + Directory.SetCurrentDirectory(oldpath); } mvm.Progress = 90; mvm.msg = "Cleaning..."; diff --git a/UWUVCI AIO WPF/Models/MainViewModel.cs b/UWUVCI AIO WPF/Models/MainViewModel.cs index 79e987a..573c5e0 100644 --- a/UWUVCI AIO WPF/Models/MainViewModel.cs +++ b/UWUVCI AIO WPF/Models/MainViewModel.cs @@ -506,8 +506,15 @@ namespace UWUVCI_AIO_WPF } public MainViewModel() { - - + if (!Environment.Is64BitOperatingSystem) + { + List Tools = ToolCheck.ToolNames.ToList(); + Tools.Remove("CNUSPACKER.exe"); + Tools.Add("NUSPacker.jar"); + ToolCheck.ToolNames = Tools.ToArray(); + } + + //if (Directory.Exists(@"Tools")) Directory.Delete(@"Tools", true); if (Directory.Exists(@"bases")) Directory.Delete(@"bases", true); if (Directory.Exists(@"temp")) Directory.Delete(@"temp", true); @@ -1807,7 +1814,7 @@ namespace UWUVCI_AIO_WPF } else { - return $@"https://github.com/Hotbrawl20/UWUVCI-VCB/raw/master/" + toolname; + return $@"https://github.com/Hotbrawl20/UWUVCI-VCB/raw/master/" + toolname.Replace("bin\\bases\\", ""); } } @@ -1821,7 +1828,7 @@ namespace UWUVCI_AIO_WPF } else { - return $@"https://github.com/Hotbrawl20/UWUVCI-VCB/raw/master/" + toolname; + return $@"https://github.com/Hotbrawl20/UWUVCI-VCB/raw/master/" + toolname.Replace("bin\\bases\\",""); } } @@ -1869,7 +1876,16 @@ namespace UWUVCI_AIO_WPF foreach (MissingTool m in missingTools) { - DownloadTool(m.Name,this); + if(m.Name == "blank.ini") + { + StreamWriter sw = new StreamWriter(Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools", "blank.ini")); + sw.Close(); + } + else + { + DownloadTool(m.Name, this); + } + Progress += Convert.ToInt32(l); } Progress = 100; @@ -3658,26 +3674,7 @@ namespace UWUVCI_AIO_WPF { WebRequest request; //get download link from uwuvciapi - try - { - request = WebRequest.Create("https://uwuvciapi.azurewebsites.net/GetURL?cns=" + console.ToLower()); - - - - - var response = request.GetResponse(); - using (Stream dataStream = response.GetResponseStream()) - { - // Open the stream using a StreamReader for easy access. - StreamReader reader = new StreamReader(dataStream); - // Read the content. - string responseFromServer = reader.ReadToEnd(); - // Display the content. - return responseFromServer; - } - } - catch (Exception) - { + string url = ""; switch (console.ToLower()) { @@ -3717,22 +3714,7 @@ namespace UWUVCI_AIO_WPF url = null; break; } - request = WebRequest.Create(url + console.ToLower()); - - - - - var response = request.GetResponse(); - using (Stream dataStream = response.GetResponseStream()) - { - // Open the stream using a StreamReader for easy access. - StreamReader reader = new StreamReader(dataStream); - // Read the content. - string responseFromServer = reader.ReadToEnd(); - // Display the content. - return responseFromServer; - } - } + return url; } WaveOutEvent waveOutEvent = new WaveOutEvent(); diff --git a/UWUVCI AIO WPF/Settings.cs b/UWUVCI AIO WPF/Settings.cs new file mode 100644 index 0000000..865283d --- /dev/null +++ b/UWUVCI AIO WPF/Settings.cs @@ -0,0 +1,28 @@ +namespace UWUVCI_AIO_WPF.Properties { + + + // Diese Klasse ermöglicht die Behandlung bestimmter Ereignisse der Einstellungsklasse: + // Das SettingChanging-Ereignis wird ausgelöst, bevor der Wert einer Einstellung geändert wird. + // Das PropertyChanged-Ereignis wird ausgelöst, nachdem der Wert einer Einstellung geändert wurde. + // Das SettingsLoaded-Ereignis wird ausgelöst, nachdem die Einstellungswerte geladen wurden. + // Das SettingsSaving-Ereignis wird ausgelöst, bevor die Einstellungswerte gespeichert werden. + internal sealed partial class Settings { + + public Settings() { + // // Heben Sie die Auskommentierung der unten angezeigten Zeilen auf, um Ereignishandler zum Speichern und Ändern von Einstellungen hinzuzufügen: + // + // this.SettingChanging += this.SettingChangingEventHandler; + // + // this.SettingsSaving += this.SettingsSavingEventHandler; + // + } + + private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { + // Fügen Sie hier Code zum Behandeln des SettingChangingEvent-Ereignisses hinzu. + } + + private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { + // Fügen Sie hier Code zum Behandeln des SettingsSaving-Ereignisses hinzu. + } + } +} diff --git a/UWUVCI AIO WPF/UI/Frames/SettingsFrame.xaml b/UWUVCI AIO WPF/UI/Frames/SettingsFrame.xaml index ff6bc91..96cbd91 100644 --- a/UWUVCI AIO WPF/UI/Frames/SettingsFrame.xaml +++ b/UWUVCI AIO WPF/UI/Frames/SettingsFrame.xaml @@ -46,7 +46,7 @@ -