NiyaShy / XB1ControllerBatteryIndicator

A tray application that shows a battery indicator for an Xbox-ish controller and gives a notification when the battery level drops to (almost) empty.
GNU General Public License v2.0
715 stars 51 forks source link

No longer runs. #15

Closed HulkSmashBurgers closed 5 years ago

HulkSmashBurgers commented 5 years ago

I see this popping up in Event Viewer:

Faulting application name: XB1ControllerBatteryIndicator.exe, version: 1.2.1.0, time stamp: 0x5bf1c15d Faulting module name: KERNELBASE.dll, version: 10.0.17763.134, time stamp: 0xc30ded87 Exception code: 0xe0434352 Fault offset: 0x0011ab32 Faulting process id: 0x12c4 Faulting application start time: 0x01d4b47df0036970 Faulting application path: D:\XB1ControllerBatteryIndicator_1.2.1_testing\XB1ControllerBatteryIndicator.exe Faulting module path: C:\Windows\System32\KERNELBASE.dll Report Id: 0942e3bd-ec86-4a88-a67c-840309bef541 Faulting package full name: Faulting package-relative application ID:

NiyaShy commented 5 years ago

Hey, the application error itself isn't very informative. Could you check of you have any other event log entries at the same time? I tried forcing a crash and got 3 entries with the sources ".NET runtime", "Application error" and "Windows error reporting".

Also, please double check that all files from the archive are still present. You should have 14 files: 12 DLLs, the exe and a config file.

HulkSmashBurgers commented 5 years ago

Sorry, there is in fact another error event that appears at the same time. It's a .net runtime error.

I redownloaded the zip for a fresh start, and it's the same.

Application: XB1ControllerBatteryIndicator.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.BadImageFormatException at System.Windows.Application.ApplicationInit() at System.Windows.Application..cctor()

Exception Info: System.TypeInitializationException at System.Windows.Application..ctor() at XB1ControllerBatteryIndicator.App.Main()

NiyaShy commented 5 years ago

Hmm... That's weird. The BadImageFormatException could point to you not having the correct (or rather, a too old) .NET runtime version installed on your system. The program is meant to run on .NET 4.5.2 or newer.

Are you using Windows 10? If so, please open a powershell window, and paste in this command: (Get-ItemProperty "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Release and compare the number you get with this table to get the current .NET version you're running.

HulkSmashBurgers commented 5 years ago

Windows 10 with ".NET Framework 4.7.2 installed on Windows 10 October 2018 Update"

The app was working fine until a few days ago, then I noticed it was no longer in the notification tray.

NiyaShy commented 5 years ago

Really can't say what's wrong then... Could you cross-check with version 1.2.0 just in case?

HulkSmashBurgers commented 5 years ago

Same with 1.2.0

Maybe it's just a problem with my system. It does fail a SFC, but I think it's for an unrelated issue. I'll try a fresh install in a few days.

NiyaShy commented 5 years ago

Could be, after all .NET is pretty deeply rooted into the system. When SFC has issues, you could check your CBS log (C:\Windows\Logs\CBS) and see if there are issues that can be fixed. You could also try a component store cleanup/repair, see here.

HulkSmashBurgers commented 5 years ago

Windows reinstalled. App is working again. Problem solved, but the exact cause will remain a mystery I guess.

Thanks for the support. You're a great dev.

NiyaShy commented 5 years ago

Great to hear that it works again and that "only" Windows was at fault. Some of those weird happenings will probably remain a mystery forever, but at least you found a fix ;)

austinarchibald commented 1 year ago

Update: I replaced the beta with Release v1.3.1.2 and it launched without needing a restart. Keep you posted if it crashes and won't launch again!

I posted this last night, but after a restart, it started working, so I deleted it. But now it's not working again. Maybe I need to restart again. But I would like to not have to do that constantly. Any troubleshooting ideas? Here are the events.

Log Name:      Application
Source:        Application Error
Date:          4/21/2023 12:58:35 PM
Event ID:      1000
Task Category: Application Crashing Events
Level:         Error
Keywords:      
User:          PARKCITY\Redux
Computer:      ParkCity
Description:
Faulting application name: XB1ControllerBatteryIndicator.exe, version: 1.3.1.0, time stamp: 0x5ffdc7e6
Faulting module name: KERNELBASE.dll, version: 10.0.22621.1555, time stamp: 0x686e4e74
Exception code: 0xe0434352
Fault offset: 0x001479d2
Faulting process id: 0x0x1E04
Faulting application start time: 0x0x1D9748345B13138
Faulting application path: C:\Users\Redux\Applications\zTools\XB1ControllerBatteryIndicator_1.4.0_Beta\XB1ControllerBatteryIndicator.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: 3c5f2e44-660a-4cd4-a569-f3cc8473fa3b
Faulting package full name: 
Faulting package-relative application ID: 
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" Guid="{a0e9b465-b939-57d7-b27d-95d8e925ff57}" />
    <EventID>1000</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>100</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2023-04-21T18:58:35.5714047Z" />
    <EventRecordID>33768</EventRecordID>
    <Correlation />
    <Execution ProcessID="3276" ThreadID="18688" />
    <Channel>Application</Channel>
    <Computer>ParkCity</Computer>
    <Security UserID="S-1-5-21-2428640832-2709578228-1339652107-1000" />
  </System>
  <EventData>
    <Data Name="AppName">XB1ControllerBatteryIndicator.exe</Data>
    <Data Name="AppVersion">1.3.1.0</Data>
    <Data Name="AppTimeStamp">5ffdc7e6</Data>
    <Data Name="ModuleName">KERNELBASE.dll</Data>
    <Data Name="ModuleVersion">10.0.22621.1555</Data>
    <Data Name="ModuleTimeStamp">686e4e74</Data>
    <Data Name="ExceptionCode">e0434352</Data>
    <Data Name="FaultingOffset">001479d2</Data>
    <Data Name="ProcessId">0x1e04</Data>
    <Data Name="ProcessCreationTime">0x1d9748345b13138</Data>
    <Data Name="AppPath">C:\Users\Redux\Applications\zTools\XB1ControllerBatteryIndicator_1.4.0_Beta\XB1ControllerBatteryIndicator.exe</Data>
    <Data Name="ModulePath">C:\Windows\System32\KERNELBASE.dll</Data>
    <Data Name="IntegratorReportId">3c5f2e44-660a-4cd4-a569-f3cc8473fa3b</Data>
    <Data Name="PackageFullName">
    </Data>
    <Data Name="PackageRelativeAppId">
    </Data>
  </EventData>
</Event>

and

Log Name:      Application
Source:        .NET Runtime
Date:          4/21/2023 12:58:35 PM
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      ParkCity
Description:
Application: XB1ControllerBatteryIndicator.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: SharpDX.SharpDXException
   at SharpDX.Result.CheckError()
   at SharpDX.XInput.Controller.GetBatteryInformation(SharpDX.XInput.BatteryDeviceType)
   at XB1ControllerBatteryIndicator.SystemTrayViewModel+<>c.<RefreshControllerState>b__22_1(SharpDX.XInput.Controller)
   at System.Linq.Enumerable+<>c__DisplayClass7_0`3[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.ValueTuple`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[SharpDX.XInput.BatteryInformation, SharpDX.XInput, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<CombineSelectors>b__0(System.__Canon)
   at System.Linq.Enumerable+WhereSelectArrayIterator`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.String.Join(System.String, System.Collections.Generic.IEnumerable`1<System.String>)
   at XB1ControllerBatteryIndicator.SystemTrayViewModel.RefreshControllerState()
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name=".NET Runtime" />
    <EventID Qualifiers="0">1026</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2023-04-21T18:58:35.3926448Z" />
    <EventRecordID>33767</EventRecordID>
    <Correlation />
    <Execution ProcessID="7684" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>ParkCity</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Application: XB1ControllerBatteryIndicator.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: SharpDX.SharpDXException
   at SharpDX.Result.CheckError()
   at SharpDX.XInput.Controller.GetBatteryInformation(SharpDX.XInput.BatteryDeviceType)
   at XB1ControllerBatteryIndicator.SystemTrayViewModel+&lt;&gt;c.&lt;RefreshControllerState&gt;b__22_1(SharpDX.XInput.Controller)
   at System.Linq.Enumerable+&lt;&gt;c__DisplayClass7_0`3[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.ValueTuple`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[SharpDX.XInput.BatteryInformation, SharpDX.XInput, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].&lt;CombineSelectors&gt;b__0(System.__Canon)
   at System.Linq.Enumerable+WhereSelectArrayIterator`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.String.Join(System.String, System.Collections.Generic.IEnumerable`1&lt;System.String&gt;)
   at XB1ControllerBatteryIndicator.SystemTrayViewModel.RefreshControllerState()
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

</Data>
  </EventData>
</Event>
NiyaShy commented 1 year ago

Ah, that explains why I got an e-mail notification but couldn't find your post. If I interpret the version number and executable path from your log entries correctly (v1.3.1.0 but a path for the "beta") I'd guess the crash (still) came from the first 1.4 "beta" release. Did you perhaps enable "start with windows" for that version?

Anyway, for error search I can mostly just point towards the typical methods of finding (and fixing) issues with windows itself: Open a CMD window with admin permissions and run the 2 commands

If DISM reports any issues, run

Each of those commands can take a while to run.