Running GenerateProjectFiles for the correct engine version from File Generating tool?

I have a Dialogue system generating tool that currently generates dialogue for a project. After it has finished generating dialogue I have it calling GenerateProjectFiles.sh, or GenerateProjectFiles.bat based on platform. I understand that the end user can find the appropriate script by adding the path to Unreal to their system path. I’m just curious what’s the best means of ensuring the right engine version’s GenerateProjectFiles runs, incase multiple versions of the engine are installed and listed in the end users path?