jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Script Required Could Not Be Run

I have a script that delete the folder as follows:

Code: Select all

Public Sub DeleteDBScripts
On Error Resume Next	
		Dim count, path, objFSO, objFolder
		count =Len (Session.Property ("DB_SCRIPT_DIRECTORY"))
		path =Left (Session.Property ("DB_SCRIPT_DIRECTORY"), count -1)
		Set objFSO = CreateObject ("Scripting.FileSystemObject")
		
		If objFSO.FolderExists(path) Then
			objFSO.DeleteFolder path, True
		End If
		
		Set objFSO = Nothing
End Sub
It runs fine on my development machine, but when I distribute it to my colleagues they received the "script required could not be run" error. I do not quite understand this behavior. I am running the MSI by double-clicking it not from the IDE.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Script Required Could Not Be Run

Hello,

Not sure why the custom action fails but you can try to debug it and see what's going on. Maybe it doesn't have privileges to delete the specified folder. The user guide related custom action FAQs may help.

We have predefined support for deleting folders in the Files and Folders page: Why use a custom action?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jmace
Posts: 55
Joined: Thu Jul 01, 2010 4:46 pm

Re: Script Required Could Not Be Run

We have two options on our installer, 1) Extract the website files and set up the database, 2) Extract the website files and SQL files for installing the database manually. If they choose option 1, the SQL scripts are still being installed in a folder. Consequently, I was hoping we could use a Install Finalize a custom action to delete SQL scripts folder. Like I said, it works locally, but if I ship it off to my colleague they get the error.

Return to “Common Problems”