still working on auto-mode

This commit is contained in:
Jakob 2018-07-06 02:04:14 +02:00
parent 8fc1739a34
commit 0b3e8e8523
20 changed files with 151 additions and 3 deletions

View file

@ -50,6 +50,16 @@ namespace h_encore_auto
private void buttonStart_Click(object sender, RoutedEventArgs e) private void buttonStart_Click(object sender, RoutedEventArgs e)
{ {
Process[] pname = Process.GetProcessesByName("qcma");
if (pname.Length != 0)
{
foreach (var proc in pname)
{
proc.Kill();
}
MessageBox.Show("QCMA was closed, since this application has to interact with it.");
}
// 7ZIP Download and extraction // 7ZIP Download and extraction
Util.dlFile(Ref.url7zr, "7zr.exe"); Util.dlFile(Ref.url7zr, "7zr.exe");
Util.dlFile(Ref.url7za, "7z-extra.7z"); Util.dlFile(Ref.url7za, "7z-extra.7z");
@ -157,12 +167,33 @@ namespace h_encore_auto
process.Start(); process.Start();
process.WaitForExit(); process.WaitForExit();
startInfo.Arguments = @" / C reg import " + pathImportReg; startInfo.Arguments = @" /C reg import " + pathImportReg;
process.StartInfo = startInfo; process.StartInfo = startInfo;
process.Start(); process.Start();
process.WaitForExit(); process.WaitForExit();
} }
startInfo.Arguments = @"/C " + pathQcmaExtracted + "qcma.exe";
process.StartInfo = startInfo;
process.Start();
for (; ; )
{
var guide = new VitaGuide();
guide.ShowDialog();
if (Util.IsDirectoryEmpty(pathQcmaRes + "PSVita\\APP\\"))
{
MessageBox.Show("Required folder not found. \nMake sure you did everything correctly and follow the steps again.");
}
else
{
break;
}
}
shortAID = Directory.GetDirectories(pathQcmaRes + "PSVita\\APP\\")[0];
} }
} }

View file

@ -4,6 +4,7 @@ using System.Net.Http;
using System.IO; using System.IO;
using System.Windows.Markup; using System.Windows.Markup;
using System.Windows; using System.Windows;
using System.Collections.Generic;
namespace h_encore_auto namespace h_encore_auto
{ {
@ -60,5 +61,13 @@ namespace h_encore_auto
Util.DeleteDirectory(Ref.tempDir); Util.DeleteDirectory(Ref.tempDir);
System.Environment.Exit(0); System.Environment.Exit(0);
} }
public static bool IsDirectoryEmpty(string path)
{
IEnumerable<string> items = Directory.EnumerateFileSystemEntries(path);
using (IEnumerator<string> en = items.GetEnumerator())
{
return !en.MoveNext();
}
}
} }
} }

View file

@ -0,0 +1,17 @@
<Window x:Class="h_encore_auto.VitaGuide"
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="VitaGuide" Height="450" Width="920.633" ResizeMode="CanMinimize">
<Grid>
<Image x:Name="imgFrame" Height="355" Margin="10,10,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="626"/>
<TextBlock HorizontalAlignment="Left" Margin="641,165,0,0" TextWrapping="Wrap" Text="On your Vita, open the Content Manager." VerticalAlignment="Top" Height="64" Width="264" FontSize="22"/>
<Button x:Name="buttonFwd" Content="&gt;" Margin="482,361,0,0" VerticalAlignment="Top" Height="50" FontSize="36" Click="buttonFwd_Click" HorizontalAlignment="Left" Width="50"/>
<Button x:Name="buttonBck" Content="&lt;" Margin="383,361,0,0" VerticalAlignment="Top" Height="50" FontSize="36" HorizontalAlignment="Left" Width="50" Click="buttonBck_Click" IsEnabled="False"/>
<Button x:Name="buttonDone" Content="Done" HorizontalAlignment="Left" Margin="802,361,0,0" VerticalAlignment="Top" Width="103" Height="50" FontSize="24" IsCancel="True" IsDefault="True"/>
</Grid>
</Window>

View file

