From 8d906642d9eb023911a185959f23daae269c9f9d Mon Sep 17 00:00:00 2001 From: icedream Date: Mon, 12 Jan 2015 05:51:18 +0100 Subject: [PATCH] Update NuGet after certificates are updated, not before. --- src/updater/Program.cs | 45 ++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/updater/Program.cs b/src/updater/Program.cs index f237df9..c4895a2 100644 --- a/src/updater/Program.cs +++ b/src/updater/Program.cs @@ -202,7 +202,7 @@ namespace CitizenMP.Server.Installer { {"Configuration", "Release"}, {"Platform", "Any CPU"}, - {"DebugType", IsWin32() ? "None" : "pdbonly" }, + {"DebugType", IsWin32() ? "None" : "pdbonly"}, {"DebugSymbols", false.ToString()}, {"OutputPath", binOutputDirectory.FullName}, {"AllowedReferenceRelatedFileExtensions", "\".mdb\"=\"\";\".pdb\"=\"\";\".xml\"=\"\""} @@ -290,17 +290,6 @@ namespace CitizenMP.Server.Installer // Mono compatibility Environment.SetEnvironmentVariable("MONO_IOMAP", "all"); - { - // The NuGet.exe that is shipped with CitizenMP.Server has a few bugs... - var nugetExePath = Path.Combine(workspace.FullName, ".nuget", "NuGet.exe"); - Console.WriteLine("Updating NuGet..."); - File.Delete(nugetExePath); - using (var wc = new WebClient()) - { - wc.DownloadFile("https://nuget.org/NuGet.exe", nugetExePath); - } - } - // Make sure we restore nuget packages automatically and without permissions interfering with /tmp/nuget/ (edge case) var newTempDir = workspace.CreateSubdirectory(".tmp"); Environment.SetEnvironmentVariable("EnableNuGetPackageRestore", "true"); @@ -315,18 +304,17 @@ namespace CitizenMP.Server.Installer var loggers = new List(); if (logPath != null) loggers.Add(new FileLogger - { - Parameters = string.Format("LogFile={0}", logPath), - Verbosity = LoggerVerbosity.Detailed, - ShowSummary = true, - SkipProjectStartedText = true - }); - loggers.Add(new ConsoleLogger(LoggerVerbosity.Quiet) { ShowSummary = false }); + { + Parameters = string.Format("LogFile={0}", logPath), + Verbosity = LoggerVerbosity.Detailed, + ShowSummary = true, + SkipProjectStartedText = true + }); + loggers.Add(new ConsoleLogger(LoggerVerbosity.Quiet) {ShowSummary = false}); - // Use a different build route if running on the Mono interpreter + // Import/Update Mozilla certs for NuGet to not fail out on non-Windows machines if (!IsWin32()) { - // Import Mozilla certs for NuGet to not fail out try { // TODO: Make sure this does not fail out by checking if mozroots is installed @@ -341,7 +329,22 @@ namespace CitizenMP.Server.Installer Console.Error.WriteLine("ERROR: {0}", error.Message); throw; } + } + { + // The NuGet.exe that is shipped with CitizenMP.Server has a few bugs... + var nugetExePath = Path.Combine(workspace.FullName, ".nuget", "NuGet.exe"); + Console.WriteLine("Updating NuGet..."); + File.Delete(nugetExePath); + using (var wc = new WebClient()) + { + wc.DownloadFile("https://nuget.org/NuGet.exe", nugetExePath); + } + } + + // Use a different build route if running on the Mono interpreter + 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