traveler3468
traveler3468

Reputation: 1656

Run File One After The Other

I'm trying to install a couple executable files from the run section within an inno setup file.

My File Section looks like this.

[Run]
#if GNTCChecked == "True"

  Filename: "{tmp}\Utilities\SDK\setup.exe"; Description: "Install Foo"; Flags: nowait postinstall shellexec

  Filename: "{tmp}\Utilities\SDK\foobar.exe"; Description: "Install Foo Update"; 
  Flags: nowait postinstall shellexec

#endif

The 1st file needs to be installed in order for 2nd file to install.

Basically if the first file is not installed, the 2nd will throw an error explaining that the core files are not on the system and therefore cant be installed.

At the moment, the first file is executing, and the 2nd one straight after it before the 1st one has completed installing.

Upvotes: 1

Views: 2741

Answers (1)

traveler3468
traveler3468

Reputation: 1656

Here is what I had to do in order to execute one file after the other only when the first task had completed.

[Run]
#if GNTCChecked == "True"

Filename: "{tmp}\Utilities\SDK\setup.exe"; Description: "Install Foo"; 
Flags: postinstall shellexec waituntilterminated

Filename: "{tmp}\Utilities\SDK\foobar.exe"; Description: "Install Foo Update"; 
Flags: postinstall

#endif

Here was the information that I read that lead me to the answer.

shellexec This flag is required if Filename is not a directly executable file (an .exe or .com file). When this flag is set, Filename can be a folder or any registered file type -- including .chm, .doc, and so on. The file will be opened with the application associated with the file type on the user's system, the same way it would be if the user double-clicked the file in Explorer.

By default, when the shellexec flag is used it will not wait until the spawned process terminates. If you need that, you must add the flag waituntilterminated. Note that it cannot and will not wait if a new process isn't spawned -- for example, if Filename specifies a folder.

Upvotes: 2

Related Questions