1

We are building an installer that enables Internet Information Services (IIS) and installs .NET 6 hosting bundle in a windows 10 machine. We are using Advanced installer to build our installer.

We are facing a problem if the host machine already has a higher version of .NET hosting bundle installed e.g. version 6.0.9. And if our installer tries installing a lower version of .NET hosting bundle e.g. 6.0.4, it gets canceled because a higher version is already installed on that machine. From this documentation, we found that we need to install/repair .NET hosting bundle after the installation of Internet Information Services (IIS) otherwise Internet Information Services won't work. Because the installation of 6.0.4 is getting canceled, IIS is not working. enter image description here

Our approach: what we want to do is if version 6.0.4 gets canceled because of a higher version of the .NET hosting bundle. We want to repair the existing 6.0.9 version installed on the host machine.

How can we repair a higher version of .NET hosting bundle installed on the host machine without knowing the location of the .NET hosting bundle .exe file?

Please also suggest if there is a better alternative approach to resolve the issue.

asif0012
  • 31
  • 2
  • 1
    Shouldn't you just not install 6.0.4 if you find a higher version? – rene Oct 22 '22 at 19:58
  • @rene Yes, we don't install version 6.0.4. But because version 6.0.9 is installed before the installation of IIS, IIS doesn't work. For IIS to work, we need to repair 6.0.9 version. We can do it manually from the **Add or Remove programs** window. But we want to automate this process from the installer. So that after installation user can use the application without any issues. – asif0012 Oct 23 '22 at 06:10
  • Do you mean you want a way to specify the order of installation? Enable IIS before installing the .NET hosting bundle. – YurongDai Oct 24 '22 at 08:22
  • Typically, you can specify the order in which prerequisites are installed. Pre-installation prerequisites and Windows features are configured at completely different points in time. – YurongDai Oct 26 '22 at 08:21

2 Answers2

0

As @YurongDai said, most likely this can be achieved through a Custom Action. You can schedule this custom action to run towards the end of the installation, after the prerequisite was installed. In addition to this, you should run the custom action asynchronously, since two installation processes can not be run at the same time (i.e. your installation and the repair process of the prerequisite).

CMk
  • 81
  • 2
0

The solution here is to use the IIS-enabled custom action before installing the ".NET Core IIS Hosting" prerequisite. For example, you can add a custom action as a non-sequential custom action (so it can be triggered from a UI control) and then schedule it on the "Dialogs" page --> "Preinstall UI" --> "WelcomePrereqDlg" dialog --> "Next" button.

This will enable IIS before installing the prerequisites. But the process must be run as an administrator to enable IIS functionality.

YurongDai
  • 1,362
  • 1
  • 2
  • 7