I created the installer to install the application in the "WIndowsVolume", and also provided option for the user to select his installation folder.
If I dont change the installtion folder, and choose the default WindowsVolume for installing the application, modify some files and uninstall it, The whole installed folder and the files that were changed after installtion are removed.
But if I change the installation folder, install the app, modify some files and uninstall it, the files I changed are not removed and still remain in the choosed installation folder.
I used the following script and associated with "RemoveFolders" Custom Actions with Execution Condition expression as (Remove="ALL")
Code: Select all
Function removeFolders()
custActData = Session.Property("CustomActionData")
foldersArray = Split(custActData, "|", -1)
Set objFS = CreateObject("Scripting.FileSystemObject")
For Each folder In foldersArray
smallPath = RemoveTrailingBackslash(folder)
If (objFS.FolderExists(smallPath)) Then
objFS.DeleteFolder smallPath, true
End if
Next
End Function
Function RemoveTrailingBackslash(folderPath)
If Right(folderPath, 1) = "\" Then
RemoveTrailingBackslash = Left(folderPath, Len(folderPath) - 1)
Else
RemoveTrailingBackslash = folderPath
End If
End Function
Am using Advanced Installer v6.9.1
Madan N