diff --git a/.gitignore b/.gitignore index 1e948db..f3f7b10 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,4 @@ v2/lib/static.js **/*.suo Installers/**/*/bin Installers/**/*/obj -Installers/**/*/packages \ No newline at end of file +Installers/**/*/packages diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.FormMain.resources b/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.FormMain.resources deleted file mode 100644 index 6c05a97..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.FormMain.resources and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.Properties.Resources.resources b/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.Properties.Resources.resources deleted file mode 100644 index 246c376..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.Properties.Resources.resources and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.csproj.FileListAbsolute.txt b/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.csproj.FileListAbsolute.txt deleted file mode 100644 index 3e2d54d..0000000 --- a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,15 +0,0 @@ -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\bin\Debug\BetterDiscordWI.exe.config -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\bin\Debug\BetterDiscordWI.exe -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\bin\Debug\BetterDiscordWI.pdb -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Debug\BetterDiscordWI.csprojResolveAssemblyReference.cache -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Debug\BetterDiscordWI.FormMain.resources -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Debug\BetterDiscordWI.Properties.Resources.resources -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Debug\BetterDiscordWI.csproj.GenerateResource.Cache -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Debug\BetterDiscordWI.exe -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Debug\BetterDiscordWI.pdb -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Debug\BetterDiscordWI.panels.LicensePanel.resources -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Debug\BetterDiscordWI.panels.ConfigPanel.resources -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Debug\BetterDiscordWI.panels.InstallPanel.resources -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\bin\Debug\Newtonsoft.Json.dll -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\bin\Debug\asardotnetasync.dll -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\bin\Debug\asardotnetasync.pdb diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.csproj.GenerateResource.Cache b/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.csproj.GenerateResource.Cache deleted file mode 100644 index fe594c6..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.csproj.GenerateResource.Cache and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.csprojResolveAssemblyReference.cache b/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.csprojResolveAssemblyReference.cache deleted file mode 100644 index a7bd8ce..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.csprojResolveAssemblyReference.cache and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.exe b/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.exe deleted file mode 100644 index 881bbea..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.exe and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.panels.ConfigPanel.resources b/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.panels.ConfigPanel.resources deleted file mode 100644 index 6c05a97..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.panels.ConfigPanel.resources and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.panels.InstallPanel.resources b/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.panels.InstallPanel.resources deleted file mode 100644 index 6c05a97..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.panels.InstallPanel.resources and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.panels.LicensePanel.resources b/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.panels.LicensePanel.resources deleted file mode 100644 index 7fb1cf6..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.panels.LicensePanel.resources and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.pdb b/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.pdb deleted file mode 100644 index 297d05b..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/BetterDiscordWI.pdb and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/CoreCompileInputs.cache b/Installers/dotNet2/BetterDiscordWI/obj/Debug/CoreCompileInputs.cache deleted file mode 100644 index 5b7a950..0000000 --- a/Installers/dotNet2/BetterDiscordWI/obj/Debug/CoreCompileInputs.cache +++ /dev/null @@ -1 +0,0 @@ -9ed8cc2d0146708e9135d42f9b545d4d9dc45abd diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Installers/dotNet2/BetterDiscordWI/obj/Debug/DesignTimeResolveAssemblyReferences.cache deleted file mode 100644 index 3877997..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/DesignTimeResolveAssemblyReferences.cache and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Installers/dotNet2/BetterDiscordWI/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache deleted file mode 100644 index bc59b90..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/Installers/dotNet2/BetterDiscordWI/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll deleted file mode 100644 index 155be3c..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/Installers/dotNet2/BetterDiscordWI/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/Installers/dotNet2/BetterDiscordWI/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/Installers/dotNet2/BetterDiscordWI/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.FormMain.resources b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.FormMain.resources deleted file mode 100644 index 0b8b668..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.FormMain.resources and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.Properties.Resources.resources b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.Properties.Resources.resources deleted file mode 100644 index 246c376..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.Properties.Resources.resources and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.csproj.FileListAbsolute.txt b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.csproj.FileListAbsolute.txt deleted file mode 100644 index 808fb56..0000000 --- a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,12 +0,0 @@ -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\bin\Release\BetterDiscordWI.exe.config -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\bin\Release\BetterDiscordWI.exe -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\bin\Release\BetterDiscordWI.pdb -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Release\BetterDiscordWI.FormMain.resources -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Release\BetterDiscordWI.panels.ConfigPanel.resources -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Release\BetterDiscordWI.panels.InstallPanel.resources -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Release\BetterDiscordWI.panels.LicensePanel.resources -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Release\BetterDiscordWI.Properties.Resources.resources -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Release\BetterDiscordWI.csproj.GenerateResource.Cache -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Release\BetterDiscordWI.exe -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Release\BetterDiscordWI.pdb -G:\Github\BetterDiscordApp\Installers\dotNet2\BetterDiscordWI\BetterDiscordWI\obj\Release\BetterDiscordWI.csprojResolveAssemblyReference.cache diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.csproj.GenerateResource.Cache b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.csproj.GenerateResource.Cache deleted file mode 100644 index 4cca207..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.csproj.GenerateResource.Cache and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.csprojResolveAssemblyReference.cache b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.csprojResolveAssemblyReference.cache deleted file mode 100644 index db91afb..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.csprojResolveAssemblyReference.cache and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.exe b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.exe deleted file mode 100644 index 1b9b448..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.exe and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.exe.tmp b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.exe.tmp deleted file mode 100644 index 7a09852..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.exe.tmp and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.panels.ConfigPanel.resources b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.panels.ConfigPanel.resources deleted file mode 100644 index 6c05a97..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.panels.ConfigPanel.resources and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.panels.InstallPanel.resources b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.panels.InstallPanel.resources deleted file mode 100644 index 6c05a97..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.panels.InstallPanel.resources and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.panels.LicensePanel.resources b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.panels.LicensePanel.resources deleted file mode 100644 index 7fb1cf6..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.panels.LicensePanel.resources and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.pdb b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.pdb deleted file mode 100644 index 48ae343..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.pdb and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.pdb.tmp b/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.pdb.tmp deleted file mode 100644 index d523d3a..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/BetterDiscordWI.pdb.tmp and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/Common.cs b/Installers/dotNet2/BetterDiscordWI/obj/Release/Common.cs deleted file mode 100644 index 7645189..0000000 --- a/Installers/dotNet2/BetterDiscordWI/obj/Release/Common.cs +++ /dev/null @@ -1,297 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.IO; -using System.IO.Compression; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Security.AccessControl; -using System.Security.Cryptography; -using System.Security.Principal; -using System.Text; -using System.Threading; - -static class Common -{ - private const int DelayUntilReboot = 4; - - [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - static extern bool MoveFileEx(string lpExistingFileName, string lpNewFileName, int dwFlags); - - [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)] - static extern IntPtr LoadLibrary(string dllToLoad); - - [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetDllDirectory(string lpPathName); - - [Conditional("DEBUG")] - public static void Log(string format, params object[] args) - { - // Should this be trace? - Debug.WriteLine("=== COSTURA === " + string.Format(format, args)); - } - - static void CopyTo(Stream source, Stream destination) - { - var array = new byte[81920]; - int count; - while ((count = source.Read(array, 0, array.Length)) != 0) - { - destination.Write(array, 0, count); - } - } - - static void CreateDirectory(string tempBasePath) - { - if (!Directory.Exists(tempBasePath)) - { - Directory.CreateDirectory(tempBasePath); - } - } - - static byte[] ReadStream(Stream stream) - { - var data = new Byte[stream.Length]; - stream.Read(data, 0, data.Length); - return data; - } - - public static string CalculateChecksum(string filename) - { - using (var fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete)) - using (var bs = new BufferedStream(fs)) - using (var sha1 = new SHA1CryptoServiceProvider()) - { - var hash = sha1.ComputeHash(bs); - var formatted = new StringBuilder(2 * hash.Length); - foreach (var b in hash) - { - formatted.AppendFormat("{0:X2}", b); - } - return formatted.ToString(); - } - } - - public static Assembly ReadExistingAssembly(AssemblyName name) - { - var currentDomain = AppDomain.CurrentDomain; - var assemblies = currentDomain.GetAssemblies(); - foreach (var assembly in assemblies) - { - var currentName = assembly.GetName(); - if (string.Equals(currentName.Name, name.Name, StringComparison.InvariantCultureIgnoreCase) && - string.Equals(CultureToString(currentName.CultureInfo), CultureToString(name.CultureInfo), StringComparison.InvariantCultureIgnoreCase)) - { - Log("Assembly '{0}' already loaded, returning existing assembly", assembly.FullName); - - return assembly; - } - } - return null; - } - - static string CultureToString(CultureInfo culture) - { - if (culture == null) - return ""; - - return culture.Name; - } - - public static Assembly ReadFromDiskCache(string tempBasePath, AssemblyName requestedAssemblyName) - { - var name = requestedAssemblyName.Name.ToLowerInvariant(); - - if (requestedAssemblyName.CultureInfo != null && !String.IsNullOrEmpty(requestedAssemblyName.CultureInfo.Name)) - name = $"{requestedAssemblyName.CultureInfo.Name}.{name}"; - - var bittyness = IntPtr.Size == 8 ? "64" : "32"; - var assemblyTempFilePath = Path.Combine(tempBasePath, String.Concat(name, ".dll")); - if (File.Exists(assemblyTempFilePath)) - { - return Assembly.LoadFile(assemblyTempFilePath); - } - assemblyTempFilePath = Path.ChangeExtension(assemblyTempFilePath, "exe"); - if (File.Exists(assemblyTempFilePath)) - { - return Assembly.LoadFile(assemblyTempFilePath); - } - assemblyTempFilePath = Path.Combine(Path.Combine(tempBasePath, bittyness), String.Concat(name, ".dll")); - if (File.Exists(assemblyTempFilePath)) - { - return Assembly.LoadFile(assemblyTempFilePath); - } - assemblyTempFilePath = Path.ChangeExtension(assemblyTempFilePath, "exe"); - if (File.Exists(assemblyTempFilePath)) - { - return Assembly.LoadFile(assemblyTempFilePath); - } - return null; - } - - public static Assembly ReadFromEmbeddedResources(Dictionary assemblyNames, Dictionary symbolNames, AssemblyName requestedAssemblyName) - { - var name = requestedAssemblyName.Name.ToLowerInvariant(); - - if (requestedAssemblyName.CultureInfo != null && !String.IsNullOrEmpty(requestedAssemblyName.CultureInfo.Name)) - name = $"{requestedAssemblyName.CultureInfo.Name}.{name}"; - - byte[] assemblyData; - using (var assemblyStream = LoadStream(assemblyNames, name)) - { - if (assemblyStream == null) - { - return null; - } - assemblyData = ReadStream(assemblyStream); - } - - using (var pdbStream = LoadStream(symbolNames, name)) - { - if (pdbStream != null) - { - var pdbData = ReadStream(pdbStream); - return Assembly.Load(assemblyData, pdbData); - } - } - - return Assembly.Load(assemblyData); - } - - static Stream LoadStream(Dictionary resourceNames, string name) - { - string value; - if (resourceNames.TryGetValue(name, out value)) - return LoadStream(value); - - return null; - } - - static Stream LoadStream(string fullname) - { - var executingAssembly = Assembly.GetExecutingAssembly(); - - if (fullname.EndsWith(".compressed")) - { - using (var stream = executingAssembly.GetManifestResourceStream(fullname)) - using (var compressStream = new DeflateStream(stream, CompressionMode.Decompress)) - { - var memStream = new MemoryStream(); - CopyTo(compressStream, memStream); - memStream.Position = 0; - return memStream; - } - } - - return executingAssembly.GetManifestResourceStream(fullname); - } - - // Mutex code from http://stackoverflow.com/questions/229565/what-is-a-good-pattern-for-using-a-global-mutex-in-c - public static void PreloadUnmanagedLibraries(string hash, string tempBasePath, IEnumerable libs, Dictionary checksums) - { - var mutexId = $"Global\\Costura{hash}"; - - using (var mutex = new Mutex(false, mutexId)) - { - var allowEveryoneRule = new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), MutexRights.FullControl, AccessControlType.Allow); - var securitySettings = new MutexSecurity(); - securitySettings.AddAccessRule(allowEveryoneRule); - mutex.SetAccessControl(securitySettings); - - var hasHandle = false; - try - { - try - { - hasHandle = mutex.WaitOne(60000, false); - if (hasHandle == false) - throw new TimeoutException("Timeout waiting for exclusive access"); - } - catch (AbandonedMutexException) - { - hasHandle = true; - } - - var bittyness = IntPtr.Size == 8 ? "64" : "32"; - CreateDirectory(Path.Combine(tempBasePath, bittyness)); - InternalPreloadUnmanagedLibraries(tempBasePath, libs, checksums); - } - finally - { - if (hasHandle) - mutex.ReleaseMutex(); - } - } - } - - static void InternalPreloadUnmanagedLibraries(string tempBasePath, IEnumerable libs, Dictionary checksums) - { - string name; - - foreach (var lib in libs) - { - name = ResourceNameToPath(lib); - - var assemblyTempFilePath = Path.Combine(tempBasePath, name); - - if (File.Exists(assemblyTempFilePath)) - { - var checksum = CalculateChecksum(assemblyTempFilePath); - if (checksum != checksums[lib]) - File.Delete(assemblyTempFilePath); - } - - if (!File.Exists(assemblyTempFilePath)) - { - using (var copyStream = LoadStream(lib)) - using (var assemblyTempFile = File.OpenWrite(assemblyTempFilePath)) - { - CopyTo(copyStream, assemblyTempFile); - } - if (!MoveFileEx(assemblyTempFilePath, null, DelayUntilReboot)) - { - //TODO: for now we ignore the return value. - } - } - } - - SetDllDirectory(tempBasePath); - - foreach (var lib in libs) - { - name = ResourceNameToPath(lib); - - if (name.EndsWith(".dll")) - { - var assemblyTempFilePath = Path.Combine(tempBasePath, name); - - LoadLibrary(assemblyTempFilePath); - } - } - } - - static string ResourceNameToPath(string lib) - { - var bittyness = IntPtr.Size == 8 ? "64" : "32"; - - var name = lib; - - if (lib.StartsWith(String.Concat("costura", bittyness, "."))) - { - name = Path.Combine(bittyness, lib.Substring(10)); - } - else if (lib.StartsWith("costura.")) - { - name = lib.Substring(8); - } - - if (name.EndsWith(".compressed")) - { - name = name.Substring(0, name.Length - 11); - } - - return name; - } -} \ No newline at end of file diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/CoreCompileInputs.cache b/Installers/dotNet2/BetterDiscordWI/obj/Release/CoreCompileInputs.cache deleted file mode 100644 index 27b9e65..0000000 --- a/Installers/dotNet2/BetterDiscordWI/obj/Release/CoreCompileInputs.cache +++ /dev/null @@ -1 +0,0 @@ -003befe214f35e255c343afecd5f5dea062bb193 diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/Costura/5FF7A3C46BDF90A5B1259D7F4E6C52DE2C4D3CE1.costura.asardotnetasync.pdb.compressed b/Installers/dotNet2/BetterDiscordWI/obj/Release/Costura/5FF7A3C46BDF90A5B1259D7F4E6C52DE2C4D3CE1.costura.asardotnetasync.pdb.compressed deleted file mode 100644 index f7ac0d8..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/Costura/5FF7A3C46BDF90A5B1259D7F4E6C52DE2C4D3CE1.costura.asardotnetasync.pdb.compressed and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/Costura/EADEC345E76BD0D029B1AB282CE0ABE2787C4B55.costura.asardotnetasync.dll.compressed b/Installers/dotNet2/BetterDiscordWI/obj/Release/Costura/EADEC345E76BD0D029B1AB282CE0ABE2787C4B55.costura.asardotnetasync.dll.compressed deleted file mode 100644 index 400ec25..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/Costura/EADEC345E76BD0D029B1AB282CE0ABE2787C4B55.costura.asardotnetasync.dll.compressed and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/Costura/F065844930EED36F993E9F0C7533E404ACF6BB9F.costura.newtonsoft.json.dll.compressed b/Installers/dotNet2/BetterDiscordWI/obj/Release/Costura/F065844930EED36F993E9F0C7533E404ACF6BB9F.costura.newtonsoft.json.dll.compressed deleted file mode 100644 index 775a8f2..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/Costura/F065844930EED36F993E9F0C7533E404ACF6BB9F.costura.newtonsoft.json.dll.compressed and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Installers/dotNet2/BetterDiscordWI/obj/Release/DesignTimeResolveAssemblyReferences.cache deleted file mode 100644 index 8ce966e..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/DesignTimeResolveAssemblyReferences.cache and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache b/Installers/dotNet2/BetterDiscordWI/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache deleted file mode 100644 index a8c2759..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/ILTemplate.cs b/Installers/dotNet2/BetterDiscordWI/obj/Release/ILTemplate.cs deleted file mode 100644 index 119fdf1..0000000 --- a/Installers/dotNet2/BetterDiscordWI/obj/Release/ILTemplate.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Threading; - -static class ILTemplate -{ - static readonly object nullCacheLock = new object(); - static readonly Dictionary nullCache = new Dictionary(); - - static readonly Dictionary assemblyNames = new Dictionary(); - static readonly Dictionary symbolNames = new Dictionary(); - - static int isAttached = 0; - - public static void Attach() - { - if (Interlocked.Exchange(ref isAttached, 1) == 1) - { - return; - } - - var currentDomain = AppDomain.CurrentDomain; - currentDomain.AssemblyResolve += ResolveAssembly; - } - - public static Assembly ResolveAssembly(object sender, ResolveEventArgs e) - { - lock (nullCacheLock) - { - if (nullCache.ContainsKey(e.Name)) - { - return null; - } - } - - var requestedAssemblyName = new AssemblyName(e.Name); - - var assembly = Common.ReadExistingAssembly(requestedAssemblyName); - if (assembly != null) - { - return assembly; - } - - Common.Log("Loading assembly '{0}' into the AppDomain", requestedAssemblyName); - - assembly = Common.ReadFromEmbeddedResources(assemblyNames, symbolNames, requestedAssemblyName); - if (assembly == null) - { - lock (nullCacheLock) - { - nullCache[e.Name] = true; - } - - // Handles retargeted assemblies like PCL - if (requestedAssemblyName.Flags == AssemblyNameFlags.Retargetable) - { - assembly = Assembly.Load(requestedAssemblyName); - } - } - return assembly; - } -} \ No newline at end of file diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/TempPE/Properties.Resources.Designer.cs.dll b/Installers/dotNet2/BetterDiscordWI/obj/Release/TempPE/Properties.Resources.Designer.cs.dll deleted file mode 100644 index 2555e53..0000000 Binary files a/Installers/dotNet2/BetterDiscordWI/obj/Release/TempPE/Properties.Resources.Designer.cs.dll and /dev/null differ diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/Installers/dotNet2/BetterDiscordWI/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/Installers/dotNet2/BetterDiscordWI/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Installers/dotNet2/BetterDiscordWI/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/Installers/dotNet2/BetterDiscordWI/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs deleted file mode 100644 index e69de29..0000000