-1

I'm using Inno Setup to make an installer for my program. I would like to run IIS Manager after installation. So, I'm using this code:

[Tasks]
Name: StartAfterInstall; Description: Run IIS after install;

[Run]
Filename: "C:\WINDOWS\system32\inetsrv\InetMgr.exe"; \
    Description: "launching IIS prova"; \
    Flags: postinstall nowait skipifsilent; Tasks: StartAfterInstall;

This should open IIS manager, but it doesn't work, returning me this error:

Could not execute file C:\WINDOWS\system32\inetsrv\InetMgr.exe
CreateProcessor failed, code 2 , file not found"

Using same code, but running other .exe file in a different path works. Does this depend on this specific path: C:\WINDOWS\system32\inetsrv?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
mr.XOX
  • 11
  • 2

1 Answers1

3

There's probably only 64-bit version of the InetMgr.exe.

As Inno Setup in a 32-bit application, it by default gets redirected to C:\Windows\SysWOW64 (32-bit version of C:\Windows\System32). If there's no 32-bit version of InetMgr.exe in the C:\Windows\SysWOW64, Inno Setup cannot find it.

Add the Flags: 64bit to make Inno Setup find 64-bit version of the the InetMgr.exe.

Or use the 64-bit install mode.


Side note: Do not hard-code C:\Windows\System32, as that path can be different on some systems. Use {sys} constant.


[Run]
Filename: "{sys}\inetsrv\InetMgr.exe"; Flags: 64bit; ...
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992