cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nunocenteio
Level 3

Not removing IIS Application on uninstall

Hi guys,

I've created an InstallShield setup with several features. In "Internet Information Services" I've added a site called "Default Web Site" (because, for now, I want to install my application in the IIS default web site) which has the following properties:
Component: WebSiteComponent
Delete on Uninstall: Yes
Content Source Path = [IISROOTFOLDER]

I've added a Application to that site.

When installing, the Application is created, the files are copied and everything is working.


MSI (s) (54:08) [08:27:07:820]: Component: WebsiteComponent; Installed: Absent; Request: Local; Action: Local
Action 08:27:11: Progress Custom Action. Creating IIS website Default Web Site
(...)


When uninstall it seems that the web Application is forgotten 😞


MSI (s) (54:3C) [08:27:45:855]: Component: WebsiteComponent; Installed: Local; Request: Absent; Action: Null
(...)
MSI (s) (54:3C) [08:27:47:233]: Executing op: ActionStart(Name=ISIISUninstall,,)
Action 08:27:47: ISIISUninstall.
MSI (s) (54:3C) [08:27:47:234]: Executing op: CustomActionSchedule(Action=ISIISUninstall,ActionType=3073,Source=BinaryData,Target=ISIISUninstall,CustomActionData=C:\Users\NB15664\AppData\Local\Temp\IIS8953.tmp)
MSI (s) (54:00) [08:27:47:284]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI8D34.tmp, Entrypoint: ISIISUninstall
MSI (s) (54:40) [08:27:47:284]: Generating random cookie.
MSI (s) (54:40) [08:27:47:285]: Created Custom Action Server with PID 6236 (0x185C).
MSI (s) (54:1C) [08:27:47:305]: Running as a service.
MSI (s) (54:1C) [08:27:47:306]: Hello, I'm your 32bit Elevated custom action server.
InstallShield 08:27:47: User legacy object preference is the following: . This is based on the value of the following property: IISPREFERLEGACYOBJECTS
InstallShield 08:27:47: InitIISObject
InstallShield 08:27:47: Legacy objects are supported
InstallShield 08:27:47: RemoveAll
Action 08:27:47: Progress Custom Action.
Action 08:27:47: Progress Custom Action.
Action 08:27:47: Progress Custom Action.
Action 08:27:47: Progress Custom Action.
InstallShield 08:27:47: RemoveAppPool for MyApplicationPool
Action 08:27:47: Progress Custom Action. Removing application pool
InstallShield 08:27:47: RemoveAppPoolFunction
InstallShield 08:27:47: GetAdminSection for section 'system.applicationHost/applicationPools' and path 'MACHINE/WEBROOT/APPHOST' and commitpath 'MACHINE/WEBROOT/APPHOST'.
InstallShield 08:27:47: Found element with property 'name' value of: MyApplicationPool
InstallShield 08:27:47: Removing apppool
InstallShield 08:27:47: CommitChanges for path 'MACHINE/WEBROOT/APPHOST' and physical path 'C:\Windows\system32\inetsrv\config\'.
(...)


I think the problem is on the "Action: Null".

Any hint?

Thanks
Labels (1)
0 Kudos

(1) Reply
SimonG
Level 5

I had this problem too. I wrote a c# assembly to do all the things that InstallShield was useless at, including deleting a web application, for which here is the code (which I call from InstallScript)...

[CODE]
[ComVisible(true)]
public bool DeleteWebApplication(string webSite, string webApplication, ref string errorMsg)
{
// The result.
bool result = false;

try
{
// Get the server manager.
ServerManager sm = new ServerManager();

// Find the virtual directory.
Site site = sm.Sites[webSite]; // "Default Web Site"
Application app = site.Applications[string.Format("/{0}", webApplication)]; // "iManager"

if (app != null)
{
// It does exist, let's delete it.
site.Applications.Remove(app);
sm.CommitChanges();
}

// Success.
result = true;
}
catch (Exception ex)
{
// Failure to get property, fill in the error message.
errorMsg = ex.Message;
}

return result;
}[/CODE]
0 Kudos