Search code examples
installshieldinstallshield-2011

How do I remove IIS based components from InstallShield in an upgrade?


In trying to create a major upgrade existing web applications with InstallShield as suggested here I have created a new application pool, but can't create a new IIS application. However while the new install creates the new pool, it doesn't change the existing virtual directory to use the new pool. The logs say virtual directory already exists and leaves it at that.

Is it possible to get the install to change an existing component, or simply how do I delete the virtual directory component since the remove files table expects a directory?

Thanks


Solution

  • Ended up achieving this by

    1. Created a Property called WEBSITENAME with the value of the website name from the String Editor table (this is for reuse)
    2. Created a VBscript custom action, to run after RemoveFolders with the following condition: IIS_VERSION <= "#6" and NOT INSTALLED

    The code is:

    Dim objWebServer
    Dim objVirtualDir
    Dim strAppName
    Dim intASPSessionTimeout
    Dim SubVirtDir
    On Error Resume Next
        CreateApplication = ERROR_SUCCESS
        strAppName = Session.Property("WEBSITENAME")    
        SubVirtDir = "/" + strAppName
        intASPSessionTimeout = 120
        Set objWebServer = GetObject("IIS://localhost/W3SVC/1/Root")
        'Delete the Virtual subdirectory
        Set objVirtualDir = objWebServer.Delete("IISWebVirtualDir", SubVirtDir) 
        Set objVirtualDir = objWebServer.Delete("IISWebVirtualDir", strAppName) 
    

    This does what I needed to do. Now I need to figure out a similar way to conditionally Enable32bitAppOnWin64!