grinay
Posts: 2
Joined: Wed Apr 24, 2019 11:43 am

Reboot after windows feature enabled

Hello. I need to reboot after windows feature is enabled. We deploying ASP.NET application to IIS by customaction code.
And sometimes we have the situation when features IIS doesn't active after installed via Advanced installer. But after reboot it becomes available. How to solve this kind of issue?
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Reboot after windows feature enabled

Hello Grinay and welcome to Advanced Installer forums,

In order to achieve this, you can create your own custom action which will restart the computer at the end of the installation. For instance, you can create a PowerShell script and then implement it in your project through a "Run PowerShellScriptInline" custom action. This custom action should be scheduled after the "Finish Execution" action group ("Install Execution Stage")

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
grinay
Posts: 2
Joined: Wed Apr 24, 2019 11:43 am

Re: Reboot after windows feature enabled

I don't need reboot it at the end of the installation. I need install Windows Feature and restart right after windows features was installed. Then on next stage my custom actions will deploy applications to IIS. As I said if we are installing everything at the same time IIS and then execute custom actions which installing application into IIS there quite often we have problem that IIS isn't fully activated, and deployment process fails. To overcome this we need to restart windows right after windows feature (IIS) was enabled.
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Reboot after windows feature enabled

Hello Grinay,

If that does not help, then you can try to schedule your custom action after the "AllocateRegistrySpace" standard action. To do so, go to "Custom Actions" page --> right click on "Remove resources" action group --> "Show Standard Action" --> "Remove Resources" --> "AllocateRegistrySpace" --> click on it. After doing so, you can schedule your custom action after that with its execution stage of "When the system is being modified (deferred)".

The "AI_WinOptFeaturesInstall" custom action is scheduled a bit before the "AllocateRegistrySpace" standard action, so the restart custom action must be scheduled after the "AllocateRegistrySpace" standard action.

However, you should test this on a virtual machine and see if this works.

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”