diff --git a/.gitignore b/.gitignore index aa8061f0c9..7097de6024 100644 --- a/.gitignore +++ b/.gitignore @@ -255,4 +255,5 @@ paket-files/ # Python Tools for Visual Studio (PTVS) __pycache__/ -*.pyc \ No newline at end of file +*.pyc +Staging/ diff --git a/osu.Desktop.Deploy/App.config b/osu.Desktop.Deploy/App.config new file mode 100644 index 0000000000..d740e88600 --- /dev/null +++ b/osu.Desktop.Deploy/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs new file mode 100644 index 0000000000..902014ab65 --- /dev/null +++ b/osu.Desktop.Deploy/Program.cs @@ -0,0 +1,124 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; + +namespace osu.Desktop.Deploy +{ + class Program + { + static string NUGET_PATH = @"packages\NuGet.CommandLine.3.5.0\tools\NuGet.exe"; + static string SQUIRREL_PATH = @"packages\squirrel.windows.1.5.2\tools\Squirrel.exe"; + static string MSBUILD_PATH = @"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"; + + static string STAGING_FOLDER = "Staging"; + static string PROJECT_NAME = "osu.Desktop"; + + static string CODE_SIGNING_CMD => $"/a /f {CODE_SIGNING_CERT} /p {codeSigningPassword} /t http://timestamp.comodoca.com/authenticode"; + static string IconPath => Path.Combine(SolutionPath, PROJECT_NAME, "lazer.ico"); + + static internal string HomeDir { get { return Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); } } + static internal string CODE_SIGNING_CERT => Path.Combine(HomeDir, "deanherbert.pfx"); + + static string SolutionPath => Environment.CurrentDirectory; + static string StagingPath => Path.Combine(SolutionPath, STAGING_FOLDER); + + static string codeSigningPassword; + + static void Main(string[] args) + { + FindSolutionPath(); + + if (Directory.Exists(STAGING_FOLDER)) + Directory.Delete(STAGING_FOLDER, true); + Directory.CreateDirectory(STAGING_FOLDER); + + string verBase = DateTime.Now.ToString("yyyy.Md."); + + int increment = 0; + + while (Directory.GetFiles("Releases", $"*{verBase}{increment}*").Count() > 0) + increment++; + + string ver = $"{verBase}{increment}"; + + Console.Write(ver); + + ver += Console.ReadLine(); + + Console.WriteLine("Enter code signing password:"); + + codeSigningPassword = Console.ReadLine(); + + Console.WriteLine("Restoring NuGet packages..."); + RunCommand(NUGET_PATH, "restore " + SolutionPath); + + Console.WriteLine("Running build process..."); + RunCommand(MSBUILD_PATH, $"/v:quiet /m /t:Client\\{PROJECT_NAME.Replace('.', '_')} /p:OutputPath={StagingPath};Configuration=Release osu.sln"); + + Console.WriteLine("Creating NuGet deployment package..."); + RunCommand(NUGET_PATH, $"pack osu.Desktop\\osu.nuspec -Version {ver} -Properties Configuration=Deploy -OutputDirectory {StagingPath} -BasePath {StagingPath}"); + + Console.WriteLine("Releasifying package..."); + RunCommand(SQUIRREL_PATH, $"--releasify {StagingPath}\\osulazer.{ver}.nupkg --setupIcon {IconPath} --icon {IconPath} -n \"{CODE_SIGNING_CMD}\" --no-msi"); + + File.Copy("Releases\\Setup.exe", "Releases\\install.exe", true); + File.Delete("Releases\\Setup.exe"); + + Console.WriteLine("Done!"); + + Console.ReadLine(); + } + + /// + /// Find the base path of the osu! solution (git checkout location) + /// + private static void FindSolutionPath() + { + string path = Path.GetDirectoryName(Environment.CommandLine.Replace("\"", "").Trim()); + + if (string.IsNullOrEmpty(path)) + path = Environment.CurrentDirectory; + + while (!File.Exists(path + "\\osu.sln")) + path = path.Remove(path.LastIndexOf('\\')); + path += "\\"; + + Environment.CurrentDirectory = path; + } + + private static bool RunCommand(string command, string args) + { + var psi = new ProcessStartInfo(command, args); + if (psi != null) + { + psi.WorkingDirectory = SolutionPath; + psi.CreateNoWindow = true; + psi.RedirectStandardOutput = true; + psi.UseShellExecute = false; + psi.WindowStyle = ProcessWindowStyle.Hidden; + Process p = Process.Start(psi); + string output = p.StandardOutput.ReadToEnd(); + if (p.ExitCode != 0) + { + Console.WriteLine(output); + Error($"Command {command} {args} failed!"); + return false; + } + + return true; + } + + return false; + } + + private static void Error(string p) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine("ERROR: " + p); + + Console.ReadLine(); + Environment.Exit(-1); + } + } +} diff --git a/osu.Desktop.Deploy/Properties/AssemblyInfo.cs b/osu.Desktop.Deploy/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..c71d82df00 --- /dev/null +++ b/osu.Desktop.Deploy/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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("osu.Desktop.Deploy")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("osu.Desktop.Deploy")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("baea2f74-0315-4667-84e0-acac0b4bf785")] + +// 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 Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj new file mode 100644 index 0000000000..3d4b86fc93 --- /dev/null +++ b/osu.Desktop.Deploy/osu.Desktop.Deploy.csproj @@ -0,0 +1,108 @@ + + + + + Debug + AnyCPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785} + Exe + Properties + osu.Desktop.Deploy + osu.Desktop.Deploy + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.dll + True + + + ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.MsDelta.dll + True + + + ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.PatchApi.dll + True + + + ..\packages\squirrel.windows.1.5.2\lib\Net45\ICSharpCode.SharpZipLib.dll + True + + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll + True + + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll + True + + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll + True + + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll + True + + + ..\packages\squirrel.windows.1.5.2\lib\Net45\NuGet.Squirrel.dll + True + + + ..\packages\Splat.1.6.2\lib\Net45\Splat.dll + True + + + ..\packages\squirrel.windows.1.5.2\lib\Net45\Squirrel.dll + True + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/osu.Desktop.Deploy/packages.config b/osu.Desktop.Deploy/packages.config new file mode 100644 index 0000000000..466190ccab --- /dev/null +++ b/osu.Desktop.Deploy/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/osu.Desktop/Properties/AssemblyInfo.cs b/osu.Desktop/Properties/AssemblyInfo.cs index 1f234d2993..825bf6c184 100644 --- a/osu.Desktop/Properties/AssemblyInfo.cs +++ b/osu.Desktop/Properties/AssemblyInfo.cs @@ -22,5 +22,5 @@ using System.Runtime.InteropServices; // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("55e28cb2-7b6c-4595-8dcc-9871d8aad7e9")] -[assembly: AssemblyVersion("0.0.5")] -[assembly: AssemblyFileVersion("0.0.5")] +[assembly: AssemblyVersion("2017.212.0")] +[assembly: AssemblyFileVersion("2017.212.0")] diff --git a/osu.Desktop/osu.nuspec b/osu.Desktop/osu.nuspec new file mode 100644 index 0000000000..93aaebfe6f --- /dev/null +++ b/osu.Desktop/osu.nuspec @@ -0,0 +1,25 @@ + + + + osulazer + 0.0.0 + osulazer + ppy Pty Ltd + Dean Herbert + https://osu.ppy.sh/ + https://puu.sh/tYyXZ/9a01a5d1b0.ico + false + click the circles. to the beat. + click the circles. + testing + Copyright ppy Pty Ltd 2007-2017 + en-AU + + + + + + + + + diff --git a/osu.sln b/osu.sln index 588cabf6b6..735c19b699 100644 --- a/osu.sln +++ b/osu.sln @@ -31,60 +31,93 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Modes.Mania", "osu EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.Tests", "osu.Desktop.Tests\osu.Desktop.Tests.csproj", "{230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.Deploy", "osu.Desktop.Deploy\osu.Desktop.Deploy.csproj", "{BAEA2F74-0315-4667-84E0-ACAC0B4BF785}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Release (Deploy)|Any CPU = Release (Deploy)|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release (Deploy)|Any CPU.ActiveCfg = Deploy|Any CPU + {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release (Deploy)|Any CPU.Build.0 = Deploy|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.ActiveCfg = Release|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.Build.0 = Release|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Release|Any CPU.ActiveCfg = Release|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Release|Any CPU.Build.0 = Release|Any CPU {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.Release|Any CPU.ActiveCfg = Release|Any CPU {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.Release|Any CPU.Build.0 = Release|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Release|Any CPU.ActiveCfg = Release|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Release|Any CPU.Build.0 = Release|Any CPU {65DC628F-A640-4111-AB35-3A5652BC1E17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {65DC628F-A640-4111-AB35-3A5652BC1E17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65DC628F-A640-4111-AB35-3A5652BC1E17}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {65DC628F-A640-4111-AB35-3A5652BC1E17}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU {65DC628F-A640-4111-AB35-3A5652BC1E17}.Release|Any CPU.ActiveCfg = Release|Any CPU {65DC628F-A640-4111-AB35-3A5652BC1E17}.Release|Any CPU.Build.0 = Release|Any CPU {69051C69-12AE-4E7D-A3E6-460D2E282312}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {69051C69-12AE-4E7D-A3E6-460D2E282312}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69051C69-12AE-4E7D-A3E6-460D2E282312}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {69051C69-12AE-4E7D-A3E6-460D2E282312}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU {69051C69-12AE-4E7D-A3E6-460D2E282312}.Release|Any CPU.ActiveCfg = Release|Any CPU {69051C69-12AE-4E7D-A3E6-460D2E282312}.Release|Any CPU.Build.0 = Release|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {54377672-20B1-40AF-8087-5CF73BF3953A}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {54377672-20B1-40AF-8087-5CF73BF3953A}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Release|Any CPU.ActiveCfg = Release|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Release|Any CPU.Build.0 = Release|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C92A607B-1FDD-4954-9F92-03FF547D9080}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {C92A607B-1FDD-4954-9F92-03FF547D9080}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Release|Any CPU.ActiveCfg = Release|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Release|Any CPU.Build.0 = Release|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Release|Any CPU.ActiveCfg = Release|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Release|Any CPU.Build.0 = Release|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F167E17A-7DE6-4AF5-B920-A5112296C695}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {F167E17A-7DE6-4AF5-B920-A5112296C695}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Release|Any CPU.ActiveCfg = Release|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Release|Any CPU.Build.0 = Release|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Debug|Any CPU.Build.0 = Debug|Any CPU + {48F4582B-7687-4621-9CBE-5C24197CB536}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {48F4582B-7687-4621-9CBE-5C24197CB536}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.ActiveCfg = Release|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.Build.0 = Release|Any CPU {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Release|Any CPU.ActiveCfg = Release|Any CPU {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Release|Any CPU.Build.0 = Release|Any CPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release (Deploy)|Any CPU.ActiveCfg = Release|Any CPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release (Deploy)|Any CPU.Build.0 = Release|Any CPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -102,6 +135,7 @@ Global {F167E17A-7DE6-4AF5-B920-A5112296C695} = {0D37A2AD-80A4-464F-A1DE-1560B70F1CE3} {48F4582B-7687-4621-9CBE-5C24197CB536} = {0D37A2AD-80A4-464F-A1DE-1560B70F1CE3} {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D} = {0D37A2AD-80A4-464F-A1DE-1560B70F1CE3} + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785} = {0D37A2AD-80A4-464F-A1DE-1560B70F1CE3} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0