12

I now understand that "Inno Setup can execute command line tools for you without utilizing batch file." (Can Inno Setup install set up a Windows security group?) It makes sense that it would be able to do that. From my web searches into Inno Setup thus far, I can not find an starting place to understand how to do this. A complete answer may not be necessary, if I just had some further hint as to what to look for, that would probably be good enough.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
amalgamate
  • 2,200
  • 5
  • 22
  • 44

1 Answers1

25

It was meant that you don't need to create and execute a batch script (with a single command), nor execute the tool through the command prompt (like shown below):

Exec('cmd.exe', '/c "net localgroup ..."', '', SW_SHOW, ewWaitUntilTerminated, Result);

But you directly execute the tool instead:

Exec('net.exe', 'localgroup ...', '', SW_SHOW, ewWaitUntilTerminated, Result);

The same applies to the [Run] section:

[Run]
Filename: "{cmd}"; Parameters: "/c ""net localgroup ..."""

Better would be this:

[Run]
Filename: "net.exe"; Parameters: "localgroup ..."
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
TLama
  • 75,147
  • 17
  • 214
  • 392
  • 3
    A link to the Exec help page: http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_exec – amalgamate Jan 20 '15 at 19:23
  • 1
    I would like to emphasize that the /c switch is needed for s cmd.exe command, for example: [Run] Filename: "cmd.exe"; Parameters: "/c echo {app} & pause"; – JohnP2 Mar 30 '18 at 22:19
  • How do I execute a command that use double quotes, example: cd “c:\ my folder with spaces” – Marcelo Gazzola Jan 16 '20 at 01:32