Compare commits

..

No commits in common. "master" and "v1.0.3" have entirely different histories.

16 changed files with 97 additions and 225 deletions

View File

@ -8,27 +8,30 @@ Updates, compiles and sets up your CitizenMP server automagically!
Features
--------
- Compatible with both Microsoft .NET Framework 4.5+ and Mono 3.0+ (Mac OS X support planned)
- Compatible with both Microsoft .NET Framework and Mono (Mac OS X support planned)
- Creates ready-to-use start scripts for your platform
- No extra setup besides requirements listed below needed
- No extra setup besides usual requirements needed
Requirements
------------
First of all, you'll need Windows or Linux to run this tool. Currently, since no libgit2 binaries can be provided for Mac OS X, this tool won't work there. Here's the guaranteed compatible list of OS this tool can be run on:
- Ubuntu 12.04 LTS or higher, including 14.xx
- Ubuntu 12.04 (old LTS) or higher, including 14.xx
- Debian 7.x (Wheezy) or higher, including testing and sid installations
- Every other currently stable Linux distribution with up-to-date Mono
- Any Windows operating system with .NET Framework 4.5 Full on it
- Every other currently stable Linux distribution should work just fine as well
- Any Windows operating system with .NET Framework 4 Full on it
To run this program and the resulting server, you need the following components:
- _On Windows:_ .NET Framework 4.5 or newer ([Download](http://microsoft.com/download/details.aspx?id=30653))
- _On Linux:_ Mono 3.x or newer, runtime + xbuild files ([Installation instructions](http://www.mono-project.com/docs/getting-started/install/linux/))
- _On Windows:_ .NET Framework 4 or newer
- _On Linux:_ Mono 2.10.x/3.x or newer
*Note that Mono 2.10.x/.NET 4 are not supported!*
If you use a Debian-based distribution that still only offers Mono binaries older than 3.x, you must [switch to Xamarin's Debian repository](http://www.mono-project.com/docs/getting-started/install/linux/).
On Ubuntu and Debian you can just install all requirements with this command:
```
sudo apt-get install mono-runtime libmono-system-core4.0-cil
```
Guides
------
@ -42,7 +45,7 @@ Usage
This tool ships with a usage screen that will be printed if this tool is run without arguments. It looks similar to the following:
```
CitizenMP Server Updater 1.0.3
CitizenMP Server Updater 1.0.1+Branch.master.Sha.4475e9becd5fa22563a92fe202f8df21329969fc
© 2014-2015 Carl Kittelberger
This is free software. You may redistribute copies of it under the terms of the MIT License <http://www.opensource.org/licenses/mit-license.php>.

View File

@ -3,11 +3,10 @@ Easy server installation on Windows
On Windows, you can mostly avoid using the command line for easy usage. Instead, just drag and drop an empty folder onto it. Below is a detailed explanation:
1. Make sure at least .NET Framework 4.5 is installed on your server computer. If not, [you can download it from Microsoft's website](http://microsoft.com/download/details.aspx?id=30653).
2. Make sure Microsoft Build Tools 2013 is installed on your server computer, [downloadable from Microsoft as well](http://microsoft.com/download/details.aspx?id=40760).
3. Download citimp_upd.exe from [here](https://github.com/icedream/citizenmp-server-updater/releases). The newest version is always at the top. Alternatively, you can also [get the latest build from the build server](http://builds.icedream.kthx.at/citiserver-updater-master/lastSuccessfulBuild/citimp_upd.exe), which is a little bit slower.
4. Create a new dedicated folder for citimp_upd.exe. It will later contain both your new server and the source code the tool downloads. Name it something like "CitizenMP" or similar. Move the file into the folder.
5. Inside the folder, create a new folder which will contain your server build. Name it something like "Server" or similar.
6. Drag and drop your newly created folder onto citimp_upd.exe. Wait for the tool to download, compile and prepare your server. the window should go away when done.
7. Now open your folder and like magic, some new files will be in there. Usually, you will now have to edit the configuration file before starting the server, so now would be a good time to do your custom changes.
8. When done, save any files you have open and start the server using the start.bat script that the tool generated for you. The server should display a new window and start up properly.
1. Make sure at least .NET Framework 4 is installed on your server computer. If not, you can download it [here](http://microsoft.com/download/details.aspx?id=17718).
2. Download citimp_upd.exe from [here](https://github.com/icedream/citizenmp-server-updater/releases). The newest version is always at the top. Alternatively, you can also [get the latest build from the build server](http://builds.icedream.kthx.at/citiserver-updater-master/lastSuccessfulBuild/citimp_upd.exe), which is a little bit slower.
3. Create a new dedicated folder for citimp_upd.exe. It will later contain both your new server and the source code the tool downloads. Name it something like "CitizenMP" or similar. Move the file into the folder.
4. Inside the folder, create a new folder which will contain your server build. Name it something like "Server" or similar.
5. Drag and drop your newly created folder onto citimp_upd.exe. Wait for the tool to download, compile and prepare your server. The window should go away when done.
6. Now open your folder and like magic, some new files will be in there. Usually, you will now have to edit the configuration file before starting the server, so now would be a good time to do your custom changes.
7. When done, save any files you have open and start the server using the start.bat script that the tool generated for you. The server should display a new window and start up properly.

View File

@ -3,10 +3,10 @@ Server installation on Linux
On Linux, you should use a terminal (SSH connection/XTerm/...) to set up your server.
1. Make sure you have the newest Mono 3.x installed on your server computer (you can check the version using ```mono -V```). If not, [you should follow the official installation instructions](http://www.mono-project.com/docs/getting-started/install/linux/).
2. Download the latest citimp_upd.exe from [here](https://github.com/icedream/citizenmp-server-updater/releases/latest). If you are using SSH and want the file downloaded quickly or just generally want a direct download onto your server, this command should do: ```wget https://github.com/icedream/citizenmp-server-updater/releases/download/v1.1.0/citimp_upd.exe```
1. Make sure at least Mono 2.10.x is installed on your server computer. If not, you can install it using your distribution's package manager. For Debian/Ubuntu the command would normally be ```sudo apt-get install mono-runtime libmono-system-core4.0-cil```.
2. Download the latest citimp_upd.exe from [here](https://github.com/downloads/icedream/citizenmp-server-updater/citimp_upd.exe). You automate this using this command: ```wget https://github.com/icedream/citizenmp-server-updater/releases/download/v1.0.3/citimp_upd.exe```
3. Create a new dedicated folder for citimp_upd.exe. It will later contain both your new server and the source code the tool downloads. Name it something like "CitizenMP" or similar. Move the file into the folder. Command for that would be ```mkdir CitizenMP```
4. Inside the folder, create a new folder which will contain your server build. Name it something like "Server" or similar. Command for this would be ```cd CitizenMP && mkdir Server```
5. Run the tool and tell it to install files into your newly created folder. Command: ```mono citimp_upd.exe Server```
6. Now open your folder and like magic, some new files will be in there. Usually, you will now have to edit the configuration file before starting the server, so now would be a good time to do your custom changes. Use whatever editor you have to edit the main configuration file (the file that ends with ".yml"), I personally recommend nano for people who don't like complicated editing. :)
7. When done, save any files you have open and start the server using the start.sh script that the tool generated for you. The server should start up properly. The direct command would be ```./start.sh``` but that would spawn the server in the foreground. If you were on an SSH server and disconnected, your server would instantly shut down. Use some tool like "screen", "nohup" or "disown" to detach your server properly.
7. When done, save any files you have open and start the server using the start.sh script that the tool generated for you. The server should start up properly. The direct command would be ```./start.sh``` but that would spawn the server in the foreground. If you were on an SSH server and disconnected, your server would instantly shut down. Use some tool like "screen", "nohup" or "disown" to detach your server properly.

View File

@ -1,16 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<generatePublisherEvidence enabled="false" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<generatePublisherEvidence enabled="false" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CitizenMP.Server.Installer</RootNamespace>
<AssemblyName>citizenmp_server_updater</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>95b7e825</NuGetPackageImportStamp>
<TargetFrameworkProfile />
@ -48,21 +48,29 @@
<StartupObject>CitizenMP.Server.Installer.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommandLine">
<HintPath>$(SolutionDir)\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath>
<Reference Include="CommandLine, Version=1.9.71.2, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SolutionDir)\packages\CommandLineParser.1.9.71\lib\net40\CommandLine.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build, Version=12.0.0.0" />
<Reference Include="Microsoft.Build.Engine, Version=12.0.0.0" />
<Reference Include="Microsoft.Build.Framework, Version=12.0.0.0" />
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Conversion.v4.0" />
<Reference Include="Microsoft.Build.Engine" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Tasks.v4.0" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="Mono.Posix">
<HintPath>$(SolutionDir)\packages\Mono.Posix.4.0.0.0\lib\net40\Mono.Posix.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CommandLineOptions.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RepositoryExtensions.cs" />
@ -89,7 +97,6 @@
<EmbeddedResource Include="costura64\git2-91fa31f.dll" />
<EmbeddedResource Include="costura32\*.so" />
<EmbeddedResource Include="costura64\*.so" />
<EmbeddedResource Include="AppDomainConfigurations\BuildNET45.xml" />
<Content Include="FodyWeavers.xml">
<SubType>Designer</SubType>
</Content>
@ -195,6 +202,7 @@ if [ ! -e "$(SolutionDir)src/updater/costura32"/git*.so ]; then
fi
</PreBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)packages\Fody.1.26.1\build\Fody.targets" Condition="Exists('$(SolutionDir)packages\Fody.1.26.1\build\Fody.targets')" />
<Import Project="$(SolutionDir)packages\Fody.1.26.4\build\Fody.targets" Condition="Exists('..\..\packages\Fody.1.26.4\build\Fody.targets')" />
<Import Project="$(SolutionDir)packages\GitVersionTask.2.0.0\Build\GitVersionTask.targets" Condition="Exists('..\..\packages\GitVersionTask.2.0.0\Build\GitVersionTask.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -1,14 +0,0 @@
using System;
namespace CitizenMP.Server.Installer
{
internal static class Extensions
{
public static bool IsWin32(this OperatingSystem os)
{
return os.Platform == PlatformID.Win32NT ||
os.Platform == PlatformID.Win32S ||
os.Platform == PlatformID.Win32Windows;
}
}
}

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<Costura CreateTemporaryAssemblies="true"/>
<Costura CreateTemporaryAssemblies="true" />
</Weavers>

View File

@ -13,6 +13,7 @@ using Microsoft.Build.Evaluation;
using Microsoft.Build.Execution;
using Microsoft.Build.Framework;
using Mono.Unix.Native;
using Project = Microsoft.Build.BuildEngine.Project;
using UnixSyscall = Mono.Unix.Native.Syscall;
namespace CitizenMP.Server.Installer
@ -58,13 +59,6 @@ namespace CitizenMP.Server.Installer
private static int Main(string[] args)
{
var monoRun = RunWithMonoConfiguration(args);
if (monoRun.Item1)
{
// The main stuff already ran in a subprocess
return monoRun.Item2;
}
// Parse cmdline arguments
var options = new CommandLineOptions();
//args = args.DefaultIfEmpty("--help").ToArray();
@ -244,7 +238,7 @@ namespace CitizenMP.Server.Installer
{
{"Configuration", "Release"},
{"Platform", "Any CPU"},
{"DebugType", Environment.OSVersion.IsWin32() ? "None" : "pdbonly"},
{"DebugType", IsWin32() ? "None" : "pdbonly"},
{"DebugSymbols", false.ToString()},
{"OutputPath", binOutputDirectory.FullName},
{"AllowedReferenceRelatedFileExtensions", "\".mdb\"=\"\";\".pdb\"=\"\";\".xml\"=\"\""}
@ -321,62 +315,6 @@ namespace CitizenMP.Server.Installer
return 0;
}
private static Tuple<bool, int> RunWithMonoConfiguration(string[] args)
{
if (Environment.OSVersion.IsWin32())
{
// .NET Framework does everything properly anyways
return new Tuple<bool, int>(false, 0);
}
var engineAssembly =
Assembly.Load(
"Microsoft.Build.Engine, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
.GetName();
if (engineAssembly.Version.Major < 12)
{
//var baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var baseDir = Path.GetDirectoryName(Assembly.Load("CommandLine").Location);
if (baseDir == null)
throw new DirectoryNotFoundException("Could not find base directory");
var tempExePath = Path.Combine(baseDir, new Random().Next(10000, 99999) + ".exe");
File.Copy(Assembly.GetExecutingAssembly().Location, tempExePath);
var tempConfigPath = tempExePath + ".config";
using (var tempConfig = File.OpenWrite(tempConfigPath))
{
using (
var srcConfig =
Assembly.GetExecutingAssembly()
.GetManifestResourceStream(
"CitizenMP.Server.Installer.AppDomainConfigurations.BuildNET45.xml"))
{
if (srcConfig == null)
throw new FileNotFoundException("Could not find config resource");
srcConfig.CopyTo(tempConfig);
srcConfig.Flush();
}
}
AppDomain.CurrentDomain.DomainUnload += (sender, e) =>
{
File.Delete(tempConfigPath);
File.Delete(tempExePath);
};
var arguments = string.Join(" ",
new[] {tempExePath}.Concat(args)
.Select(a => "\"" + a.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\""));
var exitCode = RunProcess("mono", arguments, new Dictionary<string, string>
{
{"MONO_IOMAP", "all"}
});
return new Tuple<bool, int>(true, exitCode);
}
return new Tuple<bool, int>(false, 0);
}
private static bool Build(string projectFilePath, IDictionary<string, string> buildProperties,
LoggerVerbosity verbosity, string logPath = null)
{
@ -411,7 +349,7 @@ namespace CitizenMP.Server.Installer
loggers.Add(new ConsoleLogger(verbosity) {ShowSummary = false});
// Import/Update Mozilla certs for NuGet to not fail out on non-Windows machines
if (!Environment.OSVersion.IsWin32())
if (!IsWin32())
{
try
{
@ -419,18 +357,15 @@ namespace CitizenMP.Server.Installer
{
if (s == null || !s.Contains("X.509 Certificate"))
return;
writer.WriteLine("yes");
writer.WriteLine("y");
});
// TODO: Make sure this does not fail out by checking if mozroots is installed
Console.WriteLine("Updating SSL certificates for NuGet...");
RunProcessThrowOnException("mozroots", "--import --sync --quiet");
RunProcessThrowOnException("certmgr", "-ssl https://go.microsoft.com",
lineProcessor: automaticYesResponder);
RunProcessThrowOnException("certmgr", "-ssl https://nugetgallery.blob.core.windows.net",
lineProcessor: automaticYesResponder);
RunProcessThrowOnException("certmgr", "-ssl https://nuget.org",
lineProcessor: automaticYesResponder);
Run("mozroots", "--import --sync --quiet");
Run("certmgr", "-ssl https://go.microsoft.com", automaticYesResponder);
Run("certmgr", "-ssl https://nugetgallery.blob.core.windows.net", automaticYesResponder);
Run("certmgr", "-ssl https://nuget.org", automaticYesResponder);
}
catch (Exception error)
{
@ -451,27 +386,18 @@ namespace CitizenMP.Server.Installer
}
// Use a different build route if running on the Mono interpreter
if (!Environment.OSVersion.IsWin32())
if (!IsWin32())
{
// Build doesn't work with the new API on Mono, use the deprecated api
Console.WriteLine("Building server binaries...");
#pragma warning disable 618
// Build doesn't work with the new API on Mono, use the deprecated api
var engine = Engine.GlobalEngine;
// loggers
foreach (var logger in loggers)
engine.RegisterLogger(logger);
// Apply build properties
var buildPropertiesConverted = new BuildPropertyGroup();
engine.GlobalProperties = buildPropertiesConverted;
Engine.GlobalEngine.RegisterLogger(logger);
var project = new Project(Engine.GlobalEngine) {BuildEnabled = true};
project.Load(projectFilePath);
foreach (var property in buildProperties)
buildPropertiesConverted.SetProperty(property.Key, property.Value);
// Load project
var result = engine.BuildProjectFile(projectFilePath, new string[0], null, null,
BuildSettings.None,
null);
project.GlobalProperties.SetProperty(property.Key, property.Value);
var result = project.Build();
#pragma warning restore 618
return result;
}
@ -480,8 +406,7 @@ namespace CitizenMP.Server.Installer
{
Console.WriteLine("Building server binaries...");
var buildReq = new BuildRequestData(projectFilePath, buildProperties, null, new[] {"Build"},
null);
var buildReq = new BuildRequestData(projectFilePath, buildProperties, null, new[] {"Build"}, null);
var result = BuildManager.DefaultBuildManager.Build(
new BuildParameters(pc)
@ -499,42 +424,18 @@ namespace CitizenMP.Server.Installer
}
}
private static void RunProcessThrowOnException(string name, string args,
IDictionary<string, string> envVars = null,
Action<string, StreamWriter> lineProcessor = null)
private static void Run(string name, string args, Action<string, StreamWriter> lineProcessor = null)
{
var exitCode = RunProcess(name, args, envVars, lineProcessor);
if (exitCode != 0)
using (var p = Process.Start(new ProcessStartInfo
{
throw new Exception(string.Format("Process \"{0} {1}\" exited with error code {2}",
name, args, exitCode));
}
}
private static int RunProcess(string name, string args, IDictionary<string, string> envVars = null,
Action<string, StreamWriter> lineProcessor = null)
{
using (var p = new Process
Arguments = args,
FileName = name,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardInput = lineProcessor != null,
RedirectStandardOutput = lineProcessor != null
}))
{
StartInfo =
{
Arguments = args,
FileName = name,
UseShellExecute = false,
CreateNoWindow = true,
WorkingDirectory = Environment.CurrentDirectory,
RedirectStandardInput = lineProcessor != null,
RedirectStandardOutput = lineProcessor != null
}
})
{
if (envVars != null)
foreach (KeyValuePair<string, string> i in envVars)
p.StartInfo.EnvironmentVariables.Add(i.Key, i.Value);
p.Start();
if (lineProcessor == null)
{
p.WaitForExit();
@ -548,8 +449,19 @@ namespace CitizenMP.Server.Installer
}
}
return p.ExitCode;
if (p.ExitCode != 0)
{
throw new Exception(string.Format("Process \"{0} {1}\" exited with error code {2}",
name, args, p.ExitCode));
}
}
}
private static bool IsWin32()
{
return Environment.OSVersion.Platform == PlatformID.Win32NT ||
Environment.OSVersion.Platform == PlatformID.Win32S ||
Environment.OSVersion.Platform == PlatformID.Win32Windows;
}
}
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommandLineParser" version="1.9.71" targetFramework="net45" />
<package id="Costura.Fody-Mono" version="1.3.3.5" targetFramework="net45" developmentDependency="true" />
<package id="CommandLineParser" version="1.9.71" targetFramework="net40" />
<package id="Costura.Fody-Mono" version="1.3.3.5" targetFramework="net40" developmentDependency="true" />
<package id="Fody" version="1.26.4" targetFramework="net40" developmentDependency="true" />
<package id="GitVersionTask" version="2.0.0" targetFramework="net40" developmentDependency="true" />
<package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" />

View File

@ -1,16 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<generatePublisherEvidence enabled="false" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

View File

@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CitizenMP.Server.Updater.Wrapper</RootNamespace>
<AssemblyName>citimp_upd</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
@ -95,7 +95,8 @@
<Using xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Namespace="System" />
<Using xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Namespace="System.IO" />
<Using xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Namespace="System.Xml.Linq" />
<Code xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Type="Fragment" Language="cs"><![CDATA[
<Code xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Type="Fragment" Language="cs">
<![CDATA[
var config = XElement.Load(Config.ItemSpec).Elements("Costura").FirstOrDefault();
if (config == null) return true;
@ -114,8 +115,8 @@ var filesToCleanup = Files.Select(f => f.ItemSpec).Where(f => !excludedAssemblie
foreach (var item in filesToCleanup)
File.Delete(item);
]]></Code>
</Task>
]]>
</Code></Task>
</UsingTask>
<Target Name="CleanReferenceCopyLocalPaths" AfterTargets="AfterBuild;NonWinFodyTarget">
<CosturaCleanup Config="FodyWeavers.xml" Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<Costura CreateTemporaryAssemblies="true"/>
<Costura/>
</Weavers>

View File

@ -1,11 +1,10 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
// ReSharper disable once CheckNamespace
internal static class Program
internal class Program
{
private static int Main(string[] args)
private static void Main(string[] args)
{
var mainAsm = Assembly.Load("citizenmp_server_updater");
@ -13,7 +12,7 @@ internal static class Program
.GetMethod("Attach")
.Invoke(null, null);
return (int) mainAsm.GetType("CitizenMP.Server.Installer.Program")
mainAsm.GetType("CitizenMP.Server.Installer.Program")
.GetMethod("Main", BindingFlags.NonPublic | BindingFlags.Static)
.Invoke(null, new object[] {args});
}