0

I need my Inno setup installation to run a program when the installation of my application has finished.

The program I need to run can can be executed with this command:

C:\Path\To\Application\MyProgram.exe -c componentA -i C:\Path\To\Application\MyFile.bin

I can then go to the Window's registry to check if MyProgram.exe was successfully doing its purpose.

So in my Inno Setup Compiler .iss-file I have this setup:

[Files]
Source: "C:\Files\For\Installation\MyProgram.exe"; DestDir: "{app}"; Flags ignoreversion
Source: "C:\Files\For\Installation\MyFile.bin"; DestDir: "{app}"; Flags ignoreversion

When the installation is done, I see MyProgram.exe and MyFile.bin have been placed where the application was installed:

C:\Path\To\Application\MyProgram.exe
C:\Path\To\Application\MyFile.bin

I have setup my Inno Setup script to run the the program with the parameters like this:

Filename: "{app}\MyProgram.exe"; Parameters: "-c componentA -i {app}\MyFile.bin";

My intension was the this would have the installation to run:

C:\Path\To\Application\MyProgram.exe -c componentA -i C:\Path\To\Application\MyFile.bin

When running the installation I see the Window's terminal is opened and immediately closed. I assume the installation at least is trying to run what I want. But I'm unable to see any information displayed in the Window's terminal due to it's immediately closed. When checking the Window's registry nothing has been altered = No success.

Any suggestions?

Mc_Topaz
  • 567
  • 1
  • 6
  • 21
  • My first guess would be that the application was installed to a path with space (like `Program Files`), so you need to escape the path in the parameters: `Parameters: "-c componentA -i ""{app}\MyFile.bin""";` – Martin Prikryl Sep 29 '17 at 15:44
  • I added the /K switch but it was unable to let the window's terminal remain open. I also installed the application at C:\MyApplicaiton but with no success. – Mc_Topaz Sep 29 '17 at 16:04
  • Show us your new entry. – Martin Prikryl Sep 29 '17 at 16:29
  • Filename: "{app}\Myprogram.exe"; Parameters: "/K -c componentA -i ""{app}\MyFile.bin"""; – Mc_Topaz Sep 29 '17 at 16:46
  • That's not what my answer to the linked question shows. Please read it again carefuly. You have to use `{cmd}`. – Martin Prikryl Sep 29 '17 at 16:49
  • Sorry, but I don't see what I'm miss: I used: Parameters: "/K {app}\setup.bat arguments" To: Parameters: "/K -c componentA -i {app}\MyFile.bin" Then included escape to the path: Parameters: "/K -c componentA -i ""{app}\MyFile.bin""" – Mc_Topaz Sep 29 '17 at 16:54
  • `Filename: {cmd}; Parameters: "/K ""{app}\MyProgram.exe"" -c componentA -i ""{app}\MyFile.bin"""` – Martin Prikryl Sep 29 '17 at 17:22
  • Thanks Martin! I now see that that it apparently cannot find MyProgram.exe. I will try to debug this now. Apparently the {app}don't point to the correct path. – Mc_Topaz Sep 29 '17 at 17:29

0 Answers0