diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2018-03-18 22:16:45 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2018-03-18 22:16:45 +0300 |
commit | 24fa428ca37e385b9b85dc8b959c0d513e9074d3 (patch) | |
tree | a4ac6dee3f8f6840d66c037563b38ea3aeffe6d2 | |
parent | 00574c40c0636e64b3d794b4beef7b19eeba4516 (diff) |
Minor fixes
-rw-r--r-- | MainForm.cs | 1 | ||||
-rw-r--r-- | Properties/AssemblyInfo.cs | 4 | ||||
-rw-r--r-- | WorkerForm.cs | 47 | ||||
-rw-r--r-- | hakchi_gui.csproj | 16 |
4 files changed, 41 insertions, 27 deletions
diff --git a/MainForm.cs b/MainForm.cs index 13ed0579..d6b2c9de 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -1726,6 +1726,7 @@ namespace com.clusterrr.hakchi_gui {
try
{
+ Thread.Sleep(5000);
showProcess.WaitForExit();
}
catch { }
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 5e0a89e7..3b5ec96d 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ using System.Resources; // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.0.30.14")]
-[assembly: AssemblyFileVersion("2.0.30.14")]
+[assembly: AssemblyVersion("2.0.30.15")]
+[assembly: AssemblyFileVersion("2.0.30.15")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]
diff --git a/WorkerForm.cs b/WorkerForm.cs index 2b353e90..1d97593a 100644 --- a/WorkerForm.cs +++ b/WorkerForm.cs @@ -478,7 +478,8 @@ namespace com.clusterrr.hakchi_gui {
// Unknown MD5? Hmm... Lets extract ramfs and check keyfile!
string kernelDumpTemp = Path.Combine(tempDirectory, "kernel.img");
- Directory.CreateDirectory(tempDirectory);
+ if (!Directory.Exists(tempDirectory))
+ Directory.CreateDirectory(tempDirectory);
File.WriteAllBytes(kernelDumpTemp, kernel);
UnpackRamfs(kernelDumpTemp);
var key = File.ReadAllBytes(Path.Combine(ramfsDirectory, "key-file"));
@@ -514,8 +515,8 @@ namespace com.clusterrr.hakchi_gui if (!matchedKernels.Contains(ConfigIni.ConsoleType))
throw new Exception(Resources.InvalidConsoleSelected + " " + matchedKernels.First());
}
-
- Directory.CreateDirectory(Path.GetDirectoryName(KernelDumpPath));
+ if (!Directory.Exists(Path.GetDirectoryName(KernelDumpPath)))
+ Directory.CreateDirectory(Path.GetDirectoryName(KernelDumpPath));
if (!File.Exists(KernelDumpPath))
File.WriteAllBytes(KernelDumpPath, kernel);
if (!string.IsNullOrEmpty(dumpPath))
@@ -658,7 +659,8 @@ namespace com.clusterrr.hakchi_gui SetProgress(maxProgress, maxProgress);
SetStatus(Resources.Done);
- Directory.CreateDirectory(Path.GetDirectoryName(NandDump));
+ if (!Directory.Exists(Path.GetDirectoryName(NandDump)))
+ Directory.CreateDirectory(Path.GetDirectoryName(NandDump));
File.WriteAllBytes(NandDump, kernel);
}
@@ -901,8 +903,8 @@ namespace com.clusterrr.hakchi_gui tempGamesDirectory = Path.Combine(tempDirectory, "games");
if (exportGames)
tempGamesDirectory = Path.Combine(tempGamesDirectory, SubConsoleDirectory);
- Directory.CreateDirectory(tempDirectory);
- Directory.CreateDirectory(tempGamesDirectory);
+ if (!Directory.Exists(tempGamesDirectory))
+ Directory.CreateDirectory(tempGamesDirectory);
File.WriteAllBytes(Path.Combine(tempGamesDirectory, ".repair.flag"), new byte[0]);
Dictionary<string, string> originalGames = new Dictionary<string, string>();
var stats = new GamesTreeStats();
@@ -956,7 +958,8 @@ namespace com.clusterrr.hakchi_gui SetStatus(Resources.WritingUSB);
maxProgress = (int)(stats.TotalSize / 1024 / 1024 + 20);
SetProgress(progress, maxProgress);
- Directory.CreateDirectory(exportDirectory);
+ if (!Directory.Exists(exportDirectory))
+ Directory.CreateDirectory(exportDirectory);
string lastDirectory = null;
long pos = 0;
if (!ExecuteTool("rsync.exe", $"-ac --delete --progress --exclude=title.fnt --exclude=copyright.fnt \"{cygwinPath(tempGamesDirectory)}\" \"{cygwinPath(exportDirectory)}\"",
@@ -1234,9 +1237,12 @@ namespace com.clusterrr.hakchi_gui private void UnpackRamfs(string kernelPath = null)
{
- Directory.CreateDirectory(tempDirectory);
- Directory.CreateDirectory(kernelDirectory);
- Directory.CreateDirectory(ramfsDirectory);
+ if (!Directory.Exists(tempDirectory))
+ Directory.CreateDirectory(tempDirectory);
+ if (!Directory.Exists(kernelDirectory))
+ Directory.CreateDirectory(kernelDirectory);
+ if (!Directory.Exists(ramfsDirectory))
+ Directory.CreateDirectory(ramfsDirectory);
string tempKernelDump = Path.Combine(tempDirectory, "kernel.img");
if ((kernelPath ?? KernelDumpPath) != tempKernelDump)
File.Copy(kernelPath ?? KernelDumpPath, tempKernelDump, true);
@@ -1276,7 +1282,8 @@ namespace com.clusterrr.hakchi_gui if (hmodsInstall != null && hmodsInstall.Count() > 0)
{
- Directory.CreateDirectory(tempHmodsDirectory);
+ if (!Directory.Exists(tempHmodsDirectory))
+ Directory.CreateDirectory(tempHmodsDirectory);
foreach (var hmod in hmodsInstall)
{
var modName = hmod + ".hmod";
@@ -1297,7 +1304,8 @@ namespace com.clusterrr.hakchi_gui }
if (hmodsUninstall != null && hmodsUninstall.Count() > 0)
{
- Directory.CreateDirectory(tempHmodsDirectory);
+ if (!Directory.Exists(tempHmodsDirectory))
+ Directory.CreateDirectory(tempHmodsDirectory);
var mods = new StringBuilder();
foreach (var hmod in hmodsUninstall)
mods.AppendFormat("{0}.hmod\n", hmod);
@@ -1370,7 +1378,8 @@ namespace com.clusterrr.hakchi_gui var originalCode = game.Code;
var desktopFilePath = Path.Combine(desktopEntriesPath, $"{originalCode}.desktop");
var targetGamePath = Path.Combine(targetDirectory, originalCode);
- Directory.CreateDirectory(targetGamePath);
+ if (!Directory.Exists(targetGamePath))
+ Directory.CreateDirectory(targetGamePath);
if (exportGames) // Copy back to reduce repeative original games repair
{
var realTargetGamePath = Path.Combine(Path.Combine(Path.Combine(exportDirectory, SubConsoleDirectory), string.Format("{0:D3}", menuIndex)), originalCode);
@@ -1380,10 +1389,12 @@ namespace com.clusterrr.hakchi_gui throw new Exception("Can't rsync to USB drive");
}
}
- Directory.CreateDirectory(Path.Combine(targetGamePath, "autoplay"));
+ if (!Directory.Exists(Path.Combine(targetGamePath, "autoplay")))
+ Directory.CreateDirectory(Path.Combine(targetGamePath, "autoplay"));
if (ConfigIni.ConsoleType == MainForm.ConsoleType.NES || ConfigIni.ConsoleType == MainForm.ConsoleType.Famicom)
{
- Directory.CreateDirectory(Path.Combine(targetGamePath, "pixelart"));
+ if (!Directory.Exists(Path.Combine(targetGamePath, "pixelart")))
+ Directory.CreateDirectory(Path.Combine(targetGamePath, "pixelart"));
}
File.Copy(desktopFilePath, Path.Combine(targetGamePath, $"{originalCode}.desktop"), true);
var gameSize = NesMiniApplication.DirectorySize(targetGamePath);
@@ -1612,7 +1623,8 @@ namespace com.clusterrr.hakchi_gui )
{
tmp = Path.Combine(Path.GetTempPath(), fileName);
- Directory.CreateDirectory(tmp);
+ if (!Directory.Exists(tmp))
+ Directory.CreateDirectory(tmp);
szExtractor.ExtractArchive(tmp);
fileName = Path.Combine(tmp, fileName);
}
@@ -1677,7 +1689,8 @@ namespace com.clusterrr.hakchi_gui listViewItem.Checked = selected.Contains("default");
games.Add(listViewItem);
- Directory.CreateDirectory(NesMiniApplication.GamesDirectory);
+ if (!Directory.Exists(NesMiniApplication.GamesDirectory))
+ Directory.CreateDirectory(NesMiniApplication.GamesDirectory);
var gameDirs = Directory.GetDirectories(NesMiniApplication.GamesDirectory);
int progress = 0;
var maxProgress = gameDirs.Length;
diff --git a/hakchi_gui.csproj b/hakchi_gui.csproj index 2b468c65..ca44aaa0 100644 --- a/hakchi_gui.csproj +++ b/hakchi_gui.csproj @@ -31,8 +31,8 @@ <PublisherName>Alexey %27Cluster%27 Avdyukhin</PublisherName>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>index.html</WebPage>
- <ApplicationRevision>13</ApplicationRevision>
- <ApplicationVersion>2.0.30.13</ApplicationVersion>
+ <ApplicationRevision>15</ApplicationRevision>
+ <ApplicationVersion>2.0.30.15</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
@@ -2912,32 +2912,32 @@ <ItemGroup>
<PublishFile Include="data\GameGenieDB.xml">
<Visible>False</Visible>
+ <PublishState>Include</PublishState>
+ <IncludeHash>True</IncludeHash>
<Group>
</Group>
<TargetPath>
</TargetPath>
- <PublishState>Include</PublishState>
- <IncludeHash>True</IncludeHash>
<FileType>File</FileType>
</PublishFile>
<PublishFile Include="data\nescarts.xml">
<Visible>False</Visible>
+ <PublishState>Include</PublishState>
+ <IncludeHash>True</IncludeHash>
<Group>
</Group>
<TargetPath>
</TargetPath>
- <PublishState>Include</PublishState>
- <IncludeHash>True</IncludeHash>
<FileType>File</FileType>
</PublishFile>
<PublishFile Include="data\snescarts.xml">
<Visible>False</Visible>
+ <PublishState>Include</PublishState>
+ <IncludeHash>True</IncludeHash>
<Group>
</Group>
<TargetPath>
</TargetPath>
- <PublishState>Include</PublishState>
- <IncludeHash>True</IncludeHash>
<FileType>File</FileType>
</PublishFile>
</ItemGroup>
|