I am building an installer which installs and configures iis and php.
My iis-install.bat file:
Start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-Security;IIS-RequestFiltering;IIS-HttpCompressionStatic;IIS-WebServerManagementTools;IIS-ManagementConsole;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-CGI
My setup.nsi:
Section -iis_installation
installIIS:
;MessageBox MB_YESNO "Allow To Install IIS?" /SD IDYES IDNO permissionModifier
File "iis-install.bat"
nsExec::Exec "iis-install.bat"
endInstall:
SectionEnd
Both the bat file and setup.nsi are in same folder.
Problem: When i compile and run the setup.exe file it will giv an error as below:
"atempt was made to load the progrom in an incorrect format"
And other batch files run properly with nsis except iis-install.bat why?
Please help to solve the issue or suggest any other idea to install iis with nsis.
Why use a batch file if it only contains a single command? And the wait parameter for start is /WAIT not /w!
Try nsExec::Exec '"c:\full\path\to\pkgmgr.exe" /iu:IIS-WebServerRole;...;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-CGI'