Commit Graph

235 Commits

Author SHA1 Message Date
Terry MacDonald
25df13e52a Library include cleanup 2021-02-21 20:23:41 +13:00
Terry MacDonald
79f535ce08 Fixing broken NLog config 2021-02-20 23:14:16 +13:00
Terry MacDonald
bb37dc908a Changed LogLevel applies immediately
Configured NLog so that the loglevel
UI changes happen straight away. Also
am using NLog to generate the user
messages while it's running.
2021-02-20 22:03:19 +13:00
Terry MacDonald
2959d5f280 Changing the default logging level to info 2021-02-20 21:04:58 +13:00
Terry MacDonald
d9da0a6e8f Shortcut library UI improvements
Added a messagebox to warn the user
when they try to run an invalid shortcut.
It now asks the user if they really want to
do it, or it directly opens the 'edit' window
for if they want to fix things now.
2021-02-15 21:29:12 +13:00
Terry MacDonald
a251962207 Partially added the Uplay Library logging 2021-02-15 20:47:56 +13:00
Terry MacDonald
6b02e2ccbe Added logging and improved readme
Added logging to ProfileRepository and
ShortcutRepository
2021-02-15 20:33:46 +13:00
Terry MacDonald
aece0cce29 Added extra debug logging 2021-02-14 22:42:48 +13:00
Terry MacDonald
b6c007fe6f Updated shortcut repository logging
Added yet more debug logging to the
software so we can get information when
there is an error.
2021-02-14 12:00:47 +13:00
Terry MacDonald
24c1ff29b4 Applied logging to program.cs
Continued to apply logging to the
various software components so that
we can get debugging logs when the
software is released for use.
2021-02-14 09:18:49 +13:00
Terry MacDonald
dd8939b395 Logging changes
Combined DisplayMagicianShared logging into
the main log file to simplify log reporting for the
future. Also started adding info and debug
statements to the program to make the debug
level log work well for troubleshooting. This is
going to take a LONG time to complete, but will
be worth it in the end.
2021-02-10 22:40:22 +13:00
Terry MacDonald
d6834b635c Disabled old FxCop Code analysis
Disabled the FxCopCode Analysis for the
release build in DisplayMagician project.
Should be only using the new .net nuget
package for code analysis.
2021-02-07 15:59:02 +13:00
Terry MacDonald
09a1ca1c96 Updated nuget libraries 2021-02-07 15:47:48 +13:00
Terry MacDonald
a06651190d Upgrade nuget libraries
Upgrade CommanlineUtils, HTMLAgility
and other libraries. Leaving ValveKeyValue
as it requires some breaking changes.
2021-02-07 15:22:54 +13:00
Terry MacDonald
ba636414c0 Improve exception handling of existing ex
Added logger instances for DisplayMagicianShared
functions. Also added logger debug commands to
all exceptions with existing ex objects.
2021-02-07 14:42:17 +13:00
Terry MacDonald
0f38881709 More code analysis suppression 2021-01-28 22:20:00 +13:00
Terry MacDonald
88bd1a71fa Fixing some CodeAnalyzer suggestions 2021-01-28 22:03:02 +13:00
Terry MacDonald
6ab1e0842a Additional suppression messages 2021-01-28 21:34:45 +13:00
Terry MacDonald
3ecababc73 Suppressing CLS compliance errors
Some functions and procedures require CLS
non-compliance due to file formats and the like.
Suppressing these compiler warnings
2021-01-28 21:19:20 +13:00
Terry MacDonald
0afe349eea Converted uint to int
This was done to be more CLS language compliant.
2021-01-28 20:58:35 +13:00
Terry MacDonald
ae106223a0 Removing editorconfig 2021-01-18 07:40:13 +13:00
Terry MacDonald
2b56d3e2b2 Fixing some UI misalignment
Changed some misanchored UI
elements so that they will move correctly
when the UI windows are resized. Also
fixed a mistake that meant the 'Create
Shortcut' message wasn't hidden
when it should be.
2021-01-07 17:31:26 +13:00
Terry MacDonald
3f46beafd3 Reorganisation of Game Start tab
Made a messsage to inform the user
we could't detect any supported game
libraries.
2021-01-07 15:17:37 +13:00
Terry MacDonald
b028ad4478 Align custom paint on form
Fix up misalignment with label
radio button, checkbox when
drawing not enabled on a black
background.
2021-01-07 14:56:29 +13:00
Terry MacDonald
fef3fb34a7 Fully works with no game libraries
Now can handle when no game libraries
are detected. Need to make the game/application
UI nicer by adding groupboxes to it.
2021-01-07 11:51:02 +13:00
Terry MacDonald
8336e910b0 Works without Game libraries installed
Basic checks for game libraries so program
will work with neither Steam or Uplay now.
2021-01-06 16:19:45 +13:00
Terry MacDonald
f1c484637c Modified Game Library installation checks
UplayLibrary was erroring when run without
Uplay installed. Needed to tweak it so that
DisplayMagician will work without Uplay
library or Steam library installed.
2021-01-06 16:00:52 +13:00
Terry MacDonald
ff33dfb95a Fixed SteamGame race condition
Found issue where the IsRunning process
checks were breaking because they were
being running before the steam process
had a chance to create the process. This
meant the information wasn't aviailable for
the SteamGame.IsRunning function to
inspect. Fixed by adding in a 0.5 sec delay.
2020-12-30 22:48:42 +13:00
Terry MacDonald
73d1735769 Added start on boot
Works fine, but just found an error
when DM is minimsed and running a
steamGame.
2020-12-30 22:40:21 +13:00
Terry MacDonald
93fc295bf2 Fixing automatic admin version upgrade
Upgrade processs wasn't upgrading using
elevated privileges. Appears to be doing so
now.
2020-12-28 23:17:13 +13:00
Terry MacDonald
ed167459fa Fixed UplayGame monitoring
Also fixed errors caused by trying to access
32bit processes information from 64-bit
processes by using smoe cool code thanks
to Jeff Mercado and Mike Fuchs:
https://stackoverflow.com/questions/9501771/how-to-avoid-a-win32-exception-when-accessing-process-mainmodule-filename-in-c
2020-12-28 21:34:59 +13:00
Terry MacDonald
c7a1f1ab55 Fix Code Analysis changes that broke things 2020-12-28 10:34:15 +13:00
Terry MacDonald
49329b870e Initial Code Analysis fixes
Also fixed up the Setup properties
file for x64 build configuration.
2020-12-26 21:46:32 +13:00
Terry MacDonald
6759cc4aa0 Renaming main buttons 2020-12-26 20:20:35 +13:00
Terry MacDonald
b5d6f3f680 Fully working Windows Toast 2020-12-26 16:59:45 +13:00
Terry MacDonald
e53f76f0ce Working open and exit toasts
Toasts working for minimised start (allows use to
open the application) and for minimised close
(allows user to open the application or exit the
application).
2020-12-23 21:13:21 +13:00
Terry MacDonald
15386ba756 Basic bidirectional notifications working 2020-12-23 18:29:20 +13:00
Terry MacDonald
2148db3e95 Fixing program settings loglevel
Had missed Fatal loglevel and missed
a mixedcase Error log level. Meant both
logging levels were broken. Now fixed.
2020-12-22 23:23:28 +13:00
Terry MacDonald
26796c9e46 Fixed MainForm control placement 2020-12-22 23:00:25 +13:00
Terry MacDonald
e4ed01f33b Added .Net 4.8 and Win 10 checks to installer 2020-12-21 15:02:06 +13:00
Terry MacDonald
7bc81f0075 Added ShellExtension.dll registration
Now the Desktop Popup Menu works!
2020-12-20 22:27:52 +13:00
Terry MacDonald
9e1ef4a095 [WIP] First working WiX installer
Installer works, but there are a few issues with it.
- It doesn't register the DesktopBackground COM server
- It doesn't create a start menu shortcut with the AUMID
- It doesn't check for .Net Framework 4.8 or later
- It doesn't try to install .Net Framework 4.8 or later if not there
- It doesn't have any customised backgrounds...
- It doesn't ask to run DisplayMagician when install is finished
2020-12-20 20:42:04 +13:00
Terry MacDonald
41fd798a07 Renamed projects to work with WiX file harvesting 2020-12-20 15:50:32 +13:00
Terry MacDonald
3a2b74b049 [WIP] Basic Notification Compat intergration 2020-12-20 15:21:53 +13:00
Terry MacDonald
33689931ca Moved AUMID to Shared project
And also added it to the LogReporter
project.
2020-12-20 12:45:50 +13:00
Terry MacDonald
7a730b7a36 Register DisplayMagician AUMID with Win10
This registers the Application User Model ID
with Win 10 so that it recognises the application
and can interact with it. This allows Toasts, Taskbar
pinning, right-click menus and other functions to
work.
2020-12-20 12:35:36 +13:00
Terry MacDonald
40ab916050 Added a back button to SettingsForm 2020-12-17 00:34:39 +13:00
Terry MacDonald
1c7b208e8b Added SettingsForm so can change settings 2020-12-17 00:23:20 +13:00
Terry MacDonald
2babf74353 Made the updater silent if no updates 2020-12-13 15:17:53 +13:00
Terry MacDonald
0989088450 Update the autoupdate location
It now points to the correct place so that
the autoupdating works as it should.
2020-12-13 15:00:46 +13:00
Terry MacDonald
2d46e4e3f8 [WIP] Adjusted the autoupdate location
Also added a settings button. Still need to add
a settings page exposing the settings.
2020-12-12 22:54:34 +13:00
Terry MacDonald
c662681860 [WIP] Added initial Autoupdater.NET config
Have created the basic setup using the JSON
version of the Autoupdater.NET config shown
on the Autoupdater.NET website at:
https://github.com/ravibpatel/AutoUpdater.NET

