I am using Trail version of Advanced Installer 3.6. I have some dll that has to be installed in winnt directory but for this IIS should be stopped. Previously we worked with Install Shiled there we manually wrote a script for stopping the iis. The command to stop the iis is iisreset /stop. So from advanced installer how can this be achieved. I mean before installing the the package we need execute this command and after finishing installation this command should be executed iisreset /start.
This can be done by combining a File Search with 2 Property Source Custom Actions
(one to stop and the other to start IIS).
These are the steps you should follow:
1. In the Search page, create a new File Search for "iisreset.exe". Set the name of
the property that will hold the result of the search to "IISRESET". Set the Location
to "[SystemFolder]" (without quotes) with a depth of 0. You can also use the Search
wizard available in the latest version of Advanced Installer (Wizard -> Search).
2. In the Custom Actions page create a new Property Source Custom Action scheduled on
the "InstallInitialize" stage. This Custom Action will be used to stop the server.
Set the following properties for it:
- Property Name: IISRESET
- Command Line : /stop /timeout:10
- Immediate Execution
- Execution Condition: (Not Installed)
3. Create another Property Source Custom Actions scheduled on the InstallIIS stage,
which will be used to start the server at the end of the installation. Set the
following properties for it:
- Property Name: IISRESET
- Command Line : /start
- Deferred Execution
- Execution Condition: (Not Installed)
As an alternative to step 1, you could also use a Property Set with Formatted Custom Action scheduled on the "InstallInitialize" stage (for example), but before the Custom Action that is used to stop IIS. Set the following properties for this Custom Action:
- Property Name: IISRESET
- Formatted Text: [SystemFolder]iisreset.exe
This should be more efficient than performing a File Search.