0

I want to open an administrative CMD window using Inno Setup and want to install:

nssm install metabase

I tried the following function, but it doesn't work.

Exec(ExpandConstant('{cmd}'), ' nssm install', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);

Please someone help me. Thank you in advance.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
msc
  • 33,420
  • 29
  • 119
  • 214

1 Answers1

2

You are effectively executing:

cmd nssm install

That wouldn't work anywhere, not only in Inno Setup. It should be:

cmd /c nssm install

Though, it's an overkill to run nssm via cmd. Run it directly:

nssm install

In Inno Setup Pascal Script:

Exec('nssm', 'install', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992