JSON file to be stored on the update website:
{
   "version":"0.2.0.0",
   "url":"http://displaymagician.com/downloads/DisplayMagicianSetup.zip",
   "changelog":"https://github.com/terrymacdonald/DisplayMagician/releases",
   "mandatory":{
      "value":false,
      "minVersion": "0.1.0.0",
      "mode":1
   },
   "checksum":{
      "value":"E5F59E50FC91A9E52634FFCB11F32BD37FE0E2F1",
      "hashingAlgorithm":"SHA1"
   }
}
2020-12-12 22:35:13 +13:00
Terry MacDonald
05bb163312 Fix Audio and Capture setting retention
Had problems storing ChangeAudioDevice and
SetAudioVolume settings (and the Capture Device
versions) so had to slightly change the way the
settings were stored.
2020-12-12 21:29:38 +13:00
Terry MacDonald
f55e2c29be Better described timeout as max wait (secs)
Also set it to a more reasonable 20 second timeout
and then it continues through the starting process.
Also added some NLog error handling in RunShortcut.
2020-12-11 21:40:45 +13:00
Terry MacDonald
0f65362860 Fix so application monitoring works
Application monitoring highlighted a failure
in logic, but I fixed it. It now waits for the
timeout period before exiting.
2020-12-11 18:07:17 +13:00
Terry MacDonald
58c8a7f9d2 Fixed failed waiting for game close
Added a 5 second delay before the start of
the monitoring for game closure. This is to
allow the games to be spawned by the game
library (e.g. Steam).
2020-12-11 11:43:51 +13:00
Terry MacDonald
41c48f6ef2 Added popup menu to Shortcut Library
Added a right-click popup menu to the
Shortcut Library just in case people find that
easier to use.
2020-12-11 11:34:19 +13:00
Terry MacDonald
161a39aa21 Clean up ShortcutLibraryForm 2020-12-11 10:57:03 +13:00
Terry MacDonald
71d6ef20e2 Fix Profile IsPossible check
There was an issue with the IsPossible check
as it hadn't been adjusted from when I removed
the Output from the display fingerprint. The
Output number changes in the NVIDIA driver
so it is different after a reboot. I hadn't removed
the Output from the current display device
check, and so it wasn't matching the correct
stored fingerprint.
2020-12-11 09:50:55 +13:00
Terry MacDonald
623bb65650 [WIP] Allowing DisplayView control to be empty 2020-12-10 22:56:20 +13:00
Terry MacDonald
362adbbf41 Added helper messages for new installs
Helper messages added to the MainForm and
to the Shortcut library to try and help people
understand what order to do things in so that
the software works as intended.
2020-12-09 22:30:58 +13:00
Terry MacDonald
40b396701a Forcing users to create displayProfile first
Helped direct users to the display profile page
at first by removing the create shortcut buttons
2020-12-09 22:05:52 +13:00
Terry MacDonald
9a4d8dc0c4 Cleaning up Uplay
Removing uneeded statements from UplayGame
2020-12-09 20:48:49 +13:00
Terry MacDonald
0830ed58dd Fixed Steam and Uplay game detection
Fixed an issue where Steam and Uplay don't detect the
game correctly. Now they find the processes themselves.

Also fixed ProgramSettings so that it generates a new
settings file on startup.

Also added LogLevel option to the ProgramSettings so that
I can start rolling out the NLog log statements to report
errors from the binary when it's installed on people's
PCs.
2020-12-09 20:47:30 +13:00
Terry MacDonald
c0389cdba7 Added NLog to Program.cs
Did the first basic integration and setup for
NLog to the application as part of my push
to get better error logging.
2020-12-08 21:20:26 +13:00
Terry MacDonald
41fc905e8c Skip audio change if same audio device
Only perform an audio device change if the
audio device is a different one.
2020-12-07 21:11:51 +13:00
Terry MacDonald
a7aa06f3e0 Rename Copy function to CopyInto 2020-12-07 21:08:34 +13:00
Terry MacDonald
02485e6de3 Fix audio setup issue and update setup UI
The audio onselect event had an errant bit of
logic that resulted in an exception - now fixed.
Also updated the Setup UI with nicer pictures
and some words that are more reflective of the
purpose of this software.
2020-12-06 22:18:01 +13:00
Terry MacDonald
9522af5574 Added new CreateProfile startup action
CreateProfile will just open a new DisplayProfile
window and that will be used only from the
Shell Extension.
2020-12-06 21:33:00 +13:00
Terry MacDonald
45e2c32c30 Updated shell ext to createprofile 2020-12-06 21:19:03 +13:00
Terry MacDonald
80ef9d807e Initial fixes for Setup 2020-12-05 21:40:20 +13:00
Terry MacDonald
c9957b28a5 Audio volume now set correctly
It also changes the audio device and then
rolls back the changes on game exit.
2020-12-05 17:41:15 +13:00
Terry MacDonald
09b9e185e3 Correcting audio selection loading in UI
Was incorrectly loading audio volume on form
load and also not correctly adjusting it when
selecting a different audio device.
2020-12-05 17:04:30 +13:00
Terry MacDonald
a87d6397fa WIP] Audio volume UI 2020-12-04 23:09:08 +13:00
Terry MacDonald
0eb05639f6 WIP] Adding audio volume to shortcut form 2020-12-04 21:53:15 +13:00
Terry MacDonald
c5cb6e52f1 Removing old code 2020-12-04 21:05:06 +13:00
Terry MacDonald
a596c0b252 Added Audio switching and reverting logic
Audio device now correctly switches and reverts.
Very happy how easy that was to do. This is an
amazing audio library!
2020-12-03 23:10:25 +13:00
Terry MacDonald
cd93986530 Added audioPermanence to choose audio separately
Separated permanence to display and audio separately
so you can choose exactly what reverts.
2020-12-03 22:25:28 +13:00
Terry MacDonald
eb93e84e22 Added audiodevice logic to save it
Added the ability to store the audio device
information within the ShortcutItem, and also
added the logic to the ShortcutForm to correctly
load and save the audio device settings. Also
coped with the edge case of when an audio device
is turned off or unplugged when the user edits the
shortcut... in that case we want to still keep the
old audio device settings as it is likely to be plugged
back in when the shortcut is actually run.
2020-12-03 21:45:24 +13:00
Terry MacDonald
e44c2d045b Disabled rescan audio button by default 2020-12-02 22:49:50 +13:00
Terry MacDonald
b95f7b7a47 Tweaked the rescan audio button appearance 2020-12-02 22:47:39 +13:00
Terry MacDonald
1714cf3a9f [WIP] populated dropdown with audio devices
Part of the work through getting audio devices
into DisplayMagician, as it now scans the devices
and automatically selects the one in use currently.
You can also press the 'rescan' button to have it
update the list. This is the UI part done.

Next step is the saving the chosen audio device
to the saved Shortcut!
2020-12-02 22:44:02 +13:00
Terry MacDonald
6743061962 Fixed missing HeliosPLus renames 2020-12-02 22:06:50 +13:00
Terry MacDonald
c05078dd9a Fixed inadvertent SteamLibrary duplication
Accidentally was adding uplay games to the
steam library. Used AddRange to combine
the game libraries together so it works.
2020-12-02 21:53:11 +13:00
Terry MacDonald
415ff0eed0 Rename HeliosPlus to DisplayMagician
Decided to rename the application to DisplayMagician
to make it way more discoverable. Turns out there are
a LOT of applications named HeliosPlus!
2020-12-02 21:11:23 +13:00