ModOrganizer2 / modorganizer

Mod manager for various PC games. Discord Server: https://discord.gg/ewUVAqyrQX if you would like to be more involved
http://www.nexusmods.com/skyrimspecialedition/mods/6194
GNU General Public License v3.0
2.15k stars 160 forks source link

My Tauri App crashes when started from MO2 #1886

Open Kiyozz opened 12 months ago

Kiyozz commented 12 months ago

The problem:

I built an app to compile Papyrus Script (that uses PapyrusCompiler under the hood). I initially built this app with electronjs. I started to migrate it to tauri.app (to reduce the install size a lot!)

Tested with MO2 2.5.0-beta11 and 2.4.4

To Reproduce:

To reproduce, make sure to have all Tauri requisites.

Node 18, pnpm 8.

You will need an MO2 environment and Skyrim LE/SE/AE game.

repository: https://github.com/Kiyozz/papyrus-compiler-app-tauri and branch main.

In a terminal inside the project ↓

pnpm i
pnpm tauri:build
start MO2
start the release target PCA.exe with MO2 (in `src-tauri/target/release`)

Inside MO2, you need to have the executable, for example ↓

add_exe

Environment:

Details:

Taken from my other issue in tauri project

I'm building an application that will be used by Skyrim Modders. The application is launched through an app called Mod Organizer 2 (this app uses something called vfs for virtual filesystem).

I built the app first with electron 3 years ago. Today, I want to migrate to tauri to reduce the bundle size and memory usage.

When starting the app exe from Windows Explorer, the Webview starts and the application is working.

When starting the app with Mod Organizer 2, the Webview starts and you can see the app menu, a blank window app and finally the app crashes with the below stack trace.

You could say

"ok, this is a problem with Mod Organizer"

but why when I built the app with electron, I did not have this problem?

Link to Mod Organizer logs:

USVFS:

Logs here

MO Interface:

Logs here

You will see I use Starfield in the logs, but whatever game I use, the same happens.

Feel free to contact me on Discord at _wk (I'm on the Discord Server)

Silarn commented 12 months ago

This appears to be attempting to load and hook Microsoft Edge WebView. Electron apps generally ship with their own stripped down chromium renderer, but trying hook an actual system browser is potentially problematic and I'd probably avoid trying to do it with USVFS. (Particularly one shipped by Microsoft which is likely to be compiled in a way that prevents USVFS from hooking it.)

Kiyozz commented 12 months ago

Tauri uses Webview to avoid installing a browser with many megabytes! This is the main reason tauri exists.

https://tauri.app/v1/references/webview-versions

BeermotorWB commented 11 months ago

(Particularly one shipped by Microsoft which is likely to be compiled in a way that prevents USVFS from hooking it.)

Just out of curiosity and to aid in finding a possible work-around,: what would prevent USVFS from hooking into the WebView goodies?