I'd like to let user to execute the installed application via a .bat file from the installation finish page. That's the code:
!define INSTALL_DIR $PROGRAMFILES64\(some folder)
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
Function LaunchLink
SetOutPath "${INSTALL_DIR}"
ExpandEnvStrings $0 %COMSPEC%
Exec '"$0" /C "${INSTALL_DIR}\my.bat"'
FunctionEnd
It works as expected in most cases. But in case I have both:
C:\Program Files\(some folder) and
C:\Program Files (x86)\(some folder)
With my.bat file available in both of them, I get the one in the Program Files (x86) executed. I also tried to hardcode exact path to the .bat file instead of using ${INSTALL_DIR} constant, but still the same issue.
What am I doing wrong? Am I missing something?