@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
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 VitaGuide.xaml
/// </summary>
public partial class VitaGuide : Window
{
int currImg = 1;
public VitaGuide()
{
InitializeComponent();
imgFrame.Source = new BitmapImage(new Uri("/img/1.png", UriKind.Relative));
currImg = 1;
buttonDone.Visibility = Visibility.Hidden;
}
private void buttonFwd_Click(object sender, RoutedEventArgs e)
{
currImg++;
imgFrame.Source = new BitmapImage(new Uri("/img/" + currImg + ".png", UriKind.Relative));
buttonBck.IsEnabled = true;
if (currImg == 14)
{
buttonFwd.IsEnabled = false;
buttonDone.Visibility = Visibility.Visible;
}
else
{
buttonFwd.IsEnabled = true;
}
}
private void buttonBck_Click(object sender, RoutedEventArgs e)
{
currImg--;
imgFrame.Source = new BitmapImage(new Uri("/img/" + currImg + ".png", UriKind.Relative));
buttonFwd.IsEnabled = true;
if (currImg == 1)
{
buttonBck.IsEnabled = false;
}
else
{
buttonBck.IsEnabled = true;
}
}
}
}

View file

@ -84,6 +84,9 @@
</Compile> </Compile>
<Compile Include="Ref.cs" /> <Compile Include="Ref.cs" />
<Compile Include="Util.cs" /> <Compile Include="Util.cs" />
<Compile Include="VitaGuide.xaml.cs">
<DependentUpon>VitaGuide.xaml</DependentUpon>
</Compile>
<Page Include="AutoMode.xaml"> <Page Include="AutoMode.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@ -100,6 +103,10 @@
<DependentUpon>MainWindow.xaml</DependentUpon> <DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Page Include="VitaGuide.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
@ -138,6 +145,23 @@
<Install>false</Install> <Install>false</Install>
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="img\1.png" />
<Resource Include="img\11.png" />
<Resource Include="img\12.png" />
<Resource Include="img\13.png" />
<Resource Include="img\14.png" />
<Resource Include="img\2.png" />
<Resource Include="img\3.png" />
<Resource Include="img\4.png" />
<Resource Include="img\5.png" />
<Resource Include="img\6.png" />
<Resource Include="img\7.png" />
<Resource Include="img\8.png" />
<Resource Include="img\9.PNG" />
<Resource Include="img\10.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>

BIN
h-encore-auto/img/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

BIN
h-encore-auto/img/10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
h-encore-auto/img/11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
h-encore-auto/img/12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
h-encore-auto/img/13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
h-encore-auto/img/14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

BIN
h-encore-auto/img/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
h-encore-auto/img/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
h-encore-auto/img/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
h-encore-auto/img/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
h-encore-auto/img/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
h-encore-auto/img/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
h-encore-auto/img/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
h-encore-auto/img/9.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

View file

@ -11,8 +11,10 @@ namespace h_encore_auto
public static readonly string urlEntry = "http://ares.dl.playstation.net/cdn/JP0741/PCSG90096_00/xGMrXOkORxWRyqzLMihZPqsXAbAXLzvAdJFqtPJLAZTgOcqJobxQAhLNbgiFydVlcmVOrpZKklOYxizQCRpiLfjeROuWivGXfwgkq.pkg"; public static readonly string urlEntry = "http://ares.dl.playstation.net/cdn/JP0741/PCSG90096_00/xGMrXOkORxWRyqzLMihZPqsXAbAXLzvAdJFqtPJLAZTgOcqJobxQAhLNbgiFydVlcmVOrpZKklOYxizQCRpiLfjeROuWivGXfwgkq.pkg";
public static readonly string url7zr = "https://www.7-zip.org/a/7zr.exe"; public static readonly string url7zr = "https://www.7-zip.org/a/7zr.exe";
public static readonly string url7za = "https://www.7-zip.org/a/7z1805-extra.7z"; public static readonly string url7za = "https://www.7-zip.org/a/7z1805-extra.7z";
public static readonly string urlQcma = "https://github.com/fyr77/ZUGABE/blob/master/download-resources/Qcma.zip?raw=true"; public static readonly string urlQcma = "https://raw.githubusercontent.com/fyr77/ZUGABE/master/download-resources/Qcma.zip";
public static readonly string urlReg = ""; public static readonly string urlReg = "https://raw.githubusercontent.com/fyr77/ZUGABE/master/download-resources/qcma.reg";
public static readonly string pathCurrPic = "img/1.png";
public static readonly string tempDir = Path.GetTempPath() + @"encore_temp\"; public static readonly string tempDir = Path.GetTempPath() + @"encore_temp\";