'Inno Setup cannot launch .exe in System32
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?
Solution 1:[1]
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; ...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
