Trouble with runprogram

Just starting out? Need help? Post your questions and find answers here.
Jeromyal
Enthusiast
Enthusiast
Posts: 216
Joined: Wed Jul 17, 2013 8:49 am

Trouble with runprogram

Post by Jeromyal »

When I use this

Code: Select all

RunProgram(~"\".\\installs\\" + GetGadgetItemText(#field, selected) + ~"\\Vintagestory.exe\"", ~"--dataPath=\"userData\"", ".\\installs\" + GetGadgetItemText(#field, selected))                  
The game opens but only renders the top left quarter of the game in the top left quarter of the screen.

Has anyone had and solved this issue.
User avatar
Piero
Addict
Addict
Posts: 862
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Trouble with runprogram

Post by Piero »

Dunno about the rendering problems, but ".\\installs\"

Code: Select all

~"--dataPath=\"userData\"", ".\\installs\" + GetGadgetItemText(#field, selected))
seems malformed (no ~)… did you mean:

Code: Select all

~"--dataPath=\"userData\"", ~"\".\\installs\\\"" + GetGadgetItemText(#field, selected))
? (or ".\installs\")
Jeromyal
Enthusiast
Enthusiast
Posts: 216
Joined: Wed Jul 17, 2013 8:49 am

Re: Trouble with runprogram

Post by Jeromyal »

Thank you for catching that Piero.

I added ~ to correct that. Does not fix the graphical issue but I am now sending a Propper quoted path of a working directory to RunProgram now.
GetGadgetItemText(#field, GetGadgetState(#field)) returns a directory name that contains spaces.
I guess I had already made many changes to that command since the initial post, but that error you found was still there.
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: Trouble with runprogram

Post by AZJIO »

Code: Select all

GetCurrentDirectory(~"\".\\installs\\" + GetGadgetItemText(#field, selected) + ~"\\Vintagestory.exe\"")
Post Reply