JosefNemec / Playnite

Video game library manager with support for wide range of 3rd party libraries and game emulation support, providing one unified interface for your games.
https://playnite.link
MIT License
9.56k stars 507 forks source link

Crash while starting Battle.net Games #708

Closed LordHepipud closed 6 years ago

LordHepipud commented 6 years ago

While trying to start Battle.net games, Playnite crashes and requires a restart. Other plattforms work, only Battle.net is broken so far.

Installation directories:

Battle.net

D:\Games\Battle.net

Games:

R:\Games\Heroes of the Storm
R:\Games\Overwatch

Exception:

System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei Playnite.Providers.GameController.ReleaseResources()
   bei Playnite.Providers.GameController.Dispose()
   bei Playnite.Providers.GameControllerFactory.DisposeController(IGameController controller)
   bei Playnite.Providers.GameControllerFactory.RemoveController(IGameController controller)
   bei Playnite.Providers.GameControllerFactory.RemoveController(Int32 gameId)
   bei PlayniteUI.GamesEditor.PlayGame(Game game)
   bei PlayniteUI.ViewModels.GameDetailsViewModel.<get_PlayCommand>b__40_0(Object a)
   bei PlayniteUI.Commands.RelayCommand`1.Execute(Object parameter)
   bei MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   bei System.Windows.Controls.Primitives.ButtonBase.OnClick()
   bei System.Windows.Controls.Button.OnClick()
   bei System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   bei System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   bei System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   bei System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   bei System.Windows.Input.InputManager.ProcessStagingArea()
   bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   bei System.Windows.Application.RunDispatcher(Object ignore)
   bei System.Windows.Application.RunInternal(Window window)
   bei System.Windows.Application.Run(Window window)
   bei PlayniteUI.App.Main()

Any ideas?

JosefNemec commented 6 years ago

Can you replace files in installation directory with these and try it again? If the crash occurs again then please attach diagnostics package that you can create from the crash dialog. Thank you

LordHepipud commented 6 years ago

Made some research myself. The app seems to crash at the following location:

\source\Playnite\System\ProcessStarter.cs

public static Process StartProcess(string path, string arguments, string workDir)
{
        var info = new ProcessStartInfo(path)
        {
                Arguments = arguments,
                WorkingDirectory = string.IsNullOrEmpty(workDir) ? (new FileInfo(path)).Directory.FullName : workDir
        };

        return Process.Start(info);
}

Var Dumps:

path: ""
arguments: "--exec=\"launch Hero\""
workDir: null

Exception:

System.ArgumentException: "The path has an invalid format."

Which is in general true, because it is empty :P

JosefNemec commented 6 years ago

Hmm looks like we failed to detect Battle.net installation path. Can you send me that diag. package please?

LordHepipud commented 6 years ago

Sure, where do you want me to send them? I would not want to upload them to a public place as it contains plenty of data :P

JosefNemec commented 6 years ago

You can send it to contact@playnite.link

LordHepipud commented 6 years ago

Okay, just resolved the issue. It used to be an layer 8 problem 🙈 I just remembered that I used to have problems with Battle.net App before, because at some point I changed some disk partitioning.

Long talk short sense: Windows didn't know that Battle.net was installed which I just found out by scrolling down the diagnostic files. Which results in your App not able to detect it at all.

Reinstalled Battle.Net now and everything works as expected.

Sorry for the trouble. Sometimes the problem sits in front of the screen (layer 8 problem 😅🤣)

Great App - you did an amazing job. I will share it with everyone 😃