The following issue was found in version 17.6 of Advanced Installer and appears to be reproducing also in version 20.3.2.
The "Preserve IIS customizations" option set to "Always" appears to destroy an application pool after an upgrade from 1.0 to a 2.0 software.
Scenario:
You have a project "A" version 1 with an IIS application pool "A".
You have a project "B" version 1 with an IIS application pool "B".
Both projects are installed on a computer.
You prepare the next version of the project A, version 2.0, which will now contains all application B.
You modify the project A to set the version 2.0 and update the product code.
So you modify project A and add the folder and application pool for "B".
You modify the project A to detect and remove project "B" on the computer.
You configured the "Preserve IIS customizations" option to "Always".
When deploying version 2 of the application A:
The installer automatically removes Application Pool A, then removes Application pool B as expected.
Then it creates application pool A and B, but destroys the application pool "A" before finalizing the installation.
Result, the application "A" no longer works.
The issue doesn't seems to reproduces if the option "Preserve IIS customizations" is set to "Never".
See attached sample projects created to reproduce the issue in Advanced Installer 17.6 and upgraded in 20.3.2.