diff --git a/UMFTests/Properties/AssemblyInfo.cs b/UMFTests/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..b3800af
--- /dev/null
+++ b/UMFTests/Properties/AssemblyInfo.cs
@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("UMFTests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UMFTests")]
+[assembly: AssemblyCopyright("Copyright © 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("b5e72137-b161-4517-a47b-9c191a1edca5")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/UMFTests/UMFS.cs b/UMFTests/UMFS.cs
new file mode 100644
index 0000000..8c27d42
--- /dev/null
+++ b/UMFTests/UMFS.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Linq;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using UnityMultiFramework;
+
+namespace UMFTests
+{
+ [TestClass]
+ public class UMFS
+ {
+ [TestMethod]
+ public void TestFileLocations()
+ {
+ var a = Unity.Projects.ToList();
+
+ }
+ }
+}
diff --git a/UMFTests/UMFTests.csproj b/UMFTests/UMFTests.csproj
new file mode 100644
index 0000000..b05c5f1
--- /dev/null
+++ b/UMFTests/UMFTests.csproj
@@ -0,0 +1,73 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}
+ Library
+ Properties
+ UMFTests
+ UMFTests
+ v4.7
+ 512
+ {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 15.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages
+ False
+ UnitTest
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
+
+
+ ..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {dc81ac27-1181-4cde-be6d-af159ff912c1}
+ UnityMultiFramework
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/UMFTests/packages.config b/UMFTests/packages.config
new file mode 100644
index 0000000..a4b6ae9
--- /dev/null
+++ b/UMFTests/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/UnityMultiFramework/Accessors/ExecutableAccessor.cs b/UnityMultiFramework/Accessors/ExecutableAccessor.cs
new file mode 100644
index 0000000..f496c44
--- /dev/null
+++ b/UnityMultiFramework/Accessors/ExecutableAccessor.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace UnityMultiFramework
+{
+ public class ExecutableAccessor : IEnumerable
+ {
+ internal ExecutableAccessor() { }
+
+ public List Locations = new List();
+
+ public void AddIn(Uri baseLocation)
+ => Locations.AddRange(FindIn(baseLocation));
+
+ private IEnumerable FindIn(Uri baseLocation)
+ => System.IO.Directory
+ .EnumerateFiles(baseLocation.LocalPath, "Unity.exe", System.IO.SearchOption.AllDirectories)
+ .Select(loc => new Executable(new Uri(loc)));
+
+ public IEnumerable ClosestExecutables(IVersionable ver)
+ => Locations.Where(loc => loc.FuzzyEquals(ver)).OrderBy(exe => Math.Abs(exe.FuzzyCompareTo(ver)));
+
+ public IEnumerator GetEnumerator()
+ {
+ return ((IEnumerable)Locations).GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return ((IEnumerable)Locations).GetEnumerator();
+ }
+ }
+
+}
diff --git a/UnityMultiFramework/Accessors/ProjectAccessor.cs b/UnityMultiFramework/Accessors/ProjectAccessor.cs
new file mode 100644
index 0000000..31feabb
--- /dev/null
+++ b/UnityMultiFramework/Accessors/ProjectAccessor.cs
@@ -0,0 +1,58 @@
+using Microsoft.Win32;
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Collections;
+
+namespace UnityMultiFramework
+{
+
+ public class ProjectAccessor : IEnumerable
+ {
+ private const string UNITYREGKEY = @"SOFTWARE\Unity Technologies\Unity Editor 5.x\";
+
+ internal ProjectAccessor() { }
+
+ private List ExtraLocations = new List();
+
+ public IEnumerable ProjectLocations
+ => ExistingLocations
+ .Select(uri => new Project(uri));
+
+ public IEnumerable ExistingLocations
+ => ExtraLocations
+ .Concat((RegKeyToUri() ?? Enumerable.Empty()))
+ .Distinct()
+ .Where(uri =>
+ Directory.Exists(uri.LocalPath) &&
+ Directory.Exists(Path.Combine(uri.LocalPath, "Assets"))
+ );
+
+ public void AddLocations(params Uri[] uris)
+ => ExtraLocations.AddRange(uris);
+
+ public IEnumerable RegKeyToUri()
+ {
+ RegistryKey UnityRegKey = Registry
+ .CurrentUser
+ .OpenSubKey(UNITYREGKEY, false);
+
+ return UnityRegKey?
+ .GetValueNames()
+ .Where(key => key.StartsWith("RecentlyUsedProjectPaths"))
+ .Select(key =>
+ new Uri(Encoding.UTF8.GetString(UnityRegKey.GetValue(key) as byte[]).TrimEnd((char)0))
+ );
+ }
+
+ #region IEnumerable
+
+ public IEnumerator GetEnumerator() => ProjectLocations.GetEnumerator();
+
+ IEnumerator IEnumerable.GetEnumerator() => ProjectLocations.GetEnumerator();
+
+ #endregion
+ }
+}
diff --git a/UnityMultiFramework/Executable.cs b/UnityMultiFramework/Executable.cs
new file mode 100644
index 0000000..977b97f
--- /dev/null
+++ b/UnityMultiFramework/Executable.cs
@@ -0,0 +1,52 @@
+using System;
+
+namespace UnityMultiFramework
+{
+ public class Executable : IVersionable, IEquatable, ILaunchable
+ {
+ private const string WILDCARD = "*";
+
+ private Executable() { }
+
+ public Executable(Uri Location)
+ {
+ this.Location = Location;
+ VersionType = WILDCARD;
+
+ var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(Location.LocalPath);
+ Version = new Version(versionInfo.ProductMajorPart, versionInfo.ProductMinorPart, versionInfo.ProductBuildPart, 0);
+ }
+
+ public Uri Location { get; private set; }
+
+ public Version Version { get; private set; }
+
+ public string VersionType { get; set; }
+
+ public int MinorVersion { set { Version = new Version(Version.Major, Version.Minor, Version.Build, value); } }
+
+ public void Launch(params string[] args)
+ => System.Diagnostics.Process.Start(Location.LocalPath, string.Join(" ", args));
+
+ public int CompareTo(IVersionable other)
+ => Version.CompareTo(other);
+
+ public bool Equals(IVersionable other)
+ => FuzzyEquals(other) && (VersionType == WILDCARD || other.VersionType == WILDCARD) ? true : (VersionType == other.VersionType);
+
+ public bool FuzzyEquals(IVersionable other)
+ {
+ return (Version.Major == other.Version.Major) && (Version.Minor == other.Version.Minor) && (Version.Build == other.Version.Build);
+ }
+
+ public int FuzzyCompareTo(IVersionable other)
+ {
+ if ( !FuzzyEquals(other) ) { return CompareTo(other); }
+ if( VersionType != other.VersionType ) { return VersionType.CompareTo(other.VersionType); }
+ return Version.Revision - other.Version.Revision;
+ }
+
+ public bool Equals(Executable other)
+ => Location == other.Location;
+ }
+}
diff --git a/UnityMultiFramework/Interfaces/ILaunchable.cs b/UnityMultiFramework/Interfaces/ILaunchable.cs
new file mode 100644
index 0000000..f2c0419
--- /dev/null
+++ b/UnityMultiFramework/Interfaces/ILaunchable.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace UnityMultiFramework
+{
+ public interface ILaunchable
+ {
+ void Launch(params string[] args);
+ }
+}
diff --git a/UnityMultiFramework/Interfaces/IVersionable.cs b/UnityMultiFramework/Interfaces/IVersionable.cs
new file mode 100644
index 0000000..7e9aef5
--- /dev/null
+++ b/UnityMultiFramework/Interfaces/IVersionable.cs
@@ -0,0 +1,13 @@
+using System;
+
+namespace UnityMultiFramework
+{
+ public interface IVersionable : IComparable, IEquatable
+ {
+ Version Version { get; }
+ string VersionType { get; }
+
+ //bool operator ==(IVersionable lhs, IVersionable rhs);
+ //bool operator !=(IVersionable lhs, IVersionable rhs);
+ }
+}
\ No newline at end of file
diff --git a/UnityMultiFramework/Project.cs b/UnityMultiFramework/Project.cs
new file mode 100644
index 0000000..0cfc446
--- /dev/null
+++ b/UnityMultiFramework/Project.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text.RegularExpressions;
+using System.Linq;
+using System.Text;
+
+namespace UnityMultiFramework
+{
+
+ [System.Diagnostics.DebuggerDisplay("Name = {Name}, Version = {ProjectVersionString}")]
+ public class Project : IVersionable, IEquatable, ILaunchable
+ {
+ //m_EditorVersion: 2017.1.0f3
+ private static Regex versionExp = new Regex(@"^m_EditorVersion: (\d+\.\d+\.\d+([A-z]{1,4})\d+)", RegexOptions.Compiled);
+
+ public Project(Uri location)
+ {
+ Location = location;
+ LoadVersionInfo();
+ Name = Uri.UnescapeDataString(Location.Segments.Last());
+ }
+
+ public string Name { get; private set; }
+
+ public Uri Location { get; private set; }
+
+ public string ProjectVersionString { get; private set; }
+
+ public Version Version { get; private set; }
+
+ public string VersionType { get; private set; }
+
+ private void LoadVersionInfo()
+ {
+ var filename = Path.Combine(Location.LocalPath, @"ProjectSettings\ProjectVersion.txt");
+ if (File.Exists(filename))
+ {
+ var filedata = File.ReadAllText(filename, Encoding.UTF8);
+ var matches = versionExp.Match(filedata);
+ try
+ {
+ ProjectVersionString = matches.Groups[1].Value;
+ VersionType = matches.Groups[2].Value;
+ Version = Version.Parse(ProjectVersionString.Replace(VersionType, "."));
+ }
+ catch (Exception E)
+ {
+ E.Data["ProjectText"] = filedata.ToString();
+ E.Data["Matches"] = matches.ToString();
+ throw;
+ }
+ }
+ }
+
+ public void Launch(params string[] args)
+ => Launch(Unity.Executables.ClosestExecutables(this).First(), args);
+
+ public void Launch(Executable exe = null, params string[] args)
+ {
+ var argsList = args.ToList();
+ argsList.Insert(0, $@"-projectpath ""{Location.LocalPath}""");
+
+ exe.Launch(argsList.ToArray());
+ }
+
+ #region Interfaces
+
+ public int CompareTo(IVersionable other)
+ {
+ return this.Version.CompareTo(other.Version);
+ }
+
+ public bool Equals(IVersionable other)
+ {
+ return Version == other.Version && VersionType == other.VersionType;
+ }
+
+ public bool Equals(Project other)
+ {
+ return Location == other.Location;
+ }
+
+ #endregion
+ }
+}
diff --git a/UnityMultiFramework/Properties/AssemblyInfo.cs b/UnityMultiFramework/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..126924d
--- /dev/null
+++ b/UnityMultiFramework/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("UnityMultiFramework")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UnityMultiFramework")]
+[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("dc81ac27-1181-4cde-be6d-af159ff912c1")]
+
+// 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/UnityMultiFramework/Settings.cs b/UnityMultiFramework/Settings.cs
new file mode 100644
index 0000000..b9cae5e
--- /dev/null
+++ b/UnityMultiFramework/Settings.cs
@@ -0,0 +1,9 @@
+using System.Collections.Generic;
+
+namespace UnityMultiFramework
+{
+ public class Settings
+ {
+ public List Locations;
+ }
+}
diff --git a/UnityMultiFramework/Unity.cs b/UnityMultiFramework/Unity.cs
new file mode 100644
index 0000000..0026767
--- /dev/null
+++ b/UnityMultiFramework/Unity.cs
@@ -0,0 +1,91 @@
+using System;
+using System.Linq;
+
+namespace UnityMultiFramework
+{
+ public static partial class Unity
+ {
+ public static ExecutableAccessor Executables = new ExecutableAccessor();
+
+ public static ProjectAccessor Projects = new ProjectAccessor();
+
+ public static void LoadSettings(Settings settings)
+ {
+ if(settings == null) { return; }
+ Executables.Locations = settings.Locations;
+ }
+
+ public static Settings GetSettings()
+ {
+ return new Settings()
+ {
+ Locations = Executables.ToList()
+ };
+ }
+ }
+}
+// public static class Util
+// {
+// //private static Regex versionExp = new Regex(@"(\d+)\.(\d+)\.(\d+)([A-z]+)(\d+)", RegexOptions.Compiled);
+
+
+
+// public static string UnityProjectSettings(Uri project, string key)
+// {
+// var filename = System.IO.Path.Combine(project.LocalPath, @"ProjectSettings/ProjectSettings.asset");
+// var data = System.IO.File.ReadAllBytes(filename);
+// var filestring = Encoding.UTF8.GetString(data);
+// if (filestring.StartsWith(@"%YAML 1.1"))
+// {
+// // File is not binary
+// //lines = Encoding.ASCII.GetString(data);
+// }
+// else
+// {
+// filestring = Encoding.ASCII.GetString(data);
+// //File is binary
+// }
+
+// //var compat = lines.Where(line => line.Trim(' ').StartsWith(key)).ToList();
+// //return compat.Count > 0? compat[0].Split(':')?[1] : "";
+// return "";
+
+// }
+
+
+
+// public static Uri GetUnityExecutableFromVersion(Version version)
+// {
+// //return ProgramConfig.conf.ValidUnityExeLocations
+// // .Select(loc => (loc, GetUnityVersionFromExecutable(loc)))
+// // .Where(exe => version.Major == exe.Item2.Major && version.Minor == exe.Item2.Minor && version.Build == exe.Item2.Build)
+// // .Aggregate((Uri null, Version null), (working, next) => working.Item2.Revision > next.Item2.Revision ? working : next).Item1;
+
+// foreach (var exe in ProgramConfig.conf.ValidUnityExeLocations)
+// {
+// var a = GetUnityVersionFromExecutable(exe);
+// if (version.Major == a.Major && version.Minor == a.Minor && version.Build == a.Build)
+// {
+// return exe;
+// }
+// }
+// return null;
+// }
+
+// public static Version GetUnityVersionFromExecutable(Uri exec)
+// {
+// var versionInfo = FileVersionInfo.GetVersionInfo(exec.LocalPath);
+// return new Version(versionInfo.ProductMajorPart, versionInfo.ProductMinorPart, versionInfo.ProductBuildPart, 0);
+// }
+
+// public static void DumpUnityVersionInfo(Uri exec)
+// {
+// var versionInfo = FileVersionInfo.GetVersionInfo(exec.LocalPath);
+// System.Threading.Tasks.Task.Run(() => Newtonsoft.Json.JsonConvert.SerializeObject(versionInfo)).ContinueWith((input) => {
+// System.IO.File.WriteAllText(versionInfo.ProductName + "_" + versionInfo.ProductVersion + ".json", input.Result);
+
+// })
+
+//;
+// }
+// }
diff --git a/UnityMultiFramework/UnityMultiFramework.csproj b/UnityMultiFramework/UnityMultiFramework.csproj
new file mode 100644
index 0000000..a0e5c09
--- /dev/null
+++ b/UnityMultiFramework/UnityMultiFramework.csproj
@@ -0,0 +1,54 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}
+ Library
+ Properties
+ UnityMultiFramework
+ UnityMultiFramework
+ v4.7
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/UnityMultiLauncher.sln b/UnityMultiLauncher.sln
index d40c049..250ca78 100644
--- a/UnityMultiLauncher.sln
+++ b/UnityMultiLauncher.sln
@@ -1,25 +1,133 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
+# Visual Studio 15
+VisualStudioVersion = 15.0.27004.2009
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityMultiLauncher", "UnityMultiLauncher\UnityMultiLauncher.csproj", "{5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFireUtil", "WPFireUtil\WPFireUtil.csproj", "{604B15C9-2391-4D76-B2ED-F4E427F288AE}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityMultiFramework", "UnityMultiFramework\UnityMultiFramework.csproj", "{DC81AC27-1181-4CDE-BE6D-AF159FF912C1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UMFTests", "UMFTests\UMFTests.csproj", "{B5E72137-B161-4517-A47B-9C191A1EDCA5}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|ARM = Debug|ARM
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
ExampleDev|Any CPU = ExampleDev|Any CPU
+ ExampleDev|ARM = ExampleDev|ARM
+ ExampleDev|x64 = ExampleDev|x64
+ ExampleDev|x86 = ExampleDev|x86
Release|Any CPU = Release|Any CPU
+ Release|ARM = Release|ARM
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Debug|ARM.Build.0 = Debug|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Debug|x64.Build.0 = Debug|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Debug|x86.Build.0 = Debug|Any CPU
{5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.ExampleDev|Any CPU.ActiveCfg = ExampleDev|Any CPU
{5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.ExampleDev|Any CPU.Build.0 = ExampleDev|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.ExampleDev|ARM.ActiveCfg = ExampleDev|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.ExampleDev|ARM.Build.0 = ExampleDev|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.ExampleDev|x64.ActiveCfg = ExampleDev|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.ExampleDev|x64.Build.0 = ExampleDev|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.ExampleDev|x86.ActiveCfg = ExampleDev|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.ExampleDev|x86.Build.0 = ExampleDev|Any CPU
{5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Release|ARM.ActiveCfg = Release|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Release|ARM.Build.0 = Release|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Release|x64.ActiveCfg = Release|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Release|x64.Build.0 = Release|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Release|x86.ActiveCfg = Release|Any CPU
+ {5468AB5C-3920-47B5-8FB8-3E6B084DCCFB}.Release|x86.Build.0 = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Debug|ARM.Build.0 = Debug|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Debug|x64.Build.0 = Debug|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Debug|x86.Build.0 = Debug|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.ExampleDev|Any CPU.ActiveCfg = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.ExampleDev|Any CPU.Build.0 = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.ExampleDev|ARM.ActiveCfg = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.ExampleDev|ARM.Build.0 = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.ExampleDev|x64.ActiveCfg = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.ExampleDev|x64.Build.0 = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.ExampleDev|x86.ActiveCfg = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.ExampleDev|x86.Build.0 = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Release|ARM.ActiveCfg = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Release|ARM.Build.0 = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Release|x64.ActiveCfg = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Release|x64.Build.0 = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Release|x86.ActiveCfg = Release|Any CPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}.Release|x86.Build.0 = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Debug|ARM.Build.0 = Debug|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Debug|x64.Build.0 = Debug|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Debug|x86.Build.0 = Debug|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.ExampleDev|Any CPU.ActiveCfg = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.ExampleDev|Any CPU.Build.0 = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.ExampleDev|ARM.ActiveCfg = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.ExampleDev|ARM.Build.0 = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.ExampleDev|x64.ActiveCfg = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.ExampleDev|x64.Build.0 = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.ExampleDev|x86.ActiveCfg = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.ExampleDev|x86.Build.0 = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Release|ARM.ActiveCfg = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Release|ARM.Build.0 = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Release|x64.ActiveCfg = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Release|x64.Build.0 = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Release|x86.ActiveCfg = Release|Any CPU
+ {DC81AC27-1181-4CDE-BE6D-AF159FF912C1}.Release|x86.Build.0 = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Debug|ARM.Build.0 = Debug|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Debug|x64.Build.0 = Debug|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Debug|x86.Build.0 = Debug|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.ExampleDev|Any CPU.ActiveCfg = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.ExampleDev|Any CPU.Build.0 = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.ExampleDev|ARM.ActiveCfg = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.ExampleDev|ARM.Build.0 = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.ExampleDev|x64.ActiveCfg = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.ExampleDev|x64.Build.0 = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.ExampleDev|x86.ActiveCfg = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.ExampleDev|x86.Build.0 = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Release|ARM.ActiveCfg = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Release|ARM.Build.0 = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Release|x64.ActiveCfg = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Release|x64.Build.0 = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Release|x86.ActiveCfg = Release|Any CPU
+ {B5E72137-B161-4517-A47B-9C191A1EDCA5}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {07930745-B85E-474C-8135-AEAB4E2CF886}
+ EndGlobalSection
EndGlobal
diff --git a/UnityMultiLauncher/App.config b/UnityMultiLauncher/App.config
index 88fa402..125a5a9 100644
--- a/UnityMultiLauncher/App.config
+++ b/UnityMultiLauncher/App.config
@@ -1,6 +1,14 @@
-
+
-
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
diff --git a/UnityMultiLauncher/App.xaml b/UnityMultiLauncher/App.xaml
index 1702956..68e0c15 100644
--- a/UnityMultiLauncher/App.xaml
+++ b/UnityMultiLauncher/App.xaml
@@ -2,24 +2,115 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:UnityMultiLauncher"
-
+ xmlns:Dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
+ xmlns:FireUtil="clr-namespace:WPFireUtil;assembly=WPFireUtil"
+ xmlns:Converter="clr-namespace:UnityMultiLauncher.Controls.Converters"
+ xmlns:VM="clr-namespace:UnityMultiLauncher.ViewModels"
StartupUri="Views\MainWindow.xaml">
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UnityMultiLauncher/App.xaml.cs b/UnityMultiLauncher/App.xaml.cs
index 62ef1a4..bf00a0b 100644
--- a/UnityMultiLauncher/App.xaml.cs
+++ b/UnityMultiLauncher/App.xaml.cs
@@ -1,10 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
+using System.Windows;
+using System;
using MahApps.Metro;
namespace UnityMultiLauncher
@@ -22,8 +17,37 @@ protected override void OnStartup(StartupEventArgs e)
// now set the Green accent and dark theme
ThemeManager.ChangeAppStyle(Application.Current, ProgramConfig.conf.appStyle.Item2, ProgramConfig.conf.appStyle.Item1);
+ Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
base.OnStartup(e);
+
+ UnityMultiFramework.Unity.LoadSettings(ProgramConfig.conf.setings);
+ }
+
+ protected override void OnExit(ExitEventArgs e)
+ {
+ ProgramConfig.conf.setings = UnityMultiFramework.Unity.GetSettings();
+ ProgramConfig.conf.Save();
+ base.OnExit(e);
+ }
+
+ private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
+ {
+ System.TimeSpan timeDifference = DateTime.UtcNow -
+ new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ long unixEpochTime = System.Convert.ToInt64(timeDifference.TotalSeconds);
+
+ var filePath = @"Crashes/log." + unixEpochTime.ToString() + ".txt";
+
+ System.IO.FileInfo file = new System.IO.FileInfo(filePath);
+ file.Directory.Create(); System.IO.File.WriteAllText(file.FullName, e.Exception.ToString());
+
+ var eWin = new Views.ErrorWindow();
+
+ eWin.EVMP.EVMException = e.Exception;
+ eWin.EVMP.FileLocation = file;
+
+ eWin.metroWindow.ShowDialog();
}
}
}
diff --git a/UnityMultiLauncher/Controls/AlignableWrapPanel.cs b/UnityMultiLauncher/Controls/AlignableWrapPanel.cs
index c8e964a..19d3dca 100644
--- a/UnityMultiLauncher/Controls/AlignableWrapPanel.cs
+++ b/UnityMultiLauncher/Controls/AlignableWrapPanel.cs
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows;
diff --git a/UnityMultiLauncher/Controls/BaseFilesystemControl.xaml b/UnityMultiLauncher/Controls/BaseFilesystemControl.xaml
new file mode 100644
index 0000000..eaf3a8c
--- /dev/null
+++ b/UnityMultiLauncher/Controls/BaseFilesystemControl.xaml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UnityMultiLauncher/Controls/BaseFilesystemControl.xaml.cs b/UnityMultiLauncher/Controls/BaseFilesystemControl.xaml.cs
new file mode 100644
index 0000000..b4cb448
--- /dev/null
+++ b/UnityMultiLauncher/Controls/BaseFilesystemControl.xaml.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.ObjectModel;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace UnityMultiLauncher.Controls
+{
+ ///
+ /// Interaction logic for BaseFilesystemControl.xaml
+ ///
+ public partial class BaseFilesystemControl : UserControl
+ {
+ public static readonly DependencyProperty ButtonArray = ButtonArrayPropertyKey.DependencyProperty;
+
+ private static readonly DependencyPropertyKey ButtonArrayPropertyKey =
+ DependencyProperty.RegisterReadOnly(
+ "Buttons",
+ typeof(ObservableCollection),
+ typeof(BaseFilesystemControl),
+ new FrameworkPropertyMetadata(new ObservableCollection())
+ );
+
+ public ObservableCollection Buttons { get { return (ObservableCollection)GetValue(ButtonArray); } set { SetValue(ButtonArray, value); } }
+
+ public static readonly DependencyProperty DirectoryRoot = DependencyProperty.Register("dirRoot", typeof(Uri), typeof(BaseFilesystemControl), new PropertyMetadata(new Uri(@"C:\")));
+
+ public Uri dirRoot
+ {
+ get
+ {
+ return (Uri)GetValue(DirectoryRoot);
+ }
+ set
+ {
+ SetValue(DirectoryRoot, value);
+ }
+ }
+
+ public BaseFilesystemControl()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/UnityMultiLauncher/Controls/Converters/DummyDebugConverter.cs b/UnityMultiLauncher/Controls/Converters/DummyDebugConverter.cs
index d8b38b2..768a37d 100644
--- a/UnityMultiLauncher/Controls/Converters/DummyDebugConverter.cs
+++ b/UnityMultiLauncher/Controls/Converters/DummyDebugConverter.cs
@@ -1,6 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Diagnostics;
using System.Windows.Data;
using System.Globalization;
diff --git a/UnityMultiLauncher/Controls/Converters/GetProjectNameFromURI.cs b/UnityMultiLauncher/Controls/Converters/GetProjectNameFromURI.cs
index e9f9542..d22c10b 100644
--- a/UnityMultiLauncher/Controls/Converters/GetProjectNameFromURI.cs
+++ b/UnityMultiLauncher/Controls/Converters/GetProjectNameFromURI.cs
@@ -1,12 +1,9 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Diagnostics;
using System.Windows.Data;
using System.Globalization;
namespace UnityMultiLauncher.Controls.Converters
-{
+{
class GetProjectNameFromURI : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
diff --git a/UnityMultiLauncher/Controls/Converters/NumberToGoldenRatio.cs b/UnityMultiLauncher/Controls/Converters/NumberToGoldenRatio.cs
index 148e56b..c78ffa5 100644
--- a/UnityMultiLauncher/Controls/Converters/NumberToGoldenRatio.cs
+++ b/UnityMultiLauncher/Controls/Converters/NumberToGoldenRatio.cs
@@ -1,6 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Diagnostics;
using System.Windows.Data;
using System.Globalization;
diff --git a/UnityMultiLauncher/Controls/Converters/UnityLaunchCommand.cs b/UnityMultiLauncher/Controls/Converters/UnityLaunchCommand.cs
new file mode 100644
index 0000000..d72e8be
--- /dev/null
+++ b/UnityMultiLauncher/Controls/Converters/UnityLaunchCommand.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Diagnostics;
+using System.Windows.Data;
+using System.Globalization;
+
+namespace UnityMultiLauncher.Controls.Converters
+{
+ public class ILaunchableCommand : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ var a = (UnityMultiFramework.ILaunchable)value;
+ return new ViewModels.Utils.ViewCommand((extra) => a.Launch());
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value;
+ }
+ }
+}
diff --git a/UnityMultiLauncher/Controls/Converters/UnityProjectToUnityVersion.cs b/UnityMultiLauncher/Controls/Converters/UnityProjectToUnityVersion.cs
index 95f9b2e..7a15054 100644
--- a/UnityMultiLauncher/Controls/Converters/UnityProjectToUnityVersion.cs
+++ b/UnityMultiLauncher/Controls/Converters/UnityProjectToUnityVersion.cs
@@ -1,7 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Diagnostics;
using System.Windows.Data;
using System.Globalization;
diff --git a/UnityMultiLauncher/Controls/Converters/UnityUriToUnityVersion.cs b/UnityMultiLauncher/Controls/Converters/UnityUriToUnityVersion.cs
index 5cebd92..2544416 100644
--- a/UnityMultiLauncher/Controls/Converters/UnityUriToUnityVersion.cs
+++ b/UnityMultiLauncher/Controls/Converters/UnityUriToUnityVersion.cs
@@ -1,5 +1,4 @@
using System;
-using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Data;
@@ -32,7 +31,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
public string ConvertInternal(Uri unity)
{
var versionInfo = Util.GetUnityVersionFromExecutable(unity);
- return string.Format("{0}.{1}.{2}", versionInfo.Item1, versionInfo.Item2, versionInfo.Item3);
+ return $"{versionInfo.Major}.{versionInfo.Minor}.{versionInfo.Build}";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
diff --git a/UnityMultiLauncher/Controls/FavoritesPanel.xaml b/UnityMultiLauncher/Controls/FavoritesPanel.xaml
new file mode 100644
index 0000000..f05b975
--- /dev/null
+++ b/UnityMultiLauncher/Controls/FavoritesPanel.xaml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UnityMultiLauncher/Controls/FavoritesPanel.xaml.cs b/UnityMultiLauncher/Controls/FavoritesPanel.xaml.cs
new file mode 100644
index 0000000..2f4d236
--- /dev/null
+++ b/UnityMultiLauncher/Controls/FavoritesPanel.xaml.cs
@@ -0,0 +1,16 @@
+using System.Windows.Controls;
+
+namespace UnityMultiLauncher.Controls
+{
+ ///
+ /// Interaction logic for FavoritesPanel.xaml
+ ///
+ public partial class FavoritesPanel : UserControl
+ {
+ public FavoritesPanel()
+ {
+ InitializeComponent();
+
+ }
+ }
+}
diff --git a/UnityMultiLauncher/Models/ConfigLoader.cs b/UnityMultiLauncher/Models/ConfigLoader.cs
index 27a9145..43cd0da 100644
--- a/UnityMultiLauncher/Models/ConfigLoader.cs
+++ b/UnityMultiLauncher/Models/ConfigLoader.cs
@@ -1,8 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Newtonsoft.Json;
using System.IO;
diff --git a/UnityMultiLauncher/Models/ProgramConfig.cs b/UnityMultiLauncher/Models/ProgramConfig.cs
index afcd15f..032a2ac 100644
--- a/UnityMultiLauncher/Models/ProgramConfig.cs
+++ b/UnityMultiLauncher/Models/ProgramConfig.cs
@@ -1,14 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
using Newtonsoft.Json;
using MahApps.Metro;
namespace UnityMultiLauncher
{
+
public class ProgramConfig : Utility.ConfigLoader.Config
{
protected static ProgramConfig _conf;
@@ -33,7 +31,7 @@ public class ProgramConfig : Utility.ConfigLoader.Config
}
}
- public static string defaultFilename { get { return string.Format("unitymultilauncher.{0}.cfg.json", Environment.UserName); } }
+ public static string defaultFilename { get { return $"unitymultilauncher.{Environment.UserName}.cfg.json"; } }
[JsonIgnore]
public Tuple appStyle
@@ -52,10 +50,13 @@ public Tuple appStyle
}
}
- public string appTheme = "BaseLight";
+
+ public string appTheme = "BaseLight";
public string appAccent = "Blue";
- public HashSet unityExeLocations = new HashSet();
+ public UnityMultiFramework.Settings setings;
+
+ public bool ShouldUseUnitySubVersion = false;
}
}
diff --git a/UnityMultiLauncher/Models/Utility.cs b/UnityMultiLauncher/Models/Utility.cs
index c907f70..bfef8c4 100644
--- a/UnityMultiLauncher/Models/Utility.cs
+++ b/UnityMultiLauncher/Models/Utility.cs
@@ -1,16 +1,16 @@
using System;
-using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
-using System.Threading.Tasks;
namespace UnityMultiLauncher
{
public static class Util
{
- private static Regex versionExp = new Regex(@"(\d+).(\d+).(\d+)f(\d+)", RegexOptions.Compiled);
+ //private static Regex versionExp = new Regex(@"(\d+)\.(\d+)\.(\d+)([A-z]+)(\d+)", RegexOptions.Compiled);
+ private static Regex versionExp = new Regex(@"\d+\.\d+\.\d+[A-z]\d+", RegexOptions.Compiled);
+
public static string UnityProjectSettings(Uri project, string key)
{
@@ -34,33 +34,63 @@ public static string UnityProjectSettings(Uri project, string key)
}
- public static Tuple UnityProjectVersion(Uri project)
+ public static (Version version, string buildType) UnityProjectVersion(Uri project)
{
- var filename = System.IO.Path.Combine(project.LocalPath, @"ProjectSettings /ProjectVersion.txt");
- var data = System.IO.File.ReadAllText(filename, Encoding.UTF8);
- var match = versionExp.Match(data);
-
-
- return Tuple.Create(Convert.ToInt32(match.Groups[1].Value), Convert.ToInt32(match.Groups[2].Value), Convert.ToInt32(match.Groups[3].Value), Convert.ToInt32(match.Groups[4].Value));
- }
-
- public static Uri GetUnityExecutableFromVersion(Tuple version)
- {
- foreach (var exe in ProgramConfig.conf.unityExeLocations)
+ var filename = System.IO.Path.Combine(project.LocalPath, @"ProjectSettings\ProjectVersion.txt");
+ if (System.IO.File.Exists(filename))
{
- var a = FileVersionInfo.GetVersionInfo(exe.LocalPath);
- if(a.ProductMajorPart == version.Item1 && a.ProductMinorPart == version.Item2 && a.ProductBuildPart == version.Item3)
+ var data = System.IO.File.ReadAllText(filename, Encoding.UTF8);
+ var match = versionExp.Match(data);
+ try
+ {
+ //return Version.Parse(Convert.ToInt32(match.Groups[1].Value), Convert.ToInt32(match.Groups[2].Value), Convert.ToInt32(match.Groups[3].Value), Convert.ToInt32(match.Groups[5].Value));
+ var v = Version.Parse(match.ToString().Replace('f','.').Replace('p','.'));
+
+ if (match.ToString().Contains("p")) { return (v, "p"); }
+ else{ return (v, "f"); }
+ }
+ catch (Exception E)
{
- return exe;
+ E.Data["ProjectText"] = data.ToString();
+ E.Data["Matches"] = match.ToString();
+ throw;
}
}
+ return (null,null);
+ }
+
+ public static Uri GetUnityExecutableFromVersion(Version version)
+ {
+ //return ProgramConfig.conf.ValidUnityExeLocations
+ // .Select(loc => (loc, GetUnityVersionFromExecutable(loc)))
+ // .Where(exe => version.Major == exe.Item2.Major && version.Minor == exe.Item2.Minor && version.Build == exe.Item2.Build)
+ // .Aggregate((Uri null, Version null), (working, next) => working.Item2.Revision > next.Item2.Revision ? working : next).Item1;
+
+ //foreach (var exe in ProgramConfig.conf.ValidUnityExeLocations)
+ //{
+ // var a = GetUnityVersionFromExecutable(exe);
+ // if(version.Major == a.Major && version.Minor == a.Minor && version.Build == a.Build)
+ // {
+ // return exe;
+ // }
+ //}
return null;
}
- public static Tuple GetUnityVersionFromExecutable(Uri exec)
+ public static Version GetUnityVersionFromExecutable(Uri exec)
{
var versionInfo = FileVersionInfo.GetVersionInfo(exec.LocalPath);
- return Tuple.Create(versionInfo.ProductMajorPart, versionInfo.ProductMinorPart, versionInfo.ProductBuildPart, 0);
+ return new Version(versionInfo.ProductMajorPart, versionInfo.ProductMinorPart, versionInfo.ProductBuildPart, 0);
}
+
+ public static void DumpUnityVersionInfo(Uri exec)
+ {
+ var versionInfo = FileVersionInfo.GetVersionInfo(exec.LocalPath);
+ System.Threading.Tasks.Task.Run(() => Newtonsoft.Json.JsonConvert.SerializeObject(versionInfo)).ContinueWith((input) => {
+ System.IO.File.WriteAllText(versionInfo.ProductName + "_" + versionInfo.ProductVersion + ".json", input.Result);
+
+ })
+
+; }
}
}
diff --git a/UnityMultiLauncher/Properties/AssemblyInfo.cs b/UnityMultiLauncher/Properties/AssemblyInfo.cs
index 008b9c4..84f6ae4 100644
--- a/UnityMultiLauncher/Properties/AssemblyInfo.cs
+++ b/UnityMultiLauncher/Properties/AssemblyInfo.cs
@@ -1,6 +1,4 @@
using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
diff --git a/UnityMultiLauncher/Properties/Resources.Designer.cs b/UnityMultiLauncher/Properties/Resources.Designer.cs
index 6079417..865bf64 100644
--- a/UnityMultiLauncher/Properties/Resources.Designer.cs
+++ b/UnityMultiLauncher/Properties/Resources.Designer.cs
@@ -8,64 +8,56 @@
//
//------------------------------------------------------------------------------
-namespace UnityMultiLauncher.Properties
-{
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UnityMultiLauncher.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
- }
+namespace UnityMultiLauncher.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UnityMultiLauncher.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
}
diff --git a/UnityMultiLauncher/Properties/Settings.Designer.cs b/UnityMultiLauncher/Properties/Settings.Designer.cs
index 04f7114..8b7b1fe 100644
--- a/UnityMultiLauncher/Properties/Settings.Designer.cs
+++ b/UnityMultiLauncher/Properties/Settings.Designer.cs
@@ -8,23 +8,19 @@
//
//------------------------------------------------------------------------------
-namespace UnityMultiLauncher.Properties
-{
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
- }
- }
+namespace UnityMultiLauncher.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
}
diff --git a/UnityMultiLauncher/UnityMultiLauncher.csproj b/UnityMultiLauncher/UnityMultiLauncher.csproj
index a92236b..c60aaba 100644
--- a/UnityMultiLauncher/UnityMultiLauncher.csproj
+++ b/UnityMultiLauncher/UnityMultiLauncher.csproj
@@ -9,7 +9,7 @@
Properties
UnityMultiLauncher
UnityMultiLauncher
- v4.5.2
+ v4.7
512
{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
4
@@ -29,6 +29,7 @@
false
false
true
+
AnyCPU
@@ -68,16 +69,17 @@
..\packages\MahApps.Metro.1.3.0\lib\net45\MahApps.Metro.dll
True
+
+ ..\packages\MahApps.Metro.IconPacks.1.1.0\lib\net45\MahApps.Metro.IconPacks.dll
+ True
+
..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll
True
-
- ..\packages\MahApps.Metro.1.3.0\lib\net45\System.Windows.Interactivity.dll
- True
-
+
@@ -99,16 +101,34 @@
+
+
+ FavoritesPanel.xaml
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
@@ -118,6 +138,12 @@
Code
+
+ BaseFilesystemControl.xaml
+
+
+ ErrorWindow.xaml
+
MainWindow.xaml
Code
@@ -178,7 +204,24 @@
false
+
+
+ {dc81ac27-1181-4cde-be6d-af159ff912c1}
+ UnityMultiFramework
+
+
+ {604b15c9-2391-4d76-b2ed-f4e427f288ae}
+ WPFireUtil
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/UnityMultiLauncher/Views/MainWindow.xaml.cs b/UnityMultiLauncher/Views/MainWindow.xaml.cs
index e826db0..73e9883 100644
--- a/UnityMultiLauncher/Views/MainWindow.xaml.cs
+++ b/UnityMultiLauncher/Views/MainWindow.xaml.cs
@@ -1,19 +1,5 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
using MahApps.Metro.Controls;
-using MahApps.Metro.Controls.Dialogs;
namespace UnityMultiLauncher
{
@@ -28,9 +14,7 @@ public MainWindow()
{
cwin = this;
InitializeComponent();
-
-
-
+
}
}
}
diff --git a/UnityMultiLauncher/packages.config b/UnityMultiLauncher/packages.config
index 1eb6dc3..4727861 100644
--- a/UnityMultiLauncher/packages.config
+++ b/UnityMultiLauncher/packages.config
@@ -1,5 +1,6 @@
+
\ No newline at end of file
diff --git a/WPFireUtil/FileBrowser.xaml b/WPFireUtil/FileBrowser.xaml
new file mode 100644
index 0000000..ccfec26
--- /dev/null
+++ b/WPFireUtil/FileBrowser.xaml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WPFireUtil/FileBrowser.xaml.cs b/WPFireUtil/FileBrowser.xaml.cs
new file mode 100644
index 0000000..6fa5008
--- /dev/null
+++ b/WPFireUtil/FileBrowser.xaml.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace WPFireUtil
+{
+ using System.IO;
+ ///
+ /// Interaction logic for FileBrowser.xaml
+ ///
+ public partial class FileBrowser : UserControl
+ {
+ public FileBrowser()
+ {
+ InitializeComponent();
+ }
+
+ public void GetDirectoryData()
+ {
+
+ }
+
+
+
+
+ }
+}
diff --git a/WPFireUtil/Properties/AssemblyInfo.cs b/WPFireUtil/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..cda7e75
--- /dev/null
+++ b/WPFireUtil/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("WPFireUtil")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("WPFireUtil")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[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("604b15c9-2391-4d76-b2ed-f4e427f288ae")]
+
+// 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/WPFireUtil/WPFireUtil.csproj b/WPFireUtil/WPFireUtil.csproj
new file mode 100644
index 0000000..8fe7d9e
--- /dev/null
+++ b/WPFireUtil/WPFireUtil.csproj
@@ -0,0 +1,59 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {604B15C9-2391-4D76-B2ED-F4E427F288AE}
+ Library
+ Properties
+ WPFireUtil
+ WPFireUtil
+ v4.5.2
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FileBrowser.xaml
+
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
\ No newline at end of file
diff --git a/unitymultilauncher.Micah.cfg.json b/unitymultilauncher.Micah.cfg.json
deleted file mode 100644
index 7919752..0000000
--- a/unitymultilauncher.Micah.cfg.json
+++ /dev/null
@@ -1 +0,0 @@
-{"appTheme":"BaseLight","appAccent":"Blue","unityExeLocations":[],"filename":"unitymultilauncher.Micah.cfg.json"}
\ No newline at end of file