When use the following sample script in help file of AI removing a folder at use updater to update a program, an error that not enough permissions is occurred. This is a bug of updater?
Execution Options: Deferred with no impersonation
Action Sequence: Install
regards,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
Zhang Shangyi