From cc393d0e8d90b3f278e053564184274649a5b446 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 2 Aug 2005 06:28:41 +0000 Subject: [PATCH] committed C# releaser --- installer/AMXXRelease/ABuild.cs | 30 ++ installer/AMXXRelease/AMXXRelease.csproj | 159 ++++++++++ installer/AMXXRelease/AMXXRelease.csproj.user | 48 +++ installer/AMXXRelease/AMXXRelease.sln | 21 ++ installer/AMXXRelease/AMod.cs | 104 +++++++ installer/AMXXRelease/App.ico | Bin 0 -> 1078 bytes installer/AMXXRelease/AssemblyInfo.cs | 58 ++++ installer/AMXXRelease/Builder.cs | 282 ++++++++++++++++++ installer/AMXXRelease/Config.cs | 34 +++ installer/AMXXRelease/CoreMod.cs | 132 ++++++++ installer/AMXXRelease/ModCstrike.cs | 60 ++++ installer/AMXXRelease/ModDoD.cs | 51 ++++ installer/AMXXRelease/ModEsf.cs | 30 ++ installer/AMXXRelease/ModNs.cs | 39 +++ installer/AMXXRelease/ModTFC.cs | 43 +++ installer/AMXXRelease/ModTs.cs | 47 +++ installer/AMXXRelease/Release15.cs | 34 +++ 17 files changed, 1172 insertions(+) create mode 100755 installer/AMXXRelease/ABuild.cs create mode 100755 installer/AMXXRelease/AMXXRelease.csproj create mode 100755 installer/AMXXRelease/AMXXRelease.csproj.user create mode 100755 installer/AMXXRelease/AMXXRelease.sln create mode 100755 installer/AMXXRelease/AMod.cs create mode 100755 installer/AMXXRelease/App.ico create mode 100755 installer/AMXXRelease/AssemblyInfo.cs create mode 100755 installer/AMXXRelease/Builder.cs create mode 100755 installer/AMXXRelease/Config.cs create mode 100755 installer/AMXXRelease/CoreMod.cs create mode 100755 installer/AMXXRelease/ModCstrike.cs create mode 100755 installer/AMXXRelease/ModDoD.cs create mode 100755 installer/AMXXRelease/ModEsf.cs create mode 100755 installer/AMXXRelease/ModNs.cs create mode 100755 installer/AMXXRelease/ModTFC.cs create mode 100755 installer/AMXXRelease/ModTs.cs create mode 100755 installer/AMXXRelease/Release15.cs diff --git a/installer/AMXXRelease/ABuild.cs b/installer/AMXXRelease/ABuild.cs new file mode 100755 index 00000000..a7a4b3a3 --- /dev/null +++ b/installer/AMXXRelease/ABuild.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections; + +namespace AMXXRelease +{ + /// + /// Summary description for ABuild. + /// + public abstract class ABuild + { + protected ArrayList m_Mods; + + public ABuild() + { + m_Mods = new ArrayList(); + } + + public abstract string GetName(); + + public virtual int GetMods() + { + return m_Mods.Count; + } + + public virtual AMod GetMod(int i) + { + return (AMod)m_Mods[i]; + } + } +} diff --git a/installer/AMXXRelease/AMXXRelease.csproj b/installer/AMXXRelease/AMXXRelease.csproj new file mode 100755 index 00000000..65006922 --- /dev/null +++ b/installer/AMXXRelease/AMXXRelease.csproj @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/installer/AMXXRelease/AMXXRelease.csproj.user b/installer/AMXXRelease/AMXXRelease.csproj.user new file mode 100755 index 00000000..686cccbe --- /dev/null +++ b/installer/AMXXRelease/AMXXRelease.csproj.user @@ -0,0 +1,48 @@ + + + + + + + + + + + + diff --git a/installer/AMXXRelease/AMXXRelease.sln b/installer/AMXXRelease/AMXXRelease.sln new file mode 100755 index 00000000..c118282f --- /dev/null +++ b/installer/AMXXRelease/AMXXRelease.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AMXXRelease", "AMXXRelease.csproj", "{60FE591C-FDC8-44B4-9AC1-CE3617450E31}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {60FE591C-FDC8-44B4-9AC1-CE3617450E31}.Debug.ActiveCfg = Debug|.NET + {60FE591C-FDC8-44B4-9AC1-CE3617450E31}.Debug.Build.0 = Debug|.NET + {60FE591C-FDC8-44B4-9AC1-CE3617450E31}.Release.ActiveCfg = Release|.NET + {60FE591C-FDC8-44B4-9AC1-CE3617450E31}.Release.Build.0 = Release|.NET + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/installer/AMXXRelease/AMod.cs b/installer/AMXXRelease/AMod.cs new file mode 100755 index 00000000..1d5bef6f --- /dev/null +++ b/installer/AMXXRelease/AMod.cs @@ -0,0 +1,104 @@ +using System; +using System.Diagnostics; +using System.Collections; + +namespace AMXXRelease +{ + public class Plugin + { + public string name; + public string source; + public string options; + public string outdir; + + public Plugin(string Name) + { + name = (string)Name.Clone(); + source = (string)Name.Clone(); + outdir = "plugins"; + } + } + + public class Module + { + public string sourcedir; + public string projname; + public string build; + public string bindir; + public string vcproj; + public string outdir; + + public Module() + { + build = "Release"; + outdir = "modules"; + } + + public Module(string name) + { + build = "Release"; + outdir = "modules"; + sourcedir = "dlls\\" + name; + projname = name + "_amxx"; + vcproj = name; + } + } + + public abstract class AMod + { + protected ArrayList m_Modules; + protected ArrayList m_Plugins; + + public abstract string GetName(); + + public virtual string GetBaseName() + { + return GetName(); + } + + public AMod() + { + m_Modules = new ArrayList(); + m_Plugins = new ArrayList(); + } + + public virtual bool CopyExtraFiles(string basedir, string sourcedir) + { + return true; + } + + public virtual string GetPluginDir() + { + return GetName(); + } + + public virtual int GetModules() + { + return m_Modules.Count; + } + + public virtual Module GetModule(int i) + { + return (Module)m_Modules[i]; + } + + public virtual int GetPlugins() + { + return m_Plugins.Count; + } + + public virtual Plugin GetPlugin(int i) + { + return (Plugin)m_Plugins[i]; + } + + public virtual Plugin AddPlugin(string name) + { + Plugin pl = new Plugin(name); + m_Plugins.Add(pl); + return pl; + } + } + + +} diff --git a/installer/AMXXRelease/App.ico b/installer/AMXXRelease/App.ico new file mode 100755 index 0000000000000000000000000000000000000000..3a5525fd794f7a7c5c8e6187f470ea3af38cd2b6 GIT binary patch literal 1078 zcmeHHJr05}7=1t!Hp3A*8IHkVf+j?-!eHY14Gtcw1Eb*_9>Bq^zETJ@GKj{_2j4$w zo9}xCh!8{T3=X##Skq>ikMjsvB|y%crWBM2iW(4pI}c%z6%lW!=~4v77#3{z!dmB1 z__&l)-{KUYR+|8|;wB^R|9ET$J@(@=#rd^=)qs85?vAy(PSF5CyNkus435LVkZ$rj zNw|JG-P7^hF<(;#o*Vk}5R#e|^13tBbQkeF?djULtvqyxd3<{9 literal 0 HcmV?d00001 diff --git a/installer/AMXXRelease/AssemblyInfo.cs b/installer/AMXXRelease/AssemblyInfo.cs new file mode 100755 index 00000000..9f89a328 --- /dev/null +++ b/installer/AMXXRelease/AssemblyInfo.cs @@ -0,0 +1,58 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/installer/AMXXRelease/Builder.cs b/installer/AMXXRelease/Builder.cs new file mode 100755 index 00000000..6a69f4dc --- /dev/null +++ b/installer/AMXXRelease/Builder.cs @@ -0,0 +1,282 @@ +using System; +using System.Diagnostics; +using System.IO; + +namespace AMXXRelease +{ + /// + /// Summary description for Class1. + /// + class Builder + { + public Config m_Cfg; + private string m_AmxxPc; + + public Builder() + { + m_Cfg = new Config(); + + m_AmxxPc = m_Cfg.GetSourceTree() + "\\plugins\\amxxpc.exe"; + } + + [STAThread] + static void Main(string[] args) + { + Builder b = new Builder(); + Release15 r15 = new Release15(); + + if (!b.Build(r15)) + { + System.Console.WriteLine("Build failed: " + r15.GetName()); + } + else + { + System.Console.WriteLine("Build succeeded!"); + } + + } + + public bool Build(ABuild build) + { + int num = build.GetMods(); + + AMod mod; + for (int i=0; i=0; i--) + { + if (input[i] == '\\' && i != input.Length-1) + { + return input.Substring(i+1, input.Length-i-1); + } + } + + return input; + } + + public bool BuildModModules(AMod mod) + { + int num = mod.GetModules(); + + Module module; + string binary, basedir; + + basedir = m_Cfg.OutputPath(); + basedir += "\\" + mod.GetName(); + + string dir; + for (int i=0; i + /// Summary description for Config. + /// + public class Config + { + public Config() + { + } + + public string GetSourceTree() + { + return "C:\\real\\code\\amxmodx"; + } + + public string OutputPath() + { + return "C:\\real\\done"; + } + + public string DevenvPath() + { + return "C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\IDE\\devenv.com"; + } + + public string PathToZip() + { + return "C:\\Windows\\zip.exe"; + } + } +} diff --git a/installer/AMXXRelease/CoreMod.cs b/installer/AMXXRelease/CoreMod.cs new file mode 100755 index 00000000..5b908900 --- /dev/null +++ b/installer/AMXXRelease/CoreMod.cs @@ -0,0 +1,132 @@ +using System; +using System.IO; + +namespace AMXXRelease +{ + public class CoreMod : AMod + { + public CoreMod() + { + AddModules(); + AddPlugins(); + } + + public override sealed string GetName() + { + return "base"; + } + + public override sealed string GetPluginDir() + { + return null; + } + + public override sealed string GetBaseName() + { + return null; + } + + public override sealed bool CopyExtraFiles(string basedir, string source) + { + //Create directory structures + string datadir = basedir + "\\data"; + + if (!Directory.Exists(datadir)) + Directory.CreateDirectory(datadir); + + File.Copy(source + "\\dlls\\geoip\\GeoIP.dat", + datadir + "\\GeoIP.dat", + true); + + Builder.CopyNormal(source + "\\plugins\\lang", datadir + "\\lang"); + + if (!Directory.Exists(basedir + "\\logs")) + Directory.CreateDirectory(basedir + "\\logs"); + + if (!Directory.Exists(basedir + "\\doc")) + Directory.CreateDirectory(basedir + "\\doc"); + + File.Copy(source + "\\doc\\amxmodx-doc.chm", + basedir + "\\doc\\amxmodx-doc.chm", + true); + + Builder.CopyNormal(source + "\\plugins\\include", basedir + "\\scripting\\include"); + + return true; + } + + private void AddPlugins() + { + AddPlugin("admin"); + + Plugin admin_sql = new Plugin("admin_sql"); + admin_sql.source = "admin"; + admin_sql.options = "USING_SQL=1 -oadmin_sql.amx"; + m_Plugins.Add(admin_sql); + + AddPlugin("adminchat"); + AddPlugin("admincmd"); + AddPlugin("adminhelp"); + AddPlugin("adminvote"); + AddPlugin("antiflood"); + AddPlugin("imessage"); + AddPlugin("mapchooser"); + AddPlugin("mapsmenu"); + AddPlugin("menufront"); + AddPlugin("multilingual"); + AddPlugin("nextmap"); + AddPlugin("pausecfg"); + AddPlugin("plmenu"); + AddPlugin("scrollmsg"); + AddPlugin("statscfg"); + AddPlugin("telemenu"); + AddPlugin("timeleft"); + AddPlugin("cmdmenu"); + } + + private void AddModules() + { + Module core = new Module(); + + core.bindir = "msvc"; + core.sourcedir = "amxmodx"; + core.vcproj = "amxmodx_mm"; + core.build = "JITRelease"; + core.projname = "amxmodx_mm"; + core.outdir = "dlls"; + + Module mysql = new Module(); + + mysql.sourcedir = "mysql"; + mysql.projname = "mysql_amxx"; + mysql.bindir = "mysql_amxx"; + mysql.vcproj = "mysql_amxx"; + + Module engine = new Module(); + engine.sourcedir = "engine"; + engine.projname = "engine_amxx"; + engine.vcproj = "engine"; + + Module fun = new Module(); + fun.sourcedir = "fun"; + fun.projname = "fun_amxx"; + fun.vcproj = "fun"; + + Module geoip = new Module("geoip"); + Module fakemeta = new Module("fakemeta"); + Module sockets = new Module("sockets"); + Module regex = new Module("regex"); + Module nvault = new Module("nvault"); + + m_Modules.Add(core); + m_Modules.Add(mysql); + m_Modules.Add(engine); + m_Modules.Add(fun); + m_Modules.Add(geoip); + m_Modules.Add(fakemeta); + m_Modules.Add(sockets); + m_Modules.Add(regex); + m_Modules.Add(nvault); + } + } +} diff --git a/installer/AMXXRelease/ModCstrike.cs b/installer/AMXXRelease/ModCstrike.cs new file mode 100755 index 00000000..8b00f1a0 --- /dev/null +++ b/installer/AMXXRelease/ModCstrike.cs @@ -0,0 +1,60 @@ +using System; +using System.IO; + +namespace AMXXRelease +{ + /// + /// Summary description for ModCstrike. + /// + public class ModCstrike : AMod + { + public ModCstrike() + { + AddModules(); + AddPlugins(); + } + + public override sealed string GetName() + { + return "cstrike"; + } + + private void AddPlugins() + { + AddPlugin("miscstats"); + AddPlugin("stats_logging"); + AddPlugin("statsx"); + AddPlugin("restmenu"); + + Plugin csstats = new Plugin("csstats"); + csstats.outdir = "data"; + m_Plugins.Add(csstats); + } + + public override sealed bool CopyExtraFiles(string basedir, string source) + { + File.Copy(source + "\\dlls\\csx\\source\\WinCSX\\Release\\WinCSX.exe", + basedir + "\\data\\WinCSX.exe", + true); + + return true; + } + + private void AddModules() + { + Module csx = new Module(); + csx.sourcedir = "dlls\\csx\\source"; + csx.projname = "csx_amxx"; + csx.bindir = "msvc"; + csx.vcproj = "csx"; + + Module cstrike = new Module(); + cstrike.sourcedir = "cstrike"; + cstrike.projname = "cstrike_amxx"; + cstrike.vcproj = "cstrike"; + + m_Modules.Add(csx); + m_Modules.Add(cstrike); + } + } +} diff --git a/installer/AMXXRelease/ModDoD.cs b/installer/AMXXRelease/ModDoD.cs new file mode 100755 index 00000000..234fee8e --- /dev/null +++ b/installer/AMXXRelease/ModDoD.cs @@ -0,0 +1,51 @@ +using System; + +namespace AMXXRelease +{ + /// + /// Summary description for ModDoD. + /// + public class ModDoD : AMod + { + public ModDoD() + { + AddModules(); + AddPlugins(); + } + + public override sealed string GetName() + { + return "dod"; + } + + private void AddPlugins() + { + AddPlugin("stats"); + AddPlugin("plmenu"); + AddPlugin("stats_logging"); + AddPlugin("statssounds"); + + Plugin pl = AddPlugin("dodstats"); + pl.outdir = "data"; + } + + private void AddModules() + { + Module dodx = new Module(); + dodx.sourcedir = "dlls\\dod2\\dodx"; + dodx.projname = "dodx_amxx"; + dodx.bindir = "msvc"; + dodx.vcproj = "dodx"; + + Module dodfun = new Module(); + dodfun.sourcedir = "dlls\\dod2\\dodfun"; + dodfun.projname = "dodfun_amxx"; + dodfun.bindir = "msvc"; + dodfun.vcproj = "dodfun"; + + m_Modules.Add(dodx); + m_Modules.Add(dodfun); + } + } +} + diff --git a/installer/AMXXRelease/ModEsf.cs b/installer/AMXXRelease/ModEsf.cs new file mode 100755 index 00000000..97c4a025 --- /dev/null +++ b/installer/AMXXRelease/ModEsf.cs @@ -0,0 +1,30 @@ +using System; + +namespace AMXXRelease +{ + /// + /// Summary description for ModEsf. + /// + public class ModEsf : AMod + { + public ModEsf() + { + AddModules(); + } + + public override sealed string GetName() + { + return "esf"; + } + + private void AddModules() + { + Module esfmod = new Module(); + esfmod.sourcedir = "dlls\\esforces\\esfmod"; + esfmod.vcproj = "esfmod"; + esfmod.projname = "esfmod_amxx"; + + m_Modules.Add(esfmod); + } + } +} diff --git a/installer/AMXXRelease/ModNs.cs b/installer/AMXXRelease/ModNs.cs new file mode 100755 index 00000000..469278d9 --- /dev/null +++ b/installer/AMXXRelease/ModNs.cs @@ -0,0 +1,39 @@ +using System; + +namespace AMXXRelease +{ + /// + /// Summary description for ModNs. + /// + public class ModNs : AMod + { + public ModNs() + { + AddModules(); + AddPlugins(); + } + + public override sealed string GetName() + { + return "ns"; + } + + private void AddPlugins() + { + AddPlugin("mapchooser"); + AddPlugin("nextmap"); + AddPlugin("timeleft"); + } + + private void AddModules() + { + Module ns = new Module(); + + ns.sourcedir = "dlls\\ns\\ns"; + ns.projname = "ns_amxx"; + ns.vcproj = "ns"; + + m_Modules.Add(ns); + } + } +} diff --git a/installer/AMXXRelease/ModTFC.cs b/installer/AMXXRelease/ModTFC.cs new file mode 100755 index 00000000..482f0bb9 --- /dev/null +++ b/installer/AMXXRelease/ModTFC.cs @@ -0,0 +1,43 @@ +using System; + +namespace AMXXRelease +{ + /// + /// Summary description for ModTFC. + /// + public class ModTFC : AMod + { + public ModTFC() + { + AddModules(); + AddPlugins(); + } + + public override sealed string GetName() + { + return "tfc"; + } + + private void AddPlugins() + { + AddPlugin("plmenu"); + AddPlugin("stats_logging"); + AddPlugin("statssounds"); + AddPlugin("stats"); + Plugin pl = AddPlugin("tfcstats"); + pl.outdir = "data"; + } + + private void AddModules() + { + Module tfcx = new Module(); + + tfcx.sourcedir = "dlls\\tfc\\tfcx"; + tfcx.vcproj = "tfcx"; + tfcx.projname = "tfcx_amxx"; + tfcx.bindir = "msvc"; + + m_Modules.Add(tfcx); + } + } +} diff --git a/installer/AMXXRelease/ModTs.cs b/installer/AMXXRelease/ModTs.cs new file mode 100755 index 00000000..9ee29442 --- /dev/null +++ b/installer/AMXXRelease/ModTs.cs @@ -0,0 +1,47 @@ +using System; + +namespace AMXXRelease +{ + /// + /// Summary description for ModTs. + /// + public class ModTs : AMod + { + public ModTs() + { + AddModules(); + AddPlugins(); + } + + public override sealed string GetName() + { + return "ts"; + } + + private void AddPlugins() + { + AddPlugin("stats"); + AddPlugin("stats_logging"); + AddPlugin("statssounds"); + Plugin pl = AddPlugin("tsstats"); + pl.outdir = "data"; + } + + private void AddModules() + { + Module tsx = new Module(); + tsx.sourcedir = "dlls\\ts\\tsx"; + tsx.projname = "tsx_amxx"; + tsx.bindir = "msvc"; + tsx.vcproj = "tsx_amxx"; + + Module tsfun = new Module(); + tsfun.sourcedir = "dlls\\ts\\tsfun"; + tsfun.projname = "tsfun_amxx"; + tsfun.vcproj = "tsfun"; + + m_Modules.Add(tsx); + m_Modules.Add(tsfun); + } + } +} diff --git a/installer/AMXXRelease/Release15.cs b/installer/AMXXRelease/Release15.cs new file mode 100755 index 00000000..d9dd2d86 --- /dev/null +++ b/installer/AMXXRelease/Release15.cs @@ -0,0 +1,34 @@ +using System; + +namespace AMXXRelease +{ + /// + /// Summary description for Release15. + /// + public class Release15 : ABuild + { + public Release15() + { + CoreMod core = new CoreMod(); + ModCstrike cstrike = new ModCstrike(); + ModDoD dod = new ModDoD(); + ModEsf esf = new ModEsf(); + ModNs ns = new ModNs(); + ModTFC tfc = new ModTFC(); + ModTs ts = new ModTs(); + + m_Mods.Add(core); + m_Mods.Add(cstrike); + m_Mods.Add(dod); + m_Mods.Add(esf); + m_Mods.Add(ns); + m_Mods.Add(tfc); + m_Mods.Add(ts); + } + + public override sealed string GetName() + { + return "amxmodx-1.5"; + } + } +}