Bug fix: Crash if ExternalTool directory does not exists

As mentionned, this bug is fixed, it creates the directory if it does
not exists
+ ExternalTool code exemple is cloned from repo and added inot
ExternalTool folder
This commit is contained in:
Hathor86 2015-12-20 18:13:32 +01:00
parent 13418e963b
commit 1d10565992
2 changed files with 13 additions and 1 deletions

View File

@ -19,7 +19,7 @@ namespace BizHawk.Client.ApiHawk
{
#region Fields
private static FileSystemWatcher directoryMonitor = new FileSystemWatcher(Global.Config.PathEntries["Global", "External Tools"].Path, "*.dll");
private static FileSystemWatcher directoryMonitor;
private static List<ToolStripMenuItem> menuItems = new List<ToolStripMenuItem>();
#endregion
@ -31,6 +31,11 @@ namespace BizHawk.Client.ApiHawk
/// </summary>
static ExternalToolManager()
{
if(!Directory.Exists(Global.Config.PathEntries["Global", "External Tools"].Path))
{
Directory.CreateDirectory(Global.Config.PathEntries["Global", "External Tools"].Path);
}
directoryMonitor = new FileSystemWatcher(Global.Config.PathEntries["Global", "External Tools"].Path, "*.dll");
directoryMonitor.IncludeSubdirectories = false;
directoryMonitor.Created += DirectoryMonitor_Created;

View File

@ -46,6 +46,12 @@ rmdir /s /q temp\firmware
rmdir /s /q gitsucks
git --git-dir ../.git archive --format zip --output lua.zip master output/Lua
git --git-dir ../.git archive --format zip --output firmware.zip master output/Firmware
rem Getting externaltools example from my repo
rem I once talked about a dedicated repo for external tools, think about moving the exemple to it it it happend
git clone https://github.com/Hathor86/HelloWorld_BizHawkTool.git
git --git-dir HelloWorld_BizHawkTool/.git archive --format zip --output HelloWorld_BizHawkTool.zip master
rmdir /s /q HelloWorld_BizHawkTool
unzip lua.zip -d gitsucks
rem del lua.zip
move gitsucks\output\Lua temp
@ -64,6 +70,7 @@ upx -d *.exe
rem Patch up working dir with a few other things we want
mkdir ExternalTools
copy ..\HelloWorld_BizHawkTool.dll ExternalTools
copy ..\HelloWorld_BizHawkTool.zip ExternalTools
rem Build the final zip
..\zip.exe -X -9 -r ..\%NAME% . -i \*