I am testing Advanced Installer 7.3. I am trying to add a vbs custom action to the uninstall section, but it fails with the following error message.

I tried both "attached custom action" and "installed custom action". For execution properties, execution options, scheduling options I use the default settings. I just point to the *.vbs file and leave the rest as is. My script intends to remove some folders during uninstall. I prefer to use a script for this task, because using RemoveFiles table would be very messy (deleting the contents of hundreds of subfolders) and I cannot find another msi solution. My script works the way it should when I run it but it fails when it is included in msi setup.
The script is as follows:
Code: Select all
Set WshShell = WScript.CreateObject("WScript.Shell")
Function DeleteTheFolder(folder)
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FolderExists(folder) Then
fso.DeleteFolder(folder)
End If
End Function
f_1 = "%WINDIR%\Sun"
f_2 = "%APPDATA%\Sun"
f_3 = "%USERPROFILE%\Local Settings\Application Data\Sun"
f_4 = "%USERPROFILE%\AppData\Local\Sun"
f_5 = "%USERPROFILE%\AppData\LocalLow\Sun"
t_1 = WshShell.ExpandEnvironmentStrings(f_1)
t_2 = WshShell.ExpandEnvironmentStrings(f_2)
t_3 = WshShell.ExpandEnvironmentStrings(f_3)
t_4 = WshShell.ExpandEnvironmentStrings(f_4)
t_5 = WshShell.ExpandEnvironmentStrings(f_5)
DeleteTheFolder(t_1)
DeleteTheFolder(t_2)
DeleteTheFolder(t_3)
DeleteTheFolder(t_4)
DeleteTheFolder(t_5)
FOLLOW US
Get the latest news in Application Packaging