Fails to run vbs-script - uninstall - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

pmuller99
Posts: 2
Joined: Thu Jan 19, 2012 9:56 pm

Fails to run vbs-script - uninstall

Hi

I've created a custom action to be executed when uninstalling. Action is set as first action after "Paths resolution".

I got following error when uninstalling: "There is a problem .. . A script required for this install could not be run. ..."

User account has admin privil.

Scipts is set to sync execution - check return code

Scripts is 32-bit - code inserted below.

Please advice.

Regards
Peter

PS: By the way - nice gui in version 9 concerning custom action.



'***********************************************************************************
'** Configuration Parameters **
'***********************************************************************************
cPreJobName = "UpdateOutlookSignature"
cLeadJobTxt = "Opgavenavn: \"

'***********************************************************************************
'** Execution **
'***********************************************************************************

' Find Schedule Tasks To Be Deleted
Dim arrJobToBeDeleted(), i, objShell, objExec, nLenPreJobName, nLenLeadJobTxt
nLenLeadJobTxt = Len(cLeadJobTxt)
nLenPreJobName = Len(cPreJobName)+ nLenLeadJobTxt
i = 0
ReDim arrJobToBeDeleted(i)
arrJobToBeDeleted(i) = "JobName"
i = 1
Set objShell = CreateObject("Wscript.Shell")
Set objExec = objShell.Exec("Schtasks.exe /Query /FO List")
Do Until objExec.StdOut.AtEndOfStream
strLine = objExec.StdOut.ReadLine
If Left(strLine,nLenLeadJobTxt) = cLeadJobTxt Then
If Replace(Left(strLine,nLenPreJobName),Left(strLine,nLenLeadJobTxt),"") = cPreJobName Then
ReDim Preserve arrJobToBeDeleted(i)
arrJobToBeDeleted(i)= Replace(strLine,Left(strLine,nLenLeadJobTxt),"")
i = i + 1
End If
End If
Loop
Set objExec = Nothing

' Delete Schedule Task
If UBound(arrJobToBeDeleted) > 0 Then
For i = 1 To UBound(arrJobToBeDeleted)
DeleteScheduleTask(arrJobToBeDeleted(i))
Next
End If

Function DeleteScheduleTask(strTaskName)
Set objExec = objShell.Exec("Schtasks.exe /Delete /TN " & strTaskName & " /F")
Set objExec = Nothing
End Function

Set i = Nothing
Set strPreJobName = Nothing
Set objShell = Nothing
Set nLenPreJobName = Nothing
Set nLenLeadJobTxt = Nothing
Erase arrJobToBeDeleted
'***********************************************************************************
'** End **
'***********************************************************************************
CiprianComsa
Posts: 110
Joined: Thu Aug 19, 2010 10:11 am
Contact: Website

Re: Fails to run vbs-script - uninstall

Hi Peter,

Thank you for your appreciation about the custom actions view.

Unfortunately, our support boundaries do not cover debugging or creating custom actions.
To debug a VBScript custom action, you should use MsgBox occurrences.
Can you please send aip project to support at advancedinstaller dot com so we can analyze your project settings?

Regards,
Ciprian
__________________________________________________________________________________________________________________________________________________
Ciprian Comsa
Advanced Installer Team
http://www.advancedinstaller.com/
Ciprian Comsa - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”