I create my setup application using installshield.

It ask user to select virtual directory. If user select virtual directory outside "default web site" then uninstall function doesn't delete virtual directory outside "default web site".


Here is my code to uninstall application

set objIISRoot = CoGetObject("IIS://localhost/W3SVC/" + svWebSiteID + "/Root", "");
if IsObject( objIISRoot ) then
try
objIISRoot.Delete("IISWebVirtualDir", szVirDirName);
catch
strError = "Unable to Delete Virual Directory";
MessageBox("Unable to Delete Virual Directory \""+ szVirDirPath +"\".", SEVERE);
endcatch;
else
strError = "Could not get the virtual directory object.";
endif;