During the installation process selected the directory as C:/Test/ (root path for the installation location) for installing my application. It installed successfully in this location (C:/Test/). Uninstalled this package, it is removed all installed files and subdirectories. But not removed the installed root directory (i.e. C:/Test). below custom action is using to delete/remove the installation root path and installation files (with subdirectories).
<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
<Custom Action="ApplicationInstallDir" After="AppSearch">APPINSTALLDIR</Custom>
<Custom Action="DeleteInstallDir" Before="RemoveFiles" >
REMOVE="ALL"
</Custom>
</InstallExecuteSequence>
<CustomAction Id="DeleteInstallDir" BinaryKey="CommandPrompt"
ExeCommand="cmd /C pushd "[APPINSTALLDIR]" && (rd /s /q "[APPINSTALLDIR]" 2>nul & popd)" Execute="deferred" Return="ignore" HideTarget="no" Impersonate="no" />