committed C# releaser
This commit is contained in:
parent
25cbe60bf8
commit
cc393d0e8d
30
installer/AMXXRelease/ABuild.cs
Executable file
30
installer/AMXXRelease/ABuild.cs
Executable file
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace AMXXRelease
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for ABuild.
|
||||
/// </summary>
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
159
installer/AMXXRelease/AMXXRelease.csproj
Executable file
159
installer/AMXXRelease/AMXXRelease.csproj
Executable file
|
@ -0,0 +1,159 @@
|
|||
<VisualStudioProject>
|
||||
<CSHARP
|
||||
ProjectType = "Local"
|
||||
ProductVersion = "7.10.3077"
|
||||
SchemaVersion = "2.0"
|
||||
ProjectGuid = "{60FE591C-FDC8-44B4-9AC1-CE3617450E31}"
|
||||
>
|
||||
<Build>
|
||||
<Settings
|
||||
ApplicationIcon = "App.ico"
|
||||
AssemblyKeyContainerName = ""
|
||||
AssemblyName = "AMXXRelease"
|
||||
AssemblyOriginatorKeyFile = ""
|
||||
DefaultClientScript = "JScript"
|
||||
DefaultHTMLPageLayout = "Grid"
|
||||
DefaultTargetSchema = "IE50"
|
||||
DelaySign = "false"
|
||||
OutputType = "Exe"
|
||||
PreBuildEvent = ""
|
||||
PostBuildEvent = ""
|
||||
RootNamespace = "AMXXRelease"
|
||||
RunPostBuildEvent = "OnBuildSuccess"
|
||||
StartupObject = ""
|
||||
>
|
||||
<Config
|
||||
Name = "Debug"
|
||||
AllowUnsafeBlocks = "false"
|
||||
BaseAddress = "285212672"
|
||||
CheckForOverflowUnderflow = "false"
|
||||
ConfigurationOverrideFile = ""
|
||||
DefineConstants = "DEBUG;TRACE"
|
||||
DocumentationFile = ""
|
||||
DebugSymbols = "true"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "false"
|
||||
NoStdLib = "false"
|
||||
NoWarn = ""
|
||||
Optimize = "false"
|
||||
OutputPath = "bin\Debug\"
|
||||
RegisterForComInterop = "false"
|
||||
RemoveIntegerChecks = "false"
|
||||
TreatWarningsAsErrors = "false"
|
||||
WarningLevel = "4"
|
||||
/>
|
||||
<Config
|
||||
Name = "Release"
|
||||
AllowUnsafeBlocks = "false"
|
||||
BaseAddress = "285212672"
|
||||
CheckForOverflowUnderflow = "false"
|
||||
ConfigurationOverrideFile = ""
|
||||
DefineConstants = "TRACE"
|
||||
DocumentationFile = ""
|
||||
DebugSymbols = "false"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "false"
|
||||
NoStdLib = "false"
|
||||
NoWarn = ""
|
||||
Optimize = "true"
|
||||
OutputPath = "bin\Release\"
|
||||
RegisterForComInterop = "false"
|
||||
RemoveIntegerChecks = "false"
|
||||
TreatWarningsAsErrors = "false"
|
||||
WarningLevel = "4"
|
||||
/>
|
||||
</Settings>
|
||||
<References>
|
||||
<Reference
|
||||
Name = "System"
|
||||
AssemblyName = "System"
|
||||
HintPath = "..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Data"
|
||||
AssemblyName = "System.Data"
|
||||
HintPath = "..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.XML"
|
||||
AssemblyName = "System.XML"
|
||||
HintPath = "..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
|
||||
/>
|
||||
</References>
|
||||
</Build>
|
||||
<Files>
|
||||
<Include>
|
||||
<File
|
||||
RelPath = "ABuild.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "AMod.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "App.ico"
|
||||
BuildAction = "Content"
|
||||
/>
|
||||
<File
|
||||
RelPath = "AssemblyInfo.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "Builder.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "Config.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "CoreMod.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "ModCstrike.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "ModDoD.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "ModEsf.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "ModNs.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "ModTFC.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "ModTs.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "Release15.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
</Include>
|
||||
</Files>
|
||||
</CSHARP>
|
||||
</VisualStudioProject>
|
||||
|
48
installer/AMXXRelease/AMXXRelease.csproj.user
Executable file
48
installer/AMXXRelease/AMXXRelease.csproj.user
Executable file
|
@ -0,0 +1,48 @@
|
|||
<VisualStudioProject>
|
||||
<CSHARP LastOpenVersion = "7.10.3077" >
|
||||
<Build>
|
||||
<Settings ReferencePath = "" >
|
||||
<Config
|
||||
Name = "Debug"
|
||||
EnableASPDebugging = "false"
|
||||
EnableASPXDebugging = "false"
|
||||
EnableUnmanagedDebugging = "false"
|
||||
EnableSQLServerDebugging = "false"
|
||||
RemoteDebugEnabled = "false"
|
||||
RemoteDebugMachine = ""
|
||||
StartAction = "Project"
|
||||
StartArguments = ""
|
||||
StartPage = ""
|
||||
StartProgram = ""
|
||||
StartURL = ""
|
||||
StartWorkingDirectory = ""
|
||||
StartWithIE = "true"
|
||||
/>
|
||||
<Config
|
||||
Name = "Release"
|
||||
EnableASPDebugging = "false"
|
||||
EnableASPXDebugging = "false"
|
||||
EnableUnmanagedDebugging = "false"
|
||||
EnableSQLServerDebugging = "false"
|
||||
RemoteDebugEnabled = "false"
|
||||
RemoteDebugMachine = ""
|
||||
StartAction = "Project"
|
||||
StartArguments = ""
|
||||
StartPage = ""
|
||||
StartProgram = ""
|
||||
StartURL = ""
|
||||
StartWorkingDirectory = ""
|
||||
StartWithIE = "true"
|
||||
/>
|
||||
</Settings>
|
||||
</Build>
|
||||
<OtherProjectSettings
|
||||
CopyProjectDestinationFolder = ""
|
||||
CopyProjectUncPath = ""
|
||||
CopyProjectOption = "0"
|
||||
ProjectView = "ProjectFiles"
|
||||
ProjectTrust = "0"
|
||||
/>
|
||||
</CSHARP>
|
||||
</VisualStudioProject>
|
||||
|
21
installer/AMXXRelease/AMXXRelease.sln
Executable file
21
installer/AMXXRelease/AMXXRelease.sln
Executable file
|
@ -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
|
104
installer/AMXXRelease/AMod.cs
Executable file
104
installer/AMXXRelease/AMod.cs
Executable file
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
BIN
installer/AMXXRelease/App.ico
Executable file
BIN
installer/AMXXRelease/App.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
58
installer/AMXXRelease/AssemblyInfo.cs
Executable file
58
installer/AMXXRelease/AssemblyInfo.cs
Executable file
|
@ -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\<configuration>. 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("")]
|
282
installer/AMXXRelease/Builder.cs
Executable file
282
installer/AMXXRelease/Builder.cs
Executable file
|
@ -0,0 +1,282 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
namespace AMXXRelease
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for Class1.
|
||||
/// </summary>
|
||||
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<num; i++)
|
||||
{
|
||||
mod = build.GetMod(i);
|
||||
if (!BuildMod(mod))
|
||||
{
|
||||
System.Console.WriteLine("Mod failed to build: " + mod.GetName());
|
||||
return false;
|
||||
}
|
||||
ZipDir(build.GetName() + "-" + mod.GetName() + ".zip", mod.GetName());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool BuildMod(AMod mod)
|
||||
{
|
||||
CopyConfigs(mod);
|
||||
if (!BuildModModules(mod))
|
||||
return false;
|
||||
if (!BuildModPlugins(mod))
|
||||
return false;
|
||||
|
||||
string basedir = m_Cfg.OutputPath() + "\\" + mod.GetName();
|
||||
string sourcetree = m_Cfg.GetSourceTree();
|
||||
|
||||
if (!mod.CopyExtraFiles(basedir, sourcetree))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void ZipDir(string target, string dir)
|
||||
{
|
||||
ProcessStartInfo info = new ProcessStartInfo();
|
||||
|
||||
info.FileName = m_Cfg.PathToZip();
|
||||
info.WorkingDirectory = m_Cfg.OutputPath();
|
||||
info.Arguments = "-r " + target + " " + dir;
|
||||
info.UseShellExecute = false;
|
||||
|
||||
Process p = Process.Start(info);
|
||||
p.WaitForExit();
|
||||
}
|
||||
|
||||
public void CopyConfigs(AMod mod)
|
||||
{
|
||||
string basedir = m_Cfg.OutputPath() + "\\" + mod.GetName() + "\\configs";
|
||||
|
||||
if (!Directory.Exists(basedir))
|
||||
Directory.CreateDirectory(basedir);
|
||||
|
||||
string srcdir = m_Cfg.GetSourceTree() + "\\configs";
|
||||
|
||||
if (!Directory.Exists(srcdir))
|
||||
return;
|
||||
|
||||
if (mod.GetPluginDir() != null)
|
||||
srcdir += "\\" + mod.GetBaseName();
|
||||
|
||||
CopyNormal(srcdir, basedir);
|
||||
}
|
||||
|
||||
public static void CopyNormal(string src, string dest)
|
||||
{
|
||||
string[] files = Directory.GetFiles(src);
|
||||
|
||||
if (!Directory.Exists(dest))
|
||||
Directory.CreateDirectory(dest);
|
||||
|
||||
for (int i=0; i<files.Length; i++)
|
||||
{
|
||||
File.Copy(files[i],
|
||||
dest + "\\" + GetFileName(files[i]),
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
public bool BuildModPlugins(AMod mod)
|
||||
{
|
||||
int num = mod.GetPlugins();
|
||||
|
||||
Plugin plugin;
|
||||
string binary, basedir;
|
||||
|
||||
basedir = m_Cfg.OutputPath();
|
||||
basedir += "\\" + mod.GetName();
|
||||
|
||||
string dir, file, target;
|
||||
for (int i=0; i<num; i++)
|
||||
{
|
||||
plugin = mod.GetPlugin(i);
|
||||
binary = BuildPlugin(mod, plugin);
|
||||
file = m_Cfg.GetSourceTree() + "\\plugins\\" + GetFileName(binary);
|
||||
if (!File.Exists(file))
|
||||
{
|
||||
System.Console.WriteLine("Plugin failed to compile: " +
|
||||
mod.GetName() + "::" + plugin.name);
|
||||
return false;
|
||||
}
|
||||
dir = basedir + "\\" + plugin.outdir;
|
||||
if (!Directory.Exists(dir))
|
||||
Directory.CreateDirectory(dir);
|
||||
target = dir + "\\" + plugin.name + ".amxx";
|
||||
if (File.Exists(target))
|
||||
File.Delete(target);
|
||||
File.Move(file,
|
||||
target);
|
||||
}
|
||||
|
||||
//Copy all files from the plugins dir to scripting
|
||||
|
||||
string search_dir = m_Cfg.GetSourceTree() + "\\plugins";
|
||||
if (mod.GetPluginDir() != null)
|
||||
search_dir += "\\" + mod.GetPluginDir();
|
||||
|
||||
string dest;
|
||||
if (Directory.Exists(search_dir))
|
||||
{
|
||||
string[] files = Directory.GetFiles(search_dir);
|
||||
if (!Directory.Exists(basedir + "\\scripting"))
|
||||
Directory.CreateDirectory(basedir + "\\scripting");
|
||||
for (int i=0; i<files.Length; i++)
|
||||
{
|
||||
dest = basedir + "\\scripting\\" + GetFileName(files[i]);
|
||||
File.Copy(files[i], dest, true);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static string GetFileName(string input)
|
||||
{
|
||||
for (int i=input.Length-1; 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<num; i++)
|
||||
{
|
||||
module = mod.GetModule(i);
|
||||
binary = BuildModule(module);
|
||||
|
||||
if (binary == null)
|
||||
{
|
||||
System.Console.WriteLine("Module failed to compile: " +
|
||||
mod.GetName() + "::" + module.projname + ".dll");
|
||||
return false;
|
||||
}
|
||||
dir = basedir + "\\" + module.outdir;
|
||||
if (!Directory.Exists(dir))
|
||||
Directory.CreateDirectory(dir);
|
||||
File.Copy(binary,
|
||||
dir + "\\" + module.projname + ".dll",
|
||||
true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public string BuildPlugin(AMod mod, Plugin pl)
|
||||
{
|
||||
string modoffs = mod.GetPluginDir();
|
||||
string pldir;
|
||||
|
||||
if (modoffs != null)
|
||||
pldir = modoffs + "\\";
|
||||
else
|
||||
pldir = "";
|
||||
|
||||
AmxxPc(pldir + pl.source, pl.options);
|
||||
|
||||
string outfile = pldir + pl.name + ".amxx";
|
||||
|
||||
return outfile;
|
||||
}
|
||||
|
||||
public void AmxxPc(string inpath, string args)
|
||||
{
|
||||
ProcessStartInfo info = new ProcessStartInfo();
|
||||
|
||||
info.WorkingDirectory = m_Cfg.GetSourceTree() + "\\plugins";
|
||||
info.FileName = (string)m_AmxxPc.Clone();
|
||||
info.Arguments = inpath + ".sma";
|
||||
if (args != null)
|
||||
info.Arguments += " " + args;
|
||||
info.UseShellExecute = false;
|
||||
|
||||
Process p = Process.Start(info);
|
||||
p.WaitForExit();
|
||||
}
|
||||
|
||||
public string BuildModule(Module module)
|
||||
{
|
||||
ProcessStartInfo info = new ProcessStartInfo();
|
||||
|
||||
string dir = m_Cfg.GetSourceTree() + "\\" + module.sourcedir;
|
||||
if (module.bindir != null)
|
||||
dir += "\\" + module.bindir;
|
||||
string file = dir;
|
||||
if (module.bindir == null)
|
||||
file += "\\" + module.bindir;
|
||||
file += "\\" + module.build + "\\" + module.projname + ".dll";
|
||||
|
||||
if (File.Exists(file))
|
||||
File.Delete(file);
|
||||
|
||||
info.WorkingDirectory = dir;
|
||||
info.FileName = m_Cfg.DevenvPath();
|
||||
info.Arguments = "/build " + module.build + " " + module.vcproj + ".vcproj";
|
||||
info.UseShellExecute = false;
|
||||
|
||||
Process p = Process.Start(info);
|
||||
p.WaitForExit();
|
||||
|
||||
if (!File.Exists(file))
|
||||
return null;
|
||||
|
||||
return file;
|
||||
}
|
||||
}
|
||||
}
|
34
installer/AMXXRelease/Config.cs
Executable file
34
installer/AMXXRelease/Config.cs
Executable file
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
|
||||
namespace AMXXRelease
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for Config.
|
||||
/// </summary>
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
132
installer/AMXXRelease/CoreMod.cs
Executable file
132
installer/AMXXRelease/CoreMod.cs
Executable file
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
60
installer/AMXXRelease/ModCstrike.cs
Executable file
60
installer/AMXXRelease/ModCstrike.cs
Executable file
|
@ -0,0 +1,60 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace AMXXRelease
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for ModCstrike.
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
51
installer/AMXXRelease/ModDoD.cs
Executable file
51
installer/AMXXRelease/ModDoD.cs
Executable file
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
|
||||
namespace AMXXRelease
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for ModDoD.
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
30
installer/AMXXRelease/ModEsf.cs
Executable file
30
installer/AMXXRelease/ModEsf.cs
Executable file
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
|
||||
namespace AMXXRelease
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for ModEsf.
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
39
installer/AMXXRelease/ModNs.cs
Executable file
39
installer/AMXXRelease/ModNs.cs
Executable file
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
|
||||
namespace AMXXRelease
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for ModNs.
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
43
installer/AMXXRelease/ModTFC.cs
Executable file
43
installer/AMXXRelease/ModTFC.cs
Executable file
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
|
||||
namespace AMXXRelease
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for ModTFC.
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
47
installer/AMXXRelease/ModTs.cs
Executable file
47
installer/AMXXRelease/ModTs.cs
Executable file
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
|
||||
namespace AMXXRelease
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for ModTs.
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
34
installer/AMXXRelease/Release15.cs
Executable file
34
installer/AMXXRelease/Release15.cs
Executable file
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
|
||||
namespace AMXXRelease
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for Release15.
|
||||
/// </summary>
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user