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 **
'***********************************************************************************
FOLLOW US
Get the latest news in Application Packaging