Launch EXE fr FolderItem or Shell doesnt work

So I have a game - lets just say insurgency.exe (in its install dir) - but it doesn’t matter.

the game obviously loads fine on its own - user double clicks EXE. but when I pass a folderitem.launch() through a xojo app - the game starts, screen blinks, then game shuts down with error “cannot load shaders”.

So I decided to try and pass a shell command, as if cmd had launched the EXE file.

this too failed “cannot load shaders.txt” - yet cmd outside xojo works without a problem.

Then, just to cover the bases - I created a batch file in directory (remove the middleman by adding, a middleman LOL) - but xojo executes and nothing happens - I go and double click the batch file … nothing happens.

sooooooooooooooooo… am I right when I start thinking soft windows declare?

What happens if you move your Xojo app’s EXE into the game’s install directory?

it, uhh.

you have an explanation?

Note* game is on /D drive. not /C - No registry entry exists on this copy of the folder. (its a modding copy of game dir.)

I’m assuming this has something to do with it?

It seems like it, you’ll probably need to use CreateProcessW where you can specify lpCurrentDirectory or a dirty way is to call start with /d so you can specify the working directory.

[edit to answer above as they were posted at similar times]

The explanation is that its working directory is the current directory unless specified, so running it next to the target app happens to have the working directory in the right place.

This… isn’t hammering through my skull since its launched by a full path *shell or fi) - how to specify?

so this was just a major oversight.

no matter what, this leads me to the right place as I continue to work with declares in my #WindowsLife :wink: thanks

Instead of CreateProcess you might try SetCurrentDirectory:

Declare Function SetCurrentDirectoryW Lib "Kernel32" (Path As WString) As Boolean Call SetCurrentDirectoryW(gameDir.NativePath) gameDir.Child("game.exe").Launch()

Every snippet of code here renders -

the game, however - does not launch.

I even use all above options on the D path.

the game only launches appropriately if the whole application is in the same folder as the games EXE.

at this point. the only issue with me installing to that folder is a checksum … even when modded - non corresponding checksums would be kicked from a server. ughhhhhh

Try creating a shortcut to the app, with the working directory set to the application’s folder
And then try launching the shortcut.

You would have the same trouble launching a Xojo app from another, since Xojo apps are heavily dependant on sub folders.