Compare commits

...

15 Commits

Author SHA1 Message Date
Carl Kittelberger 163f231cee Update EasyInstall_Windows.md
- Added Microsoft Build Tools 2013 reference
2015-01-21 10:09:41 +01:00
Icedream d0d8779b88 Updating documents. 2015-01-16 12:11:32 +01:00
Icedream 294d39edb7 Update libgit2 Linux binaries. Closes #2. 2015-01-16 10:57:32 +01:00
Icedream 1cea040c48 Remove assembly load debug lines. 2015-01-16 10:42:35 +01:00
Icedream 853140b905 Emulate xbuild targeting behavior on Mono. Closes #1.
- Added subprocess startup with assembly binding redirection to enforce MSBuild version 12 system (https://github.com/mono/mono/blob/master/mcs/tools/xbuild/data/xbuild.exe.config.in). I don't know how many nasty side effects this causes as the code is pretty poor, so pleeeeeaaaaaase do report bugs on this.
2015-01-16 10:35:58 +01:00
Icedream 364fee11dd Return exit values through wrapper. 2015-01-16 10:25:16 +01:00
Icedream e5d1675ee6 Merge remote-tracking branch 'origin/master' into develop 2015-01-15 09:04:50 +01:00
Icedream 14ed7085e0 Updating libgit2 Linux binaries. These ones were built on Debian Squeeze, should solve the issue with GLIBC, for real. 2015-01-15 08:55:37 +01:00
Icedream 80727029d6 Upgrade target to .NET Framework 4.5. Related to #1. 2015-01-14 23:02:45 +01:00
Carl Kittelberger bfac6bc5a6 Update Terminal_Linux.md
Replaced wrong link.
2015-01-14 10:03:27 +01:00
Icedream 63a006b1b2 Bumping version in Linux instructions. 2015-01-14 08:49:47 +01:00
Icedream d24ab3c724 Added Linux server setup guide. 2015-01-14 08:43:57 +01:00
Icedream e2d35b958d Adding easy server installation guide for Windows. 2015-01-14 08:18:25 +01:00
Icedream 8f1bb919c0 Edited readme file. 2015-01-14 08:06:31 +01:00
Icedream ab018c23c9 New, size-reduced libgit2 Linux binaries compiled on Ubuntu 12.04, this should help the few issues with GLIBC! 2015-01-14 07:47:24 +01:00
16 changed files with 293 additions and 75 deletions

View File

@ -1,4 +1,67 @@
citizenmp-server-updater
CitizenMP Server Updater
========================
_by Carl Kittelberger_
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)
- Creates ready-to-use start scripts for your platform
- No extra setup besides requirements listed below 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
- 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
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/))
*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/).
Guides
------
- [Easy server installation on Windows](docs/EasyInstall_Windows.md)
- [Server installation on Linux](docs/Terminal_Linux.md)
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
© 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>.
citimp_upd [options...] "<targetpath>"
-v, --verbosity (Default: Quiet) Sets the build output verbosity. Possible values: Minimal, Quiet, Normal, Detailed, Diagnostic
--source (Default: src) Sets the path where the source files will be stored.
--log (Default: True) Write a log file "build.log" to the output folder.
--version (Default: False) Shows this tool's version.
--help Display this help screen.
```
Examples:
- Install server on Linux/Windows into a folder named "MyServer" via command-line: ```citimp_upd MyServer``` (on Windows) or ```mono citimp_upd.exe MyServer``` (on Linux)
- Install server on Windows into a folder named "MyServer" without command-line: Just create a folder named "MyServer" and drag-n-drop it onto citimp_upd.exe!
- Install server on Windows into "C:\Server\CitizenMP" and put the source code to "C:\Source\CitizenMP": ```citimp_upd.exe --source "C:\Source\CitizenMP" "C:\Server\CitizenMP"```

View File

@ -0,0 +1,13 @@
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.

12
docs/Terminal_Linux.md Normal file
View File

@ -0,0 +1,12 @@
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```
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.

View File

@ -1,6 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<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

