Hello,
I am relatively new to advanced installer. I am trying to run a vb script that will delete certain files from the results of a file search.
Reading up on your forum I have avoided the common pitfalls:
-- I use: pathToFile = Session.Property("SEARCH_RES_1")
-- Setting the vb script custom action to run with immediate execution
The path always return a blank line when addressing the search result. I have tried using other session properties such as "APPDIR" and I can read these fine. Just not search results.
My code is:
Function removeFiles()
Dim pathToFile
Set objFS = CreateObject("Scripting.FileSystemObject")
pathToFile = Session.Property("SEARCH_RES_1")
If (objFS.FileExists(pathToFile)) then
objFS.DeleteFile pathToFile, true
End if
End Function
My second problem is what to do if the search result locates more than one instance of the same file? How do I address each result individually and hence delete each instance of the same file?
Looking on the forum I have read similar posts which are pointed to other examples which seem to incorporate a session database, however they do not seem to address search results.
Thanks for any help,
Sam.
FOLLOW US
Get the latest news in Application Packaging