vbs custom action - Advanced Installer Community
litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

vbs custom action

Hi,

I'm trying to run this code:

Code: Select all

Dim virtualDirectory 
virtualDirectory = "WebAPI"
Function changeURL()

	Dim url
	url = Session.Property("URL_USUARI")
	Dim urlPaths
	urlPaths = Split(url,"/")
	Dim arrCount
	arrCount = uBound(urlPaths) 
	Dim urlResults
	urlResults	= ""
	For x = 0 To arrCount
		if Not IsEmpty(urlResults) Then			
			If urlResults <> ""  Then
				urlResults = urlResults + "/"
			End If
		End If
		if x<arrCount Then
			urlResults = urlResults + urlPaths(x)
		else
			urlResults = urlResults + virtualDirectory
		End If		
    	
    Next
    'test MsgBox(urlResults)
	Session.Property("URL_USUARI") = urlResults
	changeURL = 1
    Exit Function

End Function
But, it keeps returning an error.
And the log says: " CustomAction LaunchFile returned actual error code -1 (note this may not be 100% accurate if translation happened inside sandbox)"

Any ideas?

Thanks,
Arnau.
litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Re: vbs custom action

Forget it.

The code works fine. The failing custom action was another one. (facepalm)

Kind regards,
Arnau.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: vbs custom action

Hi Arnau,

I'm glad you found the problem. Just let us know anytime you need help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”