Fureeish
02/10/2025, 9:33 PM.exe which I would like to run when a Button is clicked). I figured that I would put that executable in the composeApp/commonMain/composeResources directory, but unless I put it inside files/.../that.exe, it fails to compile. What's more, when it finally compiled, I don't know if there is a way of safely retrieving it. composeapp.generated.resources.[...] does not list that executable. A path to it would be sufficient, I believe.
Is there a recommended way of achieving this behavior?
Maybe I should be using object {}.javaClass.classLoader.getResourceAsStream(...)?Fureeish
02/10/2025, 10:02 PMresources directory. But I am enocuntering an interesting issue. My path to that dir is: <project>\composeApp\src\commonMain\resources\executables\some.exe. I verified that is it being correctly copied to the build directory, but apparently I get an exception, saying that there is no such file in the resulting `.jar`:
Cannot run program 'file:/<project>/composeApp/build/libs/composeApp-desktop.jar!/executables/some.exe':
CreateProcess error=2, The system cannot find the file specified
The thing is, as I mentioned already, inside the .jar there is an executables directory with some.exe, which means that the project passes it correctly.
The only weird thing that caught my attention is that the error mentions composeApp-desktop.jar! - that is, with a ! at the end. Is this normal?ephemient
02/10/2025, 11:54 PMephemient
02/10/2025, 11:55 PMFureeish
02/11/2025, 6:15 PMRes.getUri(). I had to move to plain-old resources and use object {}.javaClass.classLoader.getResourceAsStream(...).
But it works correctly now :>