ruarai / CompilePal

A tool to assist in the compiling of source engine maps
GNU General Public License v3.0
220 stars 25 forks source link

Check if an executable exists before writing it to config #188

Closed hexaflexahexagon closed 1 year ago

hexaflexahexagon commented 1 year ago

Is your feature request related to a problem? Please describe. If a game decides to be difficult like Momentum Mod and move binaries around to non-standard places it can result in the paths being read from the registry not being accurate. This can be seen here in the momentum discord server: https://discord.com/channels/235111289435717633/235121530609205249/1058179315424051321

The result is failed compiles when using tools like bspzip.exe since they are not in the Directory reg key, but rather in a separate binary folder.

Describe the solution you'd like When reading files like so: https://github.com/ruarai/CompilePal/blob/f8ee5a5bc7fe878eff050805d89ccdd89d6129ee/CompilePalX/GameConfiguration/GameConfigurationParser.cs#L39-L41 Do a check to determine if they exist in the bin folder before automatically writing that to the gameConfigs.json file. If nothing exists in the bin folder, it would be convenient if compile pal went and checked other directories used for tools like vbsp.exe or vrad.exe if they are different. This would solve the issue linked above without users needing to edit their config files to point things in the right place themselves.

Describe alternatives you've considered n/a

Additional context n/a

Exactol commented 1 year ago

Should be an easy fix, I'll look into it

Exactol commented 1 year ago

This build should fix the issue https://www.dropbox.com/s/218larfwh1qyriw/Compile%20Pal%20027.32.zip?dl=0