tauri-apps / tauri-docs

The source for all Tauri project documentation.
https://tauri.app
MIT License
752 stars 517 forks source link

[docs] shell scope #1982

Open ponull opened 3 months ago

ponull commented 3 months ago

I need to use tauri to download and save the executable file, and use javascript to execute it using the shell api, but it prompts me "program not allowed on the configured shell scope". How should I set it up so that I can run the later downloaded program? At compile time, it is not known which executable kernel the user will choose to download.

ponull commented 3 months ago

I have the kernel: bin-22.exe bin-23.exe bin-24.exe How can I allow tauri to execute any kernel EXE file downloaded later?

FabianLars commented 3 months ago

If it's not known at compile time you have to spawn the commands on the rust side, or use cmd.exe or similar as your command and your exe as an arg to that.

In theory there's also https://github.com/tauri-apps/tauri/pull/7165 which would allow to extend the scope in rust but still spawn the command in js but the pr never got merged and i doubt it will for v1 at this point.

ponull commented 3 months ago

thanks for your answer, bro