working on automatic mode
This commit is contained in:
parent
6745d9a91d
commit
c0b78f240b
7 changed files with 123 additions and 22 deletions
BIN
download-resources/Qcma.zip
Normal file
BIN
download-resources/Qcma.zip
Normal file
Binary file not shown.
13
h-encore-auto/AutoMode.xaml
Normal file
13
h-encore-auto/AutoMode.xaml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<Window x:Class="h_encore_auto.AutoMode"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:h_encore_auto"
|
||||
mc:Ignorable="d"
|
||||
Title="AutoMode" Height="512" Width="512" ResizeMode="CanMinimize" Closed="Window_Closed">
|
||||
<Grid>
|
||||
<Button x:Name="buttonStart" Content="Start!" Margin="120,109,0,0" Width="266" Height="265" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="72" FontFamily="Lato" Click="buttonStart_Click"/>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
69
h-encore-auto/AutoMode.xaml.cs
Normal file
69
h-encore-auto/AutoMode.xaml.cs
Normal file
|
@ -0,0 +1,69 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace h_encore_auto
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for AutoMode.xaml
|
||||
/// </summary>
|
||||
public partial class AutoMode : Window
|
||||
{
|
||||
public AutoMode()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
string ProgramFilesx86 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
|
||||
string ProgramFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
|
||||
bool tempCreated = false;
|
||||
string longAID = null;
|
||||
string shortAID = null;
|
||||
string path7z = Ref.tempDir + "7za.exe";
|
||||
string pathPsvimg = Ref.tempDir + "psvimgtools.zip";
|
||||
string pathPkg = Ref.tempDir + "pkg2zip.zip";
|
||||
string pathEnc = Ref.tempDir + "h-encore.zip";
|
||||
string pathEntry = Ref.tempDir + "entryPoint.pkg";
|
||||
|
||||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
var newForm = new MainWindow();
|
||||
newForm.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
private void buttonStart_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 7ZIP Download and extraction
|
||||
Util.dlFile(Ref.url7zr, "7zr.exe");
|
||||
Util.dlFile(Ref.url7za, "7z-extra.7z");
|
||||
|
||||
Process process = new Process();
|
||||
ProcessStartInfo startInfo = new ProcessStartInfo();
|
||||
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
startInfo.FileName = "cmd.exe";
|
||||
startInfo.WorkingDirectory = Ref.tempDir;
|
||||
|
||||
startInfo.Arguments = "/C 7zr.exe x 7z-extra.7z";
|
||||
process.StartInfo = startInfo;
|
||||
process.Start();
|
||||
process.WaitForExit();
|
||||
|
||||
//Rest of the tool downloads
|
||||
Util.dlFile(Ref.urlPsvimg, "psvimgtools.zip");
|
||||
Util.dlFile(Ref.urlPkg, "pkg2zip.zip");
|
||||
Util.dlFile(Ref.urlEnc, "h-encore.zip");
|
||||
Util.dlFile(Ref.urlEntry, "entryPoint.pkg");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,28 +5,29 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:h_encore_auto"
|
||||
mc:Ignorable="d"
|
||||
Title="h-encore-auto" Width="789.733" Height="391.819">
|
||||
Title="ZUGABE" Width="789.733" Height="403.621" ResizeMode="CanMinimize" Closed="Window_Closed">
|
||||
<Grid>
|
||||
<TextBox x:Name="boxPath7z" HorizontalAlignment="Left" Height="20" Margin="10,50,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="559"/>
|
||||
<Button x:Name="button7zFile" Content="Local File" HorizontalAlignment="Left" Margin="687,50,0,0" VerticalAlignment="Top" Width="75" Click="button7zFile_Click"/>
|
||||
<TextBox x:Name="boxPath7z" Margin="10,50,213,0" TextWrapping="Wrap" Height="20" VerticalAlignment="Top"/>
|
||||
<Button x:Name="button7zFile" Content="Local File" Margin="687,50,20,0" Click="button7zFile_Click" Height="20" VerticalAlignment="Top"/>
|
||||
<Label Content="7za.exe:" HorizontalAlignment="Left" Margin="10,19,0,0" VerticalAlignment="Top"/>
|
||||
<Label Content="psvimgtools.zip:" HorizontalAlignment="Left" Margin="10,75,0,0" VerticalAlignment="Top" Height="26"/>
|
||||
<TextBox x:Name="boxPathPsvimg" HorizontalAlignment="Left" Height="20" Margin="10,106,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="559"/>
|
||||
<Button x:Name="buttonPsvimgDL" Content="Download" HorizontalAlignment="Left" Margin="593,106,0,0" VerticalAlignment="Top" Width="75" Click="buttonPsvimgDL_Click"/>
|
||||
<Button x:Name="buttonPsvimgFile" Content="Local File" HorizontalAlignment="Left" Margin="687,106,0,0" VerticalAlignment="Top" Width="75" Click="buttonPsvimgFile_Click"/>
|
||||
<TextBox x:Name="boxPathPsvimg" Margin="10,106,213,0" TextWrapping="Wrap" Height="20" VerticalAlignment="Top"/>
|
||||
<Button x:Name="buttonPsvimgDL" Content="Download" Margin="593,106,114,0" Click="buttonPsvimgDL_Click" Height="20" VerticalAlignment="Top"/>
|
||||
<Button x:Name="buttonPsvimgFile" Content="Local File" Margin="687,106,20,0" Click="buttonPsvimgFile_Click" Height="20" VerticalAlignment="Top"/>
|
||||
<Label Content="pkg2zip.zip:" HorizontalAlignment="Left" Margin="10,131,0,0" VerticalAlignment="Top"/>
|
||||
<TextBox x:Name="boxPathPkg" HorizontalAlignment="Left" Height="20" Margin="10,162,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="559"/>
|
||||
<Button x:Name="buttonPkgDL" Content="Download" HorizontalAlignment="Left" Margin="593,162,0,0" VerticalAlignment="Top" Width="75" Click="buttonPkgDL_Click"/>
|
||||
<Button x:Name="buttonPkgFile" Content="Local File" HorizontalAlignment="Left" Margin="687,162,0,0" VerticalAlignment="Top" Width="75" Click="buttonPkgFile_Click"/>
|
||||
<TextBox x:Name="boxPathPkg" Margin="10,162,213,0" TextWrapping="Wrap" Height="20" VerticalAlignment="Top"/>
|
||||
<Button x:Name="buttonPkgDL" Content="Download" Margin="593,162,114,0" Click="buttonPkgDL_Click" Height="20" VerticalAlignment="Top"/>
|
||||
<Button x:Name="buttonPkgFile" Content="Local File" Margin="687,162,20,0" Click="buttonPkgFile_Click" Height="20" VerticalAlignment="Top"/>
|
||||
<Label Content="h-encore.zip:" HorizontalAlignment="Left" Margin="10,187,0,0" VerticalAlignment="Top"/>
|
||||
<TextBox x:Name="boxPathEnc" HorizontalAlignment="Left" Height="20" Margin="10,218,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="559"/>
|
||||
<Button x:Name="buttonEncDL" Content="Download" HorizontalAlignment="Left" Margin="593,218,0,0" VerticalAlignment="Top" Width="75" Click="buttonEncDL_Click"/>
|
||||
<Button x:Name="buttonEncFile" Content="Local File" HorizontalAlignment="Left" Margin="687,218,0,0" VerticalAlignment="Top" Width="75" Click="buttonEncFile_Click"/>
|
||||
<TextBox x:Name="boxPathEnc" Margin="10,218,213,0" TextWrapping="Wrap" Height="20" VerticalAlignment="Top"/>
|
||||
<Button x:Name="buttonEncDL" Content="Download" Margin="593,218,114,0" Click="buttonEncDL_Click" Height="20" VerticalAlignment="Top"/>
|
||||
<Button x:Name="buttonEncFile" Content="Local File" Margin="687,218,20,0" Click="buttonEncFile_Click" Height="20" VerticalAlignment="Top"/>
|
||||
<Label Content="Bitter Smile pkg:" HorizontalAlignment="Left" Margin="10,243,0,0" VerticalAlignment="Top"/>
|
||||
<TextBox x:Name="boxPathEntry" HorizontalAlignment="Left" Height="20" Margin="10,269,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="559"/>
|
||||
<Button x:Name="buttonEntryDL" Content="Download" HorizontalAlignment="Left" Margin="593,269,0,0" VerticalAlignment="Top" Width="75" Click="buttonEntryDL_Click"/>
|
||||
<Button x:Name="buttonEntryFile" Content="Local File" HorizontalAlignment="Left" Margin="687,269,0,0" VerticalAlignment="Top" Width="75" Click="buttonEntryFile_Click"/>
|
||||
<Button x:Name="buttonZipDL" Content="Download" HorizontalAlignment="Left" Margin="593,50,0,0" VerticalAlignment="Top" Width="75" Click="buttonZipDL_Click"/>
|
||||
<Button x:Name="buttonGo" Content="Go!" Margin="213,314,213,0" VerticalAlignment="Top" Height="38" Click="buttonGo_Click"/>
|
||||
<TextBox x:Name="boxPathEntry" Margin="10,269,213,0" TextWrapping="Wrap" Height="20" VerticalAlignment="Top"/>
|
||||
<Button x:Name="buttonEntryDL" Content="Download" Margin="593,269,114,0" Click="buttonEntryDL_Click" Height="20" VerticalAlignment="Top"/>
|
||||
<Button x:Name="buttonEntryFile" Content="Local File" Margin="687,269,20,0" Click="buttonEntryFile_Click" Height="20" VerticalAlignment="Top"/>
|
||||
<Button x:Name="buttonZipDL" Content="Download" Margin="593,50,114,0" Click="buttonZipDL_Click" Height="20" VerticalAlignment="Top"/>
|
||||
<Button x:Name="buttonGo" Content="Go!" Margin="406,313,20,0" Click="buttonGo_Click" Height="38" VerticalAlignment="Top"/>
|
||||
<Button x:Name="buttonAuto" Content="Automatic Mode (BETA)" HorizontalAlignment="Left" Margin="13,313,0,0" VerticalAlignment="Top" Width="178" Height="38" FontFamily="Source Code Pro Black" Click="buttonAuto_Click"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
@ -327,5 +327,17 @@ namespace h_encore_auto
|
|||
boxPathEntry.Text = path;
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonAuto_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var newForm = new AutoMode();
|
||||
newForm.Show();
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
Util.cleanup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.IO;
|
||||
using System.Windows.Markup;
|
||||
using System.Windows;
|
||||
|
@ -9,7 +9,7 @@ namespace h_encore_auto
|
|||
{
|
||||
public class Util
|
||||
{
|
||||
private static WebClient web = new WebClient();
|
||||
private static WebClient web = new WebClient();
|
||||
private static HttpClient http = new HttpClient();
|
||||
|
||||
public static string GetEncKey(string aid)
|
||||
|
@ -58,7 +58,6 @@ namespace h_encore_auto
|
|||
public static void cleanup()
|
||||
{
|
||||
Util.DeleteDirectory(Ref.tempDir);
|
||||
MessageBox.Show("Done.");
|
||||
System.Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,8 +79,15 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="AutoMode.xaml.cs">
|
||||
<DependentUpon>AutoMode.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Ref.cs" />
|
||||
<Compile Include="Util.cs" />
|
||||
<Page Include="AutoMode.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
|
Reference in a new issue