@ -0,0 +1,16 @@
<?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.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>95b7e825</NuGetPackageImportStamp>
<TargetFrameworkProfile />
@ -48,29 +48,21 @@
<StartupObject>CitizenMP.Server.Installer.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<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 Include="CommandLine">
<HintPath>$(SolutionDir)\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath>
</Reference>
<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="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="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" />
@ -97,6 +89,7 @@
<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>
@ -202,7 +195,6 @@ 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.

14
src/updater/Extensions.cs Normal file
View File

@ -0,0 +1,14 @@
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,7 +13,6 @@ 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
@ -59,6 +58,13 @@ 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();
@ -238,7 +244,7 @@ namespace CitizenMP.Server.Installer
{
{"Configuration", "Release"},
{"Platform", "Any CPU"},
{"DebugType", IsWin32() ? "None" : "pdbonly"},
{"DebugType", Environment.OSVersion.IsWin32() ? "None" : "pdbonly"},
{"DebugSymbols", false.ToString()},
{"OutputPath", binOutputDirectory.FullName},
{"AllowedReferenceRelatedFileExtensions", "\".mdb\"=\"\";\".pdb\"=\"\";\".xml\"=\"\""}
@ -315,6 +321,62 @@ 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)
{
@ -349,7 +411,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 (!IsWin32())
if (!Environment.OSVersion.IsWin32())
{
try
{
@ -357,15 +419,18 @@ namespace CitizenMP.Server.Installer
{
if (s == null || !s.Contains("X.509 Certificate"))
return;
writer.WriteLine("y");
writer.WriteLine("yes");
});
// TODO: Make sure this does not fail out by checking if mozroots is installed
Console.WriteLine("Updating SSL certificates for NuGet...");
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);
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);
}
catch (Exception error)
{
@ -386,18 +451,27 @@ namespace CitizenMP.Server.Installer
}
// Use a different build route if running on the Mono interpreter
if (!IsWin32())
if (!Environment.OSVersion.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.GlobalEngine.RegisterLogger(logger);
var project = new Project(Engine.GlobalEngine) {BuildEnabled = true};
project.Load(projectFilePath);
engine.RegisterLogger(logger);
// Apply build properties
var buildPropertiesConverted = new BuildPropertyGroup();
engine.GlobalProperties = buildPropertiesConverted;
foreach (var property in buildProperties)
project.GlobalProperties.SetProperty(property.Key, property.Value);
var result = project.Build();
buildPropertiesConverted.SetProperty(property.Key, property.Value);
// Load project
var result = engine.BuildProjectFile(projectFilePath, new string[0], null, null,
BuildSettings.None,
null);
#pragma warning restore 618
return result;
}
@ -406,7 +480,8 @@ 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)
@ -424,18 +499,42 @@ namespace CitizenMP.Server.Installer
}
}
private static void Run(string name, string args, Action<string, StreamWriter> lineProcessor = null)
private static void RunProcessThrowOnException(string name, string args,
IDictionary<string, string> envVars = null,
Action<string, StreamWriter> lineProcessor = null)
{
using (var p = Process.Start(new ProcessStartInfo
var exitCode = RunProcess(name, args, envVars, lineProcessor);
if (exitCode != 0)
{
Arguments = args,
FileName = name,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardInput = lineProcessor != null,
RedirectStandardOutput = lineProcessor != null
}))
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
{
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();
@ -449,19 +548,8 @@ namespace CitizenMP.Server.Installer
}
}
if (p.ExitCode != 0)
{
throw new Exception(string.Format("Process \"{0} {1}\" exited with error code {2}",
name, args, p.ExitCode));
}
return 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="net40" />
<package id="Costura.Fody-Mono" version="1.3.3.5" targetFramework="net40" developmentDependency="true" />
<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="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,6 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<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.Updater.Wrapper</RootNamespace>
<AssemblyName>citimp_upd</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
@ -95,8 +95,7 @@
<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;
@ -115,8 +114,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/>
<Costura CreateTemporaryAssemblies="true"/>
</Weavers>

View File

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