useless stuff that broke everything

This commit is contained in:
NicoAICP 2020-06-05 19:43:22 +02:00
parent 90fac03e30
commit a964e5197d
4 changed files with 45 additions and 12 deletions

View file

@ -179,49 +179,78 @@ namespace UWUVCI_AIO_WPF.UI.Windows
} }
} }
DispatcherTimer dp = new DispatcherTimer();
private void setup_Click(object sender, RoutedEventArgs e) private void setup_Click(object sender, RoutedEventArgs e)
{ {
if (gc) dp.Tick += Dp_Tick;
dp.Interval = TimeSpan.FromSeconds(1);
dp.Start();
Task.Run(() =>
{
if (gc)
{
SetupNintendont();
}
CopyInject();
});
setup.IsEnabled = false;
}
private void Dp_Tick(object sender, EventArgs e)
{
MainViewModel mvm = FindResource("mvm") as MainViewModel;
status.Content = mvm.msg;
if(mvm.msg == "Done with Setup!")
{ {
SetupNintendont(); mvm.msg = "";
dp.Stop();
setup.IsEnabled = true;
setup.Click -= setup_Click;
setup.Click += Window_Close;
setup.Content = "Close";
} }
CopyInject();
status.Content = "Done with Setup!";
} }
private void SetupNintendont() private void SetupNintendont()
{ {
status.Content = "Downloading Nintendon't...";
//https://dl.dropboxusercontent.com/cd/0/get/A4ZX24rC4DlmPAYDrj7mz9WIlmmnIu9YKh1IabTXG-l0Ftq4Ib-fyG8QYspNdv6lCOcu920AbyIdo8l2dNtoW2xydD3ycH2_B06pxATB-ROj27wDdJ0nls9gtSYmjSxMmq4/file?_download_id=8358710324855012068395852250129613778887389747613992530573453088&_notify_domain=www.dropbox.com&dl=1 MainViewModel mvm = FindResource("mvm") as MainViewModel;
mvm.msg = "";
mvm.msg = "Downloading Nintendont...";
if (Directory.Exists(@"bin\tempsd")) if (Directory.Exists(@"bin\tempsd"))
{ {
Directory.Delete(@"bin\tempsd", true); Directory.Delete(@"bin\tempsd", true);
} }
Directory.CreateDirectory(@"bin\tempsd"); Directory.CreateDirectory(@"bin\tempsd");
var client = new WebClient(); var client = new WebClient();
client.DownloadFile("https://dl.dropbox.com/s/wvgdn8j4d1725aj/Nintendont%26Forwarder.zip?dl=1", @"bin\tempsd\nintendont.zip"); client.DownloadFile("https://dl.dropbox.com/s/3swnsatmautzlk4/Nintendont.zip?dl=1", @"bin\tempsd\nintendont.zip");
using(FileStream s = new FileStream(@"bin\tempsd\nintendont.zip", FileMode.Open, FileAccess.ReadWrite)) using(FileStream s = new FileStream(@"bin\tempsd\nintendont.zip", FileMode.Open, FileAccess.ReadWrite))
{ {
ZipArchive z = new ZipArchive(s); ZipArchive z = new ZipArchive(s);
z.ExtractToDirectory(@"bin\tempsd\nintendont"); z.ExtractToDirectory(@"bin\tempsd\nintendont");
s.Close(); s.Close();
} }
status.Content = "Setting up Nintendon't..."; mvm.msg = "Setting up Nintendon't...";
if (!File.Exists(driveletter+ "\\nincfg.bin")) if (!File.Exists(driveletter+ "\\nincfg.bin"))
{ {
File.Copy(@"bin\tempsd\nintendont\nincfg.bin", driveletter + @"\nincfg.bin"); File.Copy(@"bin\tempsd\nintendont\nincfg.bin", driveletter + @"\nincfg.bin");
} }
DirectoryCopy(@"bin\tempsd\nintendont\apps", driveletter + "\\apps", true); DirectoryCopy(@"bin\tempsd\nintendont\apps", driveletter + "\\apps", true);
DirectoryCopy(@"bin\tempsd\nintendont\games", driveletter + "\\games", true);
DirectoryCopy(@"bin\tempsd\nintendont\codes", driveletter + "\\codes", true); DirectoryCopy(@"bin\tempsd\nintendont\codes", driveletter + "\\codes", true);
Directory.Delete(@"bin\tempsd", true); Directory.Delete(@"bin\tempsd", true);
} }
private void CopyInject() private void CopyInject()
{ {
status.Content = "Copying Injected Game...";
MainViewModel mvm = FindResource("mvm") as MainViewModel; MainViewModel mvm = FindResource("mvm") as MainViewModel;
mvm.msg = "Copying Injected Game...";
if(path.Contains("[LOADIINE]") && !path.Contains("[WUP]")) if(path.Contains("[LOADIINE]") && !path.Contains("[WUP]"))
{ {
DirectoryCopy(System.IO.Path.Combine(path, mvm.foldername), driveletter + "\\wiiu\\games\\" + mvm.foldername, true); DirectoryCopy(System.IO.Path.Combine(path, mvm.foldername), driveletter + "\\wiiu\\games\\" + mvm.foldername, true);
@ -232,6 +261,8 @@ namespace UWUVCI_AIO_WPF.UI.Windows
} }
mvm.foldername = ""; mvm.foldername = "";
mvm.msg = "Done with Setup!";
} }
public static void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs) public static void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs)

View file

@ -22,7 +22,7 @@
<TextBox x:Name="tbKey" materialDesign:HintAssist.Hint="ENTER KEY" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,40,15,90" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18"/> <TextBox x:Name="tbKey" materialDesign:HintAssist.Hint="ENTER KEY" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,40,15,90" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18"/>
</StackPanel> </StackPanel>
<Button Content="Read from otp.bin" HorizontalAlignment="Left" Margin="10,103,0,0" VerticalAlignment="Top" Width="152" Click="Button_Click_2" Name="otp"/> <Button Content="Read from otp.bin" HorizontalAlignment="Left" Margin="10,103,0,0" VerticalAlignment="Top" Width="152" Click="Button_Click_2" Name="otp" Visibility="Hidden"/>
<Label HorizontalAlignment="Left" Height="100" Margin="7,92,0,-45" VerticalAlignment="Top" Name="or" FontSize="15"/> <Label HorizontalAlignment="Left" Height="100" Margin="7,92,0,-45" VerticalAlignment="Top" Name="or" FontSize="15"/>

View file

@ -42,6 +42,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{ {
Key.Text = "CommonKey"; Key.Text = "CommonKey";
region.Text = "WIIU"; region.Text = "WIIU";
otp.Visibility = Visibility.Visible;
} }
else else
{ {

View file

@ -204,6 +204,7 @@ namespace UWUVCI_AIO_WPF
mvm.prodcode = ""; mvm.prodcode = "";
mvm.foldername = ""; mvm.foldername = "";
mvm.jppatch = false; mvm.jppatch = false;
mvm.GC = false;
mvm.RemoveCreatedIMG(); mvm.RemoveCreatedIMG();
mvm.isDoneMW(); mvm.isDoneMW();