How to Install IIS with NSIS? - iis

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'

Related

Open File during Installation

I am using NSIS to create installer. Also I need to install other program (I have his installation file). How add second installer to automatically run it during first installation?
The simplest is to run the file (which must be first extracted to some directory,. e.g. $TEMP) with
ExecShell "open" "$INSTDIR\app.exe"
or with
ExecWait '"$INSTDIR\someprogram.exe"' $0
if you want to wait for program to finish.
Also consider many possibilities: whether the app should be run with some parameter, in Silent mode or elevated with admin rights or run as original user...

How to disable an extra window to restart system even after selecting not to do so in files in use dialog in installshield

I am doing an upgrade for the existing exe file using installshield. when installing the update , in files in use dialog I select the option to automatically close and restart the application instead of the other option to reboot the system.
But I get an extra window which tells me to restart the system again after installation is complete. How to disable this window? Please help :)
You can try to run the installation silently with REBOOT=ReallySuppress (update the paths). Please note that I haven't had the chance to test all these command lines:
msiexec.exe /I "C:\IsWiX.msi" /QN /L*V "C:\msilog.log" REBOOT=ReallySuppress
/I is for install
/QN is silent mode
/L* is verbose logging
If you have an EXE file instead of an MSI file I would extract the MSI to an administrative image (file extract from setup.exe basically) using the following command:
setup.exe /a
Then specify an extract location for the files in the EXE file. You can also run it directly with the Installshield command lines for EXE files. Something like:
Setup.exe /v"REBOOT=ReallySuppress /qn"
Or silently with logging:
Setup.exe /v"/l*v c:\test.log REBOOT=ReallySuppress /qn"
There are also some simplified command line macros from Microsoft. Most of the time these can be used. Other times you need the full command line interface.

Execute another installer silently within your Nsis installer

I am trying to execute ffdshow.exe silently within my nsis installer but ffdshow doesnt seem to work with my method but MatroskaSplitter.exe and other installers have run silently with the same method.
File "..\Prerequisites\ffdshow_rev4515_20130612_clsid.exe"
ExecWait '"$INSTDIR\ffdshow_rev4515_20130612_clsid.exe" /S'
Are you sure ffdshow uses NSIS?
It looks to me like they are using Inno so you could try /silent or /sp- /silent /norestart.

How to install application as windows service using NSIS script?

I have written nsis script for my java project. I have successfully created a exe file using this nsis script. Final step of my installation process is installing my application as windows service using a batch file. I have installed successfully through command line using following code
"c:\program Files\program Files\test\bin\prunsrv.exe" //IS//servicename --Startup=auto --Jvm="Auto" --Classpath="%CLASSPATH%" --StartMode=jvm --StartClass=com.class.name --StartParams start --StopMode=jvm --StopClass=com.class.name --StopParams stop
same commands I have executed through nsis script is not working well. I have tried the following code
Exec '"$INSTDIR\bin\prunsrv.exe" //IS//servicename --Startup=auto --Jvm="Auto" --Classpath="%CLASSPATH%" --StartMode=jvm --StartClass=com.class.name --StartParams start --StopMode=jvm --StopClass=com.class.name --StopParams stop'
$INSTDIR refer to this directory c:\program Files\test.
Use ExpandEnvStrings to expand %classpath% before the exec...

Run uninstaller and wait until terminated

all/
There is app, installer for app is created by InstallShield (not msi project)
I need uninstall app and wait until uninstaller terminated.
I read registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{MyAppGuid}, UninstallString and try start uninstaller
in my case UninstallString = "C:\Program Files\InstallShield Installation Information{9F2A3D76-7785-492F-89E5-3F0FE2D205DC}\setup.exe" -runfromtemp -l0x0419 -removeonly
but in cmd.exe
"start /wait {UninstallerString}" don't wait until uninstaller terminated. I think uninstaller run same temp exe and terminated immediately. but then how can I resolve ny problem? Any idea??
Installshield added a /clone_wait switch at some point which solves your problem, as seen here:
This parameter indicates that the original setup should wait for the cloned setup process to complete before exiting.
Your uninstall string will look like this:
UninstallString = "C:\Program Files\...\setup.exe" -runfromtemp -l0x0419 -removeonly /clone_wait
-clone_wait will probably work too but I've tested and used it with /clone_wait.

Resources