give exe install directory command line

C++
program.exe /s /v" INSTALLDIR=<target path>"
Source

Also in C++: