diff --git a/Artemis/Artemis.Installer/Artemis.Installer.wixproj b/Artemis/Artemis.Installer/Artemis.Installer.wixproj new file mode 100644 index 000000000..ec1becaf7 --- /dev/null +++ b/Artemis/Artemis.Installer/Artemis.Installer.wixproj @@ -0,0 +1,55 @@ + + + + Debug + x86 + 3.10 + a34f9047-8464-4423-89ef-a2f43e089e93 + 2.0 + Artemis + Package + + + bin\$(Configuration)\ + obj\$(Configuration)\ + Debug + + + bin\$(Configuration)\ + obj\$(Configuration)\ + -arch x64 + + + HarvestPath=..\Artemis\bin\Release + + + + + + + + Artemis + {ed9997a2-e54c-4e9f-9350-62be672c3abe} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + + + + + + + + + + + + \ No newline at end of file diff --git a/Artemis/Artemis.Installer/HeatGeneratedFileList.wxs b/Artemis/Artemis.Installer/HeatGeneratedFileList.wxs new file mode 100644 index 000000000..0b600325b --- /dev/null +++ b/Artemis/Artemis.Installer/HeatGeneratedFileList.wxs @@ -0,0 +1,363 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Artemis/Artemis.Installer/Product.wxs b/Artemis/Artemis.Installer/Product.wxs new file mode 100644 index 000000000..28ee064d0 --- /dev/null +++ b/Artemis/Artemis.Installer/Product.wxs @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Artemis/Artemis.sln b/Artemis/Artemis.sln index e10b6c3a6..bf3546036 100644 --- a/Artemis/Artemis.sln +++ b/Artemis/Artemis.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.12 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis", "Artemis\Artemis.csproj", "{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}" EndProject @@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis86Wrapper", "Artemis EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LightFX2Artemis", "LightFX2Artemis\LightFX2Artemis.vcxproj", "{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}" EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Artemis.Installer", "Artemis.Installer\Artemis.Installer.wixproj", "{A34F9047-8464-4423-89EF-A2F43E089E93}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CD_ROM|Any CPU = CD_ROM|Any CPU @@ -208,8 +210,37 @@ Global {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|x64.Build.0 = Release|x64 {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|x86.ActiveCfg = Release|Win32 {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|x86.Build.0 = Release|Win32 + {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|Any CPU.ActiveCfg = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|Any CPU.Build.0 = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|x64.ActiveCfg = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|x64.Build.0 = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|x86.ActiveCfg = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|x86.Build.0 = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.Debug|Any CPU.ActiveCfg = Debug|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.Debug|x64.ActiveCfg = Debug|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.Debug|x86.ActiveCfg = Debug|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.Debug|x86.Build.0 = Debug|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|Any CPU.ActiveCfg = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|Any CPU.Build.0 = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|x64.ActiveCfg = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|x64.Build.0 = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|x86.ActiveCfg = Debug|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|x86.Build.0 = Debug|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.Release|Any CPU.ActiveCfg = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.Release|x64.ActiveCfg = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.Release|x86.ActiveCfg = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.Release|x86.Build.0 = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|Any CPU.ActiveCfg = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|Any CPU.Build.0 = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|x64.ActiveCfg = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|x64.Build.0 = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|x86.ActiveCfg = Release|x86 + {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7F70A235-016F-4E1A-85B7-B66102F15535} + EndGlobalSection EndGlobal diff --git a/Artemis/Artemis/Artemis.csproj b/Artemis/Artemis/Artemis.csproj index cd4dbdab1..92caafb89 100644 --- a/Artemis/Artemis/Artemis.csproj +++ b/Artemis/Artemis/Artemis.csproj @@ -45,7 +45,6 @@ true true true - 38ead84566f241de8f334abe173b1038 x64 @@ -114,7 +113,7 @@ true - bin\x64\Release\ + bin\Release\ TRACE true pdbonly @@ -159,18 +158,6 @@ ..\packages\CUE.NET.1.1.3.1\lib\net45\CUE.NET.dll - - ..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll - True - - - ..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll - True - - - ..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll - True - ..\packages\DynamicExpresso.Core.1.3.4.7\lib\net40\DynamicExpresso.Core.dll @@ -186,9 +173,6 @@ ..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll True - - ..\packages\squirrel.windows.1.4.4\lib\Net45\ICSharpCode.SharpZipLib.dll - ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll True @@ -196,24 +180,8 @@ ..\packages\MahApps.Metro.1.4.3\lib\net45\MahApps.Metro.dll - - ..\packages\TaskScheduler.2.6.5\lib\net452\Microsoft.Win32.TaskScheduler.dll - - - ..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll - True - - - ..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll - True - - - ..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll - True - - - ..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll - True + + ..\packages\TaskScheduler.2.7.0\lib\net452\Microsoft.Win32.TaskScheduler.dll ..\packages\MoonSharp.2.0.0.0\lib\net40-client\MoonSharp.Interpreter.dll @@ -241,9 +209,6 @@ ..\packages\NLog.4.4.12\lib\net45\NLog.dll - - ..\packages\squirrel.windows.1.4.4\lib\Net45\NuGet.Squirrel.dll - ..\packages\Pcap.Net.x64.1.0.4.1\lib\net45\PcapDotNet.Base.dll @@ -266,16 +231,9 @@ ..\packages\SharpDX.Direct3D9.4.0.1\lib\net45\SharpDX.Direct3D9.dll - - ..\packages\Splat.2.0.0\lib\Net45\Splat.dll - True - ..\packages\SpotifyAPI-NET.2.16.1\lib\SpotifyAPI.dll - - ..\packages\squirrel.windows.1.4.4\lib\Net45\Squirrel.dll - diff --git a/Artemis/Artemis/Managers/MainManager.cs b/Artemis/Artemis/Managers/MainManager.cs index a5965fa73..f059f2932 100644 --- a/Artemis/Artemis/Managers/MainManager.cs +++ b/Artemis/Artemis/Managers/MainManager.cs @@ -47,10 +47,6 @@ namespace Artemis.Managers // Start the named pipe PipeServer.Start("artemis"); - // Start the update task - var updateTask = new Task(Updater.UpdateApp); - updateTask.Start(); - // Listen for power mode changes SystemEvents.PowerModeChanged += OnPowerChange; diff --git a/Artemis/Artemis/Properties/AssemblyInfo.cs b/Artemis/Artemis/Properties/AssemblyInfo.cs index f51f5f42f..8f3d73d5f 100644 --- a/Artemis/Artemis/Properties/AssemblyInfo.cs +++ b/Artemis/Artemis/Properties/AssemblyInfo.cs @@ -55,5 +55,4 @@ using System.Windows; [assembly: AssemblyVersion("1.11.0.0")] [assembly: AssemblyFileVersion("1.11.0.0")] -[assembly: AssemblyMetadata("SquirrelAwareVersion", "1")] [assembly: InternalsVisibleTo("Artemis.Explorables")] diff --git a/Artemis/Artemis/Resources/Artemis autorun.xml b/Artemis/Artemis/Resources/Artemis autorun.xml index c9991277b..fe1ca09ac 100644 Binary files a/Artemis/Artemis/Resources/Artemis autorun.xml and b/Artemis/Artemis/Resources/Artemis autorun.xml differ diff --git a/Artemis/Artemis/Settings/GeneralSettings.cs b/Artemis/Artemis/Settings/GeneralSettings.cs index e627ff0a2..08dbb3333 100644 --- a/Artemis/Artemis/Settings/GeneralSettings.cs +++ b/Artemis/Artemis/Settings/GeneralSettings.cs @@ -13,7 +13,6 @@ using MahApps.Metro; using Microsoft.Win32.TaskScheduler; using Newtonsoft.Json; using Newtonsoft.Json.Converters; -using Squirrel; namespace Artemis.Settings { @@ -110,47 +109,30 @@ namespace Artemis.Settings public void ApplyAutorun() { - using (var mgr = new UpdateManager("")) + using (var ts = new TaskService()) { - try + var existing = ts.FindTask("Artemis autorun"); + if (Autorun) { - // Clean up the shortcut used by the old method - mgr.RemoveShortcutsForExecutable("Artemis.exe", ShortcutLocation.Startup); - } - catch (FileNotFoundException) - { - // Ignored, only happens when running from VS - } - catch (DirectoryNotFoundException) - { - // Ignored, only happens when running from VS - } + // Overwrite any existing tasks in case the installation folder changed + var path = Path.GetTempFileName(); + var xml = Resources.Artemis_autorun + .Replace("{{executablePath}}", AppDomain.CurrentDomain.BaseDirectory + "Artemis.exe") + .Replace("{{author}}", System.Security.Principal.WindowsIdentity.GetCurrent().Name); + File.WriteAllText(path, xml); - using (var ts = new TaskService()) + var task = ts.RootFolder.ImportTask(null, path); + task.Definition.Principal.UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name; + task.Definition.Principal.LogonType = TaskLogonType.InteractiveToken; + task.Definition.Principal.RunLevel = TaskRunLevel.Highest; + task.RegisterChanges(); + + File.Delete(path); + } + else if (existing != null) { - var existing = ts.FindTask("Artemis autorun"); - if (Autorun) - { - // Overwrite any existing tasks in case the installation folder changed - var path = Path.GetTempFileName(); - var xml = Resources.Artemis_autorun - .Replace("{{executablePath}}", mgr.RootAppDirectory + "\\Update.exe") - .Replace("{{author}}", System.Security.Principal.WindowsIdentity.GetCurrent().Name); - File.WriteAllText(path, xml); - - var task = ts.RootFolder.ImportTask(null, path); - task.Definition.Principal.UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name; - task.Definition.Principal.LogonType = TaskLogonType.InteractiveToken; - task.Definition.Principal.RunLevel = TaskRunLevel.Highest; - task.RegisterChanges(); - - File.Delete(path); - } - else if (existing != null) - { - // Remove the task if it is present - ts.RootFolder.DeleteTask("Artemis autorun"); - } + // Remove the task if it is present + ts.RootFolder.DeleteTask("Artemis autorun"); } } } diff --git a/Artemis/Artemis/Utilities/Updater.cs b/Artemis/Artemis/Utilities/Updater.cs index 5e863e721..c4a8d5b47 100644 --- a/Artemis/Artemis/Utilities/Updater.cs +++ b/Artemis/Artemis/Utilities/Updater.cs @@ -11,45 +11,13 @@ using Artemis.Utilities.Memory; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using NLog; -using Squirrel; namespace Artemis.Utilities { public static class Updater { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - - /// - /// Uses Squirrel to update the application through GitHub - /// - public static async void UpdateApp() - { - var settings = SettingsProvider.Load(); - Logger.Info("Update check enabled: {0}", settings.AutoUpdate); - - // Only update if the user allows it - if (!SettingsProvider.Load().AutoUpdate) - return; - - // Pre-release - // using (var mgr = UpdateManager.GitHubUpdateManager("https://github.com/SpoinkyNL/Artemis", null, null, null, true)) - // Release - using (var mgr = UpdateManager.GitHubUpdateManager("https://github.com/SpoinkyNL/Artemis")) - { - try - { - await mgr.Result.UpdateApp(); - Logger.Info("Update check complete"); - mgr.Result.Dispose(); // This seems odd but if it's not disposed and exception is thrown - } - catch (Exception e) - { - // These exceptions should only really occur when running from VS - Logger.Error(e, "Update check failed"); - } - } - } - + /// /// Checks to see if the program has updated and shows a dialog if so. /// @@ -59,18 +27,17 @@ namespace Artemis.Utilities { var settings = SettingsProvider.Load(); var currentVersion = Assembly.GetExecutingAssembly().GetName().Version; - if ((settings.LastRanVersion != null) && (currentVersion > settings.LastRanVersion)) + if (settings.LastRanVersion != null && currentVersion > settings.LastRanVersion) { Logger.Info("Updated from {0} to {1}, showing changelog.", settings.LastRanVersion, currentVersion); // Ask the user whether he/she wants to see what's new - var showChanges = await dialogService. - ShowQuestionMessageBox("New version installed", - $"Artemis has recently updated from version {settings.LastRanVersion} to {currentVersion}. \n" + - "Would you like to see what's new?"); + var showChanges = await dialogService.ShowQuestionMessageBox("New version installed", + $"Artemis has recently updated from version {settings.LastRanVersion} to {currentVersion}. \n" + + "Would you like to see what's new?"); // If user wants to see changelog, show it to them - if ((showChanges != null) && showChanges.Value) + if (showChanges != null && showChanges.Value) await ShowChanges(dialogService, currentVersion); } @@ -115,9 +82,11 @@ namespace Artemis.Utilities if (release != null) dialogService.ShowMarkdownDialog(release["name"].Value(), release["body"].Value()); else + { dialogService.ShowMessageBox("Couldn't fetch release", "Sorry, Artemis was unable to fetch the release data off of GitHub.\n" + "If you'd like, you can always find out the latest changes on the GitHub page accessible from the options menu"); + } } /// @@ -167,6 +136,7 @@ namespace Artemis.Utilities { var offsetSettings = SettingsProvider.Load(); if (offsetSettings.RocketLeague == null) + { offsetSettings.RocketLeague = new GamePointersCollection { Game = "RocketLeague", @@ -181,8 +151,9 @@ namespace Artemis.Utilities } } }; + } offsetSettings.Save(); } } -} \ No newline at end of file +} diff --git a/Artemis/Artemis/ViewModels/ProfileEditorViewModel.cs b/Artemis/Artemis/ViewModels/ProfileEditorViewModel.cs index 6068aec2b..8e652ec62 100644 --- a/Artemis/Artemis/ViewModels/ProfileEditorViewModel.cs +++ b/Artemis/Artemis/ViewModels/ProfileEditorViewModel.cs @@ -31,7 +31,6 @@ using MahApps.Metro; using MahApps.Metro.Controls; using MahApps.Metro.Controls.Dialogs; using Newtonsoft.Json; -using NuGet; using Application = System.Windows.Application; using Clipboard = System.Windows.Clipboard; using Cursor = System.Windows.Input.Cursor; @@ -377,7 +376,10 @@ namespace Artemis.ViewModels SelectedLayer = null; if (SelectedProfile != null) - Layers.AddRange(SelectedProfile.Layers); + { + foreach (var selectedProfileLayer in SelectedProfile.Layers) + Layers.Add(selectedProfileLayer); + } if (selectModel == null) return; @@ -404,7 +406,10 @@ namespace Artemis.ViewModels { ProfileNames.Clear(); if (_moduleModel != null && _deviceManager.ActiveKeyboard != null) - ProfileNames.AddRange(ProfileProvider.GetProfileNames(_deviceManager.ActiveKeyboard, _moduleModel)); + { + foreach (var profileName in ProfileProvider.GetProfileNames(_deviceManager.ActiveKeyboard, _moduleModel)) + ProfileNames.Add(profileName); + } }); } @@ -943,7 +948,10 @@ namespace Artemis.ViewModels Layers.Clear(); if (SelectedProfile != null) - Layers.AddRange(SelectedProfile.Layers); + { + foreach (var selectedProfileLayer in SelectedProfile.Layers) + Layers.Add(selectedProfileLayer); + } NotifyOfPropertyChange(() => ProfileSelected); } diff --git a/Artemis/Artemis/bin/x64/Update.exe b/Artemis/Artemis/bin/x64/Update.exe deleted file mode 100644 index 85594e47c..000000000 Binary files a/Artemis/Artemis/bin/x64/Update.exe and /dev/null differ diff --git a/Artemis/Artemis/packages.config b/Artemis/Artemis/packages.config index 992429d67..4c36fdd44 100644 --- a/Artemis/Artemis/packages.config +++ b/Artemis/Artemis/packages.config @@ -6,14 +6,12 @@ - - @@ -27,9 +25,7 @@ - - - + \ No newline at end of file