radj307 / volume-control

Specific-Application Volume Control Hotkeys for Windows.
https://radj307.github.io/volume-control
GNU General Public License v3.0
78 stars 8 forks source link

[BUG] Settings are forgotten between updates #98

Closed NominalWasTaken closed 1 year ago

NominalWasTaken commented 1 year ago

Version

6.1.1-rev1

Windows Version

Windows 11 Home Version 22H2 (OS Build 22621.2428)

Actual Behaviour

Settings are forgotten after update. I had update once before and it reset my changes but I had hopped it was a one time thing but after the most recent update from 6.0.0 to 6.1.1-rev1 it seems after every update the settings are completey reset to default. Let me know if their is any more information I can provide to aid in solving this bug.

Expected Behaviour

No response

Reproduction Steps

I dont know if im just updating wrong but I just

  1. shut the program down
  2. get the latest installer executable from the releases page
  3. run the executable
  4. Then when I open the application again it has reset

Log

HH:mm:ss:fff             === Log Initialized @ Saturday, October 21, 2023 2:25:02 AM ===  { Filter: 30 (ALL_EXCEPT_DEBUG) }
20:25:02:456  [INFO]     The version number in the settings file was 0.0.0, settings will be upgraded to 6.1.1-rev1.
20:25:02:770  [INFO]     Volume Control version 6.1.1-rev1 (Installed)
20:25:02:817  [INFO]     Microsoft Windows 11 Home (64-bit)
20:25:03:354  [ERROR]    Failed to get the Process associated with session '' because of an exception:
                         {
                           'Message': 'Process with an Id of 1560 is not running.'
                           'HResult': '-2147024809'
                           'Source': 'System.Diagnostics.Process'
                           'TargetSite': {
                             'Name': 'GetProcessById'
                             'DeclaringType': 'System.Diagnostics.Process'
                             'Attributes': 'PrivateScope, Public, Static, HideBySig'
                             'CallingConvention': 'Standard'
                           }
                           'StackTrace': {
                             [0] at System.Diagnostics.Process.GetProcessById(Int32 processId, String machineName)
                             [1] at System.Diagnostics.Process.GetProcessById(Int32 processId)
                             [2] at VolumeControl.CoreAudio.AudioSession.GetProcess()
                           }
                         }
20:25:04:404  [CRITICAL] There was a problem with the hotkeys provided by the previous configuration. Attempting to load default hotkeys instead.
Rajdave69 commented 1 year ago

Same error happens to me too.

radj307 commented 1 year ago

Thanks for the report! I have identified the issue.
Expect the fix in v6.2.0 shortly.

radj307 commented 1 year ago

Fixed in 4f6b507838e8d68eab309b8b49633a8c2e5f87c6

The issue happened because the assembly attribute used to track the version number was changed and the code was not updated to match. I've added an exception for this so if this ever happens in the future the program will log the error and crash instead of silently failing.

The problem was introduced in 7dce9972119ff82285b275d580af0c5ac13eb2f4 prior to 6.0.0-pr9.1

radj307 commented 1 year ago

Fix included in v6.2.0