Install IIS with Inno Setup

3

I'm trying install IIS with Inno Setup, but I'm getting various errors.

I tried command on DOS and works:

start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-ManagementService;IIS-CGI;IIS-RequestFiltering;IIS-ASPNET;IIS-HttpLogging;IIS-NetFxExtensibility;IIS-HttpErrors;IIS-DefaultDocument;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-StaticContent;IIS-ManagementConsole;IIS-DirectoryBrowsing;IIS-WindowsAuthentication;IIS-WebServer;

I tried use this in Inno Setup:

Filename: pkgmgr; Parameters: "/iu:IIS-WebServerRole; IIS-WebServer: ; IIS-CommonHttpFeatures: ; IIS-ManagementService: ; IIS-CGI: ; IIS-RequestFiltering: ; IIS-ASPNET: ; IIS-HttpLogging: ; IIS-NetFxExtensibility: ; IIS-HttpErrors: ; IIS-DefaultDocument: ; IIS-ISAPIExtensions: ; IIS-ISAPIFilter: ; IIS-StaticContent: ; IIS-ManagementConsole: ; IIS-DirectoryBrowsing: ; IIS-WindowsAuthentication: ; IIS-WebServer: ; "

But it shows error

Operation failed with 0x80070057 The parameter is incorrect

After I tried:

Filename: pkgmgr; Parameters: "/iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-ManagementService;IIS-CGI;IIS-RequestFiltering;IIS-ASPNET;IIS-HttpLogging;IIS-NetFxExtensibility;IIS-HttpErrors;IIS-DefaultDocument;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-StaticContent;IIS-ManagementConsole;IIS-DirectoryBrowsing;IIS-WindowsAuthentication;IIS-WebServer;";

But shows error

Operation failed with 0x8007000B An attempt was made to load a program with an incorrect format

Thank for helps.

windows
iis
inno-setup
asked on Stack Overflow Oct 21, 2015 by Robertopcn • edited Oct 22, 2015 by Martin Prikryl

1 Answer

3

Your first syntax simply uses a wrong format of the arguments (clearly different to what works for you on command-line).


A problem with the second syntax is probably that you run the installer on 64-bit Windows. The Inno Setup installer is 32-bit application, so it will by default find 32-bit version of pkgmgr (C:\Windows\SysWOW64\PkgMgr.exe), which cannot install 64-bit IIS.

For details read about File System Redirector.

Add Flags: 64bit to make Inno Setup find 64-bit version of pkgmgr (C:\Windows\System32\PkgMgr.exe).

[Run]
Filename: pkgmgr; \
    Parameters: "/iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-ManagementService;IIS-CGI;IIS-RequestFiltering;IIS-ASPNET;IIS-HttpLogging;IIS-NetFxExtensibility;IIS-HttpErrors;IIS-DefaultDocument;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-StaticContent;IIS-ManagementConsole;IIS-DirectoryBrowsing;IIS-WindowsAuthentication;IIS-WebServer"; \
    Flags: 64bit

To enable installation on both 32-bit and 64-bit versions of Windows, you need to have two entries in [Run] section, one for 32-bit and one for 64-bit and select the correct one using Check: not IsWin64 and Check: IsWin64 respectively.

[Run]
Filename: pkgmgr; \
    Parameters: "..."; \
    Check: not IsWin64
Filename: pkgmgr; \
    Parameters: "..."; \
    Flags: 64bit; Check: IsWin64

Or use 64-bit install mode.

It will make Inno Setup find a correct version of pkgmgr automatically.

answered on Stack Overflow Oct 22, 2015 by Martin Prikryl • edited Mar 7, 2020 by Martin Prikryl

User contributions licensed under CC BY-SA 3.0