3

I'm using Inno Setup, and I need to install a third-party driver. Everything is OK, except that this third-party installation program asks to restart the machine, before my installation script terminate.

Example: I need to install two drivers, the second need the first installed, but the first driver needs to restart the machine.

[Run]

Filename: "FirstDriver.msi"; Flags: shellexec waituntilterminated; 
Filename: "SecondDriver.msi"; Flags: shellexec waituntilterminated; 

I'd like to restart only my installation is complete. How can I do it?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • 6
    Unless the third-party installers accept command-line arguments to avoid requiring the machine to be restarted, I'm afraid there is nothing you can do about this. – Bernard Oct 17 '12 at 18:54
  • Hum... I did it in command line : `msiexec /package "FirstDriver.msi" /qf /norestart`, but I wasn't sucessfull when I try it with Inno Setup. – Guilherme de Jesus Santos Oct 17 '12 at 19:21
  • I tried it in Run section: `Filename: "msiexec.exe"; Parameters: "/package ""{app}\FirstDriver.msi"" /qf /norestart "; Flags: shellexec waituntilterminated;` – Guilherme de Jesus Santos Oct 17 '12 at 19:23
  • But it seems [`it should work`](http://msdn.microsoft.com/en-us/library/windows/desktop/aa372024(v=vs.85).aspx). – TLama Oct 17 '12 at 19:38
  • 1
    @TLama due to the complexity of MSI packages (especially custom actions created by everyone), a general approach such as adding `/norestart` won't work every time. – Lex Li Oct 18 '12 at 03:25

2 Answers2

3

The solution that worked for me was:

Filename: "{sys}\msiexec.exe"; Parameters: "/package ""{app}\FirstDriver.msi"" /qn /norestart /passive"; Flags: shellexec waituntilterminated; Check: not Is64BitInstallMode; StatusMsg: "Installing my First Driver";

I needed to specify that directory of msiexec.exe to work, using the constant {sys}, to get msiexec.exe from System folder.

1

Try calling the third-party installers with the /norestart command-line argument:

[Run]

Filename: "FirstDriver.msi"; Parameters: /norestart; Flags: shellexec waituntilterminated; 
Filename: "SecondDriver.msi"; Parameters: /norestart; Flags: shellexec waituntilterminated;

Edit

See this question for more details.

Community
  • 1
  • 1
Bernard
  • 7,908
  • 2
  • 36
  • 33
  • You can't always pass parameters when using `ShellExecute()` to run a non executable. It may not get translated when the final command is created or if it uses DDE to talk to an existing process. – Deanna Jun 04 '13 at 08:15