Commit Graph

1151 Commits

Author SHA1 Message Date
Terry MacDonald
d24b15d37a [WIP] Threading improvements
Found that I was combining Threads and Tasks together...never a good idea. Have moved fully over to a Task based model. Now still having issues with parallelism.
2022-01-10 21:06:02 +13:00
Terry MacDonald
40dd80f8b0 Revert DesktopNotificationManagerCompat changes 2022-01-10 19:53:13 +13:00
Terry MacDonald
312d056705 Fixed non-working Windows Toast notifications
Also cleaned up some old unused IPCService/Client code.
2022-01-10 09:27:34 +13:00
Terry MacDonald
81f34c3b9c Fix Invoke blocking the game starting
Moved it to a non-blocking BeginInvoke thread as it doesn't matter when it ends, and that way we keep the application running.
2022-01-09 20:06:46 +13:00
Terry MacDonald
475dcaddc9 Fixed bug with disabling broken shortcuts
We weren't disabling the invalid Game Shortcuts from the right-click system tray menu, even though they couldn't be used. Fixed that.
2022-01-08 20:31:10 +13:00
Terry MacDonald
8b7b5f2e75 Updated version to 2.2.0.1 2022-01-08 10:44:54 +13:00
Terry MacDonald
fffe1a8bf1 Updated explorer install restart and added log rolling
Updated the installer so that windows update is only forced to restart if it needs to be.

Added log rolling to DisplayMagician so that it keeps the last 4 log files as well as the one currently in use. Also updated the support ZIP file creation logic to include those extra log files so I can see exactly what's been going on, as well as added in the DisplayProfiles_2.0.json as well which I'd missed previously.
2022-01-08 10:32:54 +13:00
Terry MacDonald
cd9bec7e26 Added Invoke checking to NotifyIcon
This is an attempt to avoid any potential non-thread safe UI updates to keep DisplayMagician as stable as possible. Moving to a thread-based model means that I need to be a bit more aware of the thread safe practices and attempt to avoid unsafe operations.
2022-01-06 09:28:56 +13:00
Terry MacDonald
ddd48b577d Changed notification icon handling
Made the code more robust and able to work using the new threaded instances
2022-01-06 09:05:55 +13:00
Terry MacDonald
ce351109a9 Fixing Tasks so they wait until they block
This is being done as the current UI code expects the shortcuts to block. This will be changed in the future when we move to .net6 and MAUI

Also fixed a bug I discovered with the stop program still being started if the user disabled it. And added in checking for the stop prgrams existence.
2022-01-05 22:17:59 +13:00
Terry MacDonald
a824f11955 Making sure all RunShortcuts are changed to Tasks
This ensures that all pathways to run a shortcut are covered by the protection of only allowing one profile change or shortcut run at a time. This will ensure that the single instance doesn't end up with multiple runs occurring at the same time and race conditions happening.
2022-01-05 21:17:42 +13:00
Terry MacDonald
4444d2b93b Fixed stop program disablement
The stop program wasn't actually able to be stopped through the GUI due to the fact I missed updating the save and load functions to store that information :/. This has now been rectified.
2022-01-04 23:16:45 +13:00
Terry MacDonald
5f6c7d6e54 Catchup git changes 2022-01-04 22:47:00 +13:00
Terry MacDonald
5a380c46cb Added singleinstance thread safety and fixed process stopping
Added SemaphoreSlim control to make sure that only one task at a time can be run. If any other task (Display Profile change or a Game Shortcut run) is attempted, it is silently ignored by DisplayMagician. This code then means that only a single instance of DisplayMagician is loaded.

Also found a bug in the StopProcess function that was stopping processes from properly being stopped. This has now been corrected, and fixes #75
2022-01-04 22:46:11 +13:00
Terry MacDonald
f6410de1ca Working Single Instance
Works fine, but still locks the UI. There is the potential for a race condition now as we have multiple pathways to run a shortcut or change the display profile. Next step is to stop that from being a problem.
2022-01-03 21:39:19 +13:00
Terry MacDonald
35fe7dc36d [WIP] Tweaked Action callback
Now instead of needing to be specified within the main Program file, we now have something that is defined and run from the SingleInstance class. I'll be adding the code to actually handle the different commandline options shortly.
2022-01-02 21:57:35 +13:00
Terry MacDonald
a33bd1bf7a [WIP] Basic working commandline handoff
The code now starts a namedpipeserver if it's the first instance, and if it's the 2nd instances it sends the full command line as an array to the first instance to get it to perform the work.
2022-01-02 09:26:39 +13:00
Terry MacDonald
bdd93e0956 [WIP] Initial part of singleInstance 2022-01-01 16:22:12 +13:00
Terry MacDonald
2deee7eb15 [WIP] part implementation of single instance helper
Mainly based on Johan Larsson Gu.Wpf.SingleInstance and Novotnyllc SingleInstanceHelper code, extracting the various bits that make sense for DisplayMagician. Using a mutex, and System.Runtime.Remoting.Channels.Ipc
2021-12-30 21:31:54 +13:00
Terry MacDonald
d4d93db19d Merge branch 'develop' of https://github.com/terrymacdonald/DisplayMagician into develop 2021-12-30 13:58:03 +13:00
Terry MacDonald
64c64a76a4 README update and shortcut focus fix 2021-12-30 13:57:11 +13:00
terrymacdonald
809ab9d577
Merge pull request #69 from terrymacdonald/dependabot/nuget/develop/McMaster.Extensions.CommandLineUtils-4.0.0
Bump McMaster.Extensions.CommandLineUtils from 4.0.0-beta.74 to 4.0.0
2021-12-29 22:57:08 +13:00
terrymacdonald
4f45857321
Merge pull request #71 from terrymacdonald/dependabot/nuget/develop/NUnit3TestAdapter-4.2.0
Bump NUnit3TestAdapter from 4.1.0 to 4.2.0
2021-12-29 22:56:46 +13:00
dependabot[bot]
934e13295a
Bump NUnit3TestAdapter from 4.1.0 to 4.2.0
Bumps [NUnit3TestAdapter](https://github.com/nunit/nunit3-vs-adapter) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/nunit/nunit3-vs-adapter/releases)
- [Commits](https://github.com/nunit/nunit3-vs-adapter/compare/V4.1.0...V4.2.0)

---
updated-dependencies:
- dependency-name: NUnit3TestAdapter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-28 08:25:45 +00:00
Terry MacDonald
14ccfbd145 Updated initial display profile message. 2021-12-28 11:41:43 +13:00
Terry MacDonald
67b6dec78b Added help buttons to all UI windows
I redeveloped the help wiki at the guthub site, and took the opportunity to add some guidance to the different UI windows that would be most helpful there. I also added a new 'Initial displaymagician setup' wiki page to help people just starting out.

Hopefully helps with #70
2021-12-28 10:28:02 +13:00
dependabot[bot]
5f933a47c8
Bump McMaster.Extensions.CommandLineUtils from 4.0.0-beta.74 to 4.0.0
Bumps [McMaster.Extensions.CommandLineUtils](https://github.com/natemcmaster/CommandLineUtils) from 4.0.0-beta.74 to 4.0.0.
- [Release notes](https://github.com/natemcmaster/CommandLineUtils/releases)
- [Changelog](https://github.com/natemcmaster/CommandLineUtils/blob/main/CHANGELOG.md)
- [Commits](https://github.com/natemcmaster/CommandLineUtils/compare/v4.0.0-beta.74...v4.0.0)

---
updated-dependencies:
- dependency-name: McMaster.Extensions.CommandLineUtils
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-27 08:23:37 +00:00
Terry MacDonald
810f1363f2 Update the Wix Installer to force an explorer restart
Updated to 2.1.5.5
2021-12-27 21:18:54 +13:00
Terry MacDonald
76ef6015b4 Updated COM DLL path 2021-12-27 19:31:46 +13:00
Terry MacDonald
53df422944 Fixed UI issues and updated Shortcuts UI
Also updated EULA to 2022. And fixed the DisplayMagician Explorer update.
2021-12-27 09:58:29 +13:00
Terry MacDonald
552727c9be Produced a new build 2021-12-26 22:39:10 +13:00
Terry MacDonald
5874d1c26b Added 'Runas' Administrator UAC for starting processes
DisplayMagician can now run a Main Application, Start ptogram or Stop Program as Administrator (usin 'Runas') which will bring up a UAC prompt. Works fine for all three types of process stat, so will keep it there :)

Please note, there isn't any run as administrator fuctionality for the Games Launchers as they don't support that at all, and if I tried to add it, it would get really tricky really quickly. This functionality should suffice for 99% of use cases.
2021-12-26 14:43:16 +13:00
Terry MacDonald
b1fa93b5be Added 'don't start if running' option to stop programs 2021-12-26 10:38:40 +13:00
Terry MacDonald
2ec08c4aca Added graying out images when not in use
Helps inform the user in the UI when they are in Application mode versus Game mode
2021-12-26 10:10:48 +13:00
Terry MacDonald
2b999d849c Working shortcut form control refactor 2021-12-26 09:13:21 +13:00
Terry MacDonald
23cd6badb4 [WIP] Managed to get the game list working correctly
Was having problems with the game icons being displayed when the shortcut was an application. But fixed now.
2021-12-25 21:20:28 +13:00
Terry MacDonald
250898ad8f Try to get the game list showing on load in Application mode
The shortcutform has an issue showing the games list icons in Application mode. It works so well in Games mode, but Application mode starts blank.
2021-12-24 23:30:33 +13:00
Terry MacDonald
7ea6383b38 [WIP] Revamped ShortcutForm to make more robust
Changed the majority of the Shortcut loading code to be way more robust, and clearer to follow. The code had grown organically since the beginning of DisplayMagician, and really, really required some changes to make it all more robust and easier to make changes in the future. This is the first commit of that code so that I can ensure I have an offsite backup.

There is still a bit more of testing and bug hunting to do before I can be sure that it is all ready to release.
2021-12-24 14:00:50 +13:00
Terry MacDonald
4217d87f7a Updated README 2021-12-23 19:01:28 +13:00
Terry MacDonald
146129a088 Updated to v2.1.4.1 2021-12-23 18:50:35 +13:00
Terry MacDonald
de1f6654c3 Fixed non-Steam Games in Steam Game list
Fixes #68. The reason DisplayMagician was crashing was that it was hitting a Uplay Game in the Steam Library. This was not a valid thing to see. The reason DisplayMagician was doing that was because of a bug in the way that the list of installed games was combined. This bug has been in all 2.x versions of DisplayMagician, and would have affected anyone with Steam and any one more GameLibrary (e.g. GOG, Epic, Uplay etc).

I also managed to find a potential issue with editing shortcuts that I've hopefully now averted.
Properly clear out the form and all it's storage variables when the form loads (done)
Add in some protection logic to avoid a crash even if this situation occurs again (partly done)

Additionally, I found a recursive logic flaw that meant that DisplayMagician used WAAAAAAAAAAAAAY more memory than it needed to. I'm talking 5GB of memory rather than the 129MB it was supposed to do. So I'm so thankful that you logged this issue so I could find that one :).
2021-12-23 18:45:04 +13:00
Terry MacDonald
c87f55c4a9 Updated version to 2.1.3.0 for release 2021-12-21 09:30:49 +13:00
Terry MacDonald
e058ec41a3 Fixed startprogram UI and made ShortcutRepository constructor more robust
Fixes #67 and hopefully fixes #68
2021-12-21 09:26:18 +13:00
Terry MacDonald
186325f587 Fixed game library text alignment in Shortcut Form 2021-12-19 09:49:46 +13:00
Terry MacDonald
911313252f Slight tweak to main form positioning
The exit button and version strings were too close to the bottom of the screen.
2021-12-19 09:46:42 +13:00
Terry MacDonald
8326b5697f Updated README 2021-12-18 22:28:45 +13:00
Terry MacDonald
11f231a9f1 Merge branch 'develop' 2021-12-18 21:58:12 +13:00
Terry MacDonald
f5018398f4 Made new build. 2021-12-18 21:57:46 +13:00
Terry MacDonald
648bbccaca Tweaked various UI features to support resizing
Improved the minimum form sizes for multiple forms to stop them looking bad.

Updated the DisplayMagician and DisplayMagicianShared assembly versions to v2.1.2.0 in preparation for release as the next version of DisplayMagician.
2021-12-18 21:55:39 +13:00
Terry MacDonald
a54ca31503 Made Display Profile window resizeable 2021-12-18 16:12:43 +13:00