This above forum provided me with a lot to work with, however when I uninstall, the program is still fatal erroring and will not complete the uninstallation.
My script is designed to remove the installation direction, and then remove the folder above the installation directory. For example, in the case of
"Program Files / company-name / program-name "
I would want the script to uninstall the program-name folder first, and then if the company-name folder is empty, uninstall it next.
Currently, this is what my script looks like.
Code: Select all
Function removeInstallDir()
Dim pathToFolder, smallPath
Set objFS = CreateObject("Scripting.FileSystemObject")
pathToFolder = Session.property("APPDIR")
smallPath=Left(pathToFolder,Len(pathToFolder)-1)
If (objFS.FolderExists(smallPath)) then
objFS.DeleteFolder smallPath, true
End if
If Right(smallPath, 1) = "\" Then smallPath = Mid(smallPath, 1, Len(smallPath) - 1)
smallPath = Mid(smallPath, 1, InStrRev(smallPath, "\") - 1)
If ((objFS.GetFolder(smallPath).Files.Count = 0) & (objFS.getFolder(smallpPath).Folders.Count = 0)) then
objFS.DeleteFolder smallPath, true
End if
End Function
The steps to add it to the advanced installer project are as follows.
Custom Actions -> Add RemoveFolders -> Under RemoveFolders, Add Attached Custom Action -> set Function Name to removeInstallDir -> Add ExecuteCondition (Remove="ALL").
Is there any step I am missing?
Thanks
Jon
FOLLOW US
Get the latest news in Application Packaging