Unfortunately, ChangesEnvironment=yes doesn't work.
The installer (InnoSetup) is running with the old PATH. During installation, the component (in my case, SQL LocalDB) modifies the PATH. When the installer finally runs MyApp.exe, the environment variables are copied from the parent process to the child process (with the old PATH value).
There's a workaround for this problem by running the application through explorer.exe.
[Run]
Filename: "explorer.exe"; Parameters: """{app}\MyApp.exe"""; WorkingDir: "{app}"; Flags: postinstall waituntilidle shellexec; Description: "Run MyApp";
or
[Run]
Filename: "{win}\explorer.exe"; Parameters: """{app}\MyApp.exe"""; WorkingDir: "{app}"; Flags: postinstall waituntilidle; Description: "Run MyApp";
I choose the second option.
Do you have any comments on this solution?