r0x0r / pywebview

Build GUI for your Python program with JavaScript, HTML, and CSS
https://pywebview.flowrl.com
BSD 3-Clause "New" or "Revised" License
4.65k stars 540 forks source link

[Edge] Exception when running as admin #361

Closed BlackTurtle123 closed 5 years ago

BlackTurtle123 commented 5 years ago

Python version: 3.7 Pyinstaller version: Git dev version Pywebview version: latest OS: windows 10 and windows 8 64 bit Issue: When running the builded exe as administrator the exe fails and complains about missing RPC calls. Unbuilded version or non administrator running version don't give this issue. Verified on 3 systems. Why I report this issue here? There are issues who point to toolkit/webview Onverwerkte uitzondering: Python.Runtime.PythonException: Exception : Kan RPC niet uitvoeren. (Uitzondering van HRESULT: 0x800706BE) bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bij Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlProcess.<CreateWebViewControlHostAsync>d__16.MoveNext() --- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden --- bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bij Microsoft.Toolkit.Forms.UI.Controls.WebViewControlProcessExtensions.CreateWebViewControlHost(WebViewControlProcess process, IntPtr hostWindowHandle, Rectangle bounds) bij Microsoft.Toolkit.Forms.UI.Controls.WebView.Initialize() bij Microsoft.Toolkit.Forms.UI.Controls.WebView.System.ComponentModel.ISupportInitialize.EndInit() bij Python.Runtime.Dispatcher.Dispatch(ArrayList args) bij System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bij System.Threading.ThreadHelper.ThreadStart()

image

Am I willing to support this: Potentially if I can get pywebview stable working with my app I am willing to donate or look into helping solve issues. For now I am trying this as experimental to check if it runs more stable then PyFlaDesk

r0x0r commented 5 years ago

This error is ahem double Dutch to me. Are you getting the same error with the provided flask example if you try to freeze it on your computer?

BlackTurtle123 commented 5 years ago

When it's freezed and we run it as administrator on my or other computers. So freezing goes okay, running non frozen goes okay, running as non admin also goes okay. It has some issues with rpc command it can't execute. Exception in english: "Exception : The remote procedure call failed. (Exception from HRESULT: 0x800706BE) "

r0x0r commented 5 years ago

Can you test it with the just released 3.0.2?

jorubyp commented 5 years ago

I've been experiencing the same problem, and it doesn't seem like 3.0.2 has solved it for me unfortunately:

Unhandled Exception: Python.Runtime.PythonException: Exception : The remote procedure call failed. (Exception from HRESULT: 0x800706BE) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlProcess.<CreateWebViewControlHostAsync>d__16.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Toolkit.Forms.UI.Controls.WebViewControlProcessExtensions.CreateWebViewControlHost(WebViewControlProcess process, IntPtr hostWindowHandle, Rectangle bounds) at Microsoft.Toolkit.Forms.UI.Controls.WebView.Initialize() at Microsoft.Toolkit.Forms.UI.Controls.WebView.System.ComponentModel.ISupportInitialize.EndInit() at Python.Runtime.Dispatcher.Dispatch(ArrayList args) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

r0x0r commented 5 years ago

Isolating the problem would help solve the issue. a) Does it occur with any examples? b) What do you do to get this exception?

Googling revealed that the problem seems to occur when running under admin https://github.com/windows-toolkit/Microsoft.Toolkit.Win32/issues/50

EdgeHTML is buggy as af, so I would not hold my breathe that this will get fixed at any point.

jorubyp commented 5 years ago

a) Yes, it occurs with the Flask example b) I run main,py in the Flask example, no window is created but the server starts and is accessible for 15 seconds, after which the error occurs.

I can live with not being able to run it as admin though (and it does work fine otherwise), I just thought I'd share that I had experienced it too.

Sorry for not providing more details originally, and again if this isn't enough to be helpful.

BlackTurtle123 commented 5 years ago

Yes I can confirm Flask app fails I start it, it start running and after 10-15sec it fails Exact same code, exact same way of running does work as non admin

Op di 20 aug. 2019 om 14:26 schreef Jo Ruby P notifications@github.com:

a) Yes, it occurs with the Flask example b) I run main,py in the Flask example, the server starts and is accessible for 15 seconds after which the error occurs.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r0x0r/pywebview/issues/361?email_source=notifications&email_token=AD2LO2BUEXGGRJMYUCHNQ4LQFPPIRA5CNFSM4II5YE7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4WDINY#issuecomment-522990647, or mute the thread https://github.com/notifications/unsubscribe-auth/AD2LO2FDMOJSXIWKM54KHH3QFPPIRANCNFSM4II5YE7A .

r0x0r commented 5 years ago

Works as non-admin, fails as admin throwing this exception here.

josiahvehrs commented 5 years ago

I'm getting the same exception when running as admin, when running unelevated it works just fine.

r0x0r commented 5 years ago

I have updated the documentation https://pywebview.flowrl.com/guide/renderer.html#edgehtml

Closing this issue now

amalthomas-exe commented 3 years ago

is there a fix for this issue??

r0x0r commented 3 years ago
  1. Use other renderer. The new Chromium is way forward
  2. Do not run as admin
amalthomas-exe commented 3 years ago

my work requires me to have admin priviledges to write information can you suggest any other rendered..

r0x0r commented 3 years ago

Use Chromium or CEF. Instructions for installing Chromium can be found here. https://pywebview.flowrl.com/guide/renderer.html

r0x0r commented 3 years ago

Updated installation guide. https://pywebview.flowrl.com/guide/installation.html

amalthomas-exe commented 3 years ago

It's working for me ! Thanks!

DedFishy commented 3 years ago

You should really try to fix this issue, it's really dumb.