From cb01ff1dc3c8bef006bf9e2e2ec6c4fe028a7aa9 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Mon, 28 Aug 2006 03:27:16 +0000 Subject: [PATCH] Fixed two minor annoyances 1) Paths in config file are now checked before building is attempted (prevents some potential crashes) 2) The compression routines can now handle spaces in the 'output' path --- installer/AMXXRelease/AMXXRelease.exe | Bin 28672 -> 32768 bytes installer/AMXXRelease/LinuxBuilder.cs | 4 +-- installer/AMXXRelease/Main.cs | 38 ++++++++++++++++++++++++++ installer/AMXXRelease/Win32Builder.cs | 2 +- 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/installer/AMXXRelease/AMXXRelease.exe b/installer/AMXXRelease/AMXXRelease.exe index c8d98224f4797faf64cc8f821b912cd60215e9f7..cf41e6a903bb957119e41a7938c533331de1a0fd 100755 GIT binary patch delta 3960 zcmb7H3vg7`8UD}Ry?3)uvMh%1sBE$!yDZtTkc0p!7#;~p3^pksr45*v0Lcj1^lk{R zDZ7le5?ZE)Gej(d1JX_fVMMpq$<#VBZJ9c#9c>x4rHG?L9V?|&JECoEzjN-rVMzd| zH?!aUzyJL2bN1d%`XWoGl}C0ryw>)QC1hR~$;aGGBWi*oXehf|O*t)iwV}@?vI~mK zy3S5Q!6;GI(!s-mdq#mLm?4^JeNpA(0HaPHz%h63z|E*2z4V8EVS zCT?o7IkPSQ(H!-p+sw;PMHlct7K9w*9n=%mr*nJZY&M@)6|P{-{E@;9 zYz@Cw7zLrcuV zJsODHXbWdW)5iWrgcySmQ6*A^r5NL7MIrW0zN#pg3d9vUhlV^veq~1<#+eAiM%Zf+ zP*=>OJ95kbc~R4($TD$hk$_<|c-=_TbDd_@MjT;MQlse=G*aE}Dk;_U!kd_n*Yu;K z%tbY&!dSF3Turf6jaBgR>n7u)#QTb(sfDmnB6k6!6o@mz8IzY@;llU{I)zq1;}mny zYoJU_fpM{-ug;P;XUPu^%ldwZNk7b8n*I~W-%&9~Wrr82C2(R~#eB-tp!aDk$-T7e zs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~ApV&uC8Ab^HwP~LxwVNxgP1%;#4rlgI z+b{K2V=qQ{jJ`!7qLPOxNjoS-&D2QsvnGM-oM`C2=N2DdH9FlA~&_dDb^LHD@gD`Y)?i5Pkpv diff --git a/installer/AMXXRelease/LinuxBuilder.cs b/installer/AMXXRelease/LinuxBuilder.cs index 64879408..bf14220d 100755 --- a/installer/AMXXRelease/LinuxBuilder.cs +++ b/installer/AMXXRelease/LinuxBuilder.cs @@ -40,9 +40,9 @@ public override void CompressDir(string target, string dir) if (m_Cfg.MakeOpts().IndexOf("amd64") != -1) - info.Arguments = "zcvf " + target + "_amd64.tar.gz " + file_list; + info.Arguments = "zcvf \"" + target + "_amd64.tar.gz\" " + file_list; else - info.Arguments = "zcvf " + target + ".tar.gz " + file_list; + info.Arguments = "zcvf \"" + target + ".tar.gz\" " + file_list; info.UseShellExecute = false; Process p = Process.Start(info); diff --git a/installer/AMXXRelease/Main.cs b/installer/AMXXRelease/Main.cs index 4846aaf6..efdb6cef 100755 --- a/installer/AMXXRelease/Main.cs +++ b/installer/AMXXRelease/Main.cs @@ -39,6 +39,9 @@ public void Release(string file) return; } + if (!ValidateConfigPaths()) + return; + ABuilder builder = null; if ((int)System.Environment.OSVersion.Platform == 128) { @@ -53,6 +56,41 @@ public void Release(string file) builder.Build(m_Cfg, build); } + + private bool ValidateConfigPaths() + { + if ( !File.Exists( ABuilder.PropSlashes(m_Cfg.CompressPath()) ) ) + { + Console.WriteLine("Failed to find compression program! Check 'compress' option in config."); + return false; + } + + string source = ABuilder.PropSlashes(m_Cfg.GetSourceTree()); + + if (!Directory.Exists(source)) + { + Console.WriteLine("Failed to find source tree! Check 'source' option in config."); + return false; + } else { + // Check subdirectories of source tree to make sure they contain necessary directories + if (!Directory.Exists(ABuilder.PropSlashes(source + "\\amxmodx")) || + !Directory.Exists(ABuilder.PropSlashes(source + "\\configs")) || + !Directory.Exists(ABuilder.PropSlashes(source + "\\dlls")) || + !Directory.Exists(ABuilder.PropSlashes(source + "\\plugins"))) + { + Console.WriteLine("Source tree appears invalid! Check 'source' option in config."); + return false; + } + } + + if ( !File.Exists( ABuilder.PropSlashes(m_Cfg.DevenvPath()) ) ) + { + Console.WriteLine("Failed to find compilation program! Check 'devenv' option in config."); + return false; + } + + return true; + } } } diff --git a/installer/AMXXRelease/Win32Builder.cs b/installer/AMXXRelease/Win32Builder.cs index dcf7ecda..5f2c12b2 100755 --- a/installer/AMXXRelease/Win32Builder.cs +++ b/installer/AMXXRelease/Win32Builder.cs @@ -20,7 +20,7 @@ public override void CompressDir(string target, string dir) info.FileName = m_Cfg.CompressPath(); info.WorkingDirectory = dir; - info.Arguments = "-r " + target + ".zip " + "*.*"; + info.Arguments = "-r \"" + target + ".zip\" " + "*.*"; info.UseShellExecute = false; Process p = Process.Start(info);