VBS script return-code not affecting installation process - 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!

CarlEMac2008
Posts: 17
Joined: Tue Apr 29, 2008 7:12 pm

VBS script return-code not affecting installation process

Hi All,

This script is included in my AIP as an attached action. <InsertProgrammers> returns 0 if everything works out; 1 if it doesn't.

The install does not fail (as expected) when <InsertProgrammers> returns 1; what could be the trouble?

TIA,

Carl
//////////////// SCRIPT FOLLOWS ////////////////
' A linefeed/carriage-return combo.
CRLF = (Chr(13) & Chr(10))

Function InsertProgrammers
Dim Retval, PICKit2Done, RLinkDone, USBICPDone

PICKit2Done = False : RLinkDone = False : USBICPDone = False

Do While (True)
Retval = 1

If (AttachProgrammer(PICKit2Done, "PICKit2")) Then
If (AttachProgrammer(RLinkDone, "RLink")) Then
If (AttachProgrammer(USBICPDone, "USB-ICP")) Then
Retval = 0 : Exit Do
End If
End If
End If

If (Retval = 1) Then
If (ConfirmCancel() = 6) Then
Exit Do
End If
End If
Loop

InsertProgrammers = Retval
End Function

Function ConfirmCancel()
Dim sMsg

sMsg = ("Cancelling now will cancel the installation:" & CRLF & _
"Do you want to cancel the installation?")

ConfirmCancel = MsgBox(sMsg, 4+64, "Cancel Insert Programmers")
End Function

Function AttachProgrammer(ByRef bDoneAlready, sProgName)
Dim sMsg

If (Not bDoneAlready) Then
sMsg = ("1) Insert the " & sProgName & " Programmer into a USB connector." & CRLF & _
"2) Allow Window's to update the device's USB driver(s)." & CRLF & _
"3) Once Window's has updated the USB driver(s), remove" & CRLF & _
" the programmer from the USB connector and select the <OK> button.")

bDoneAlready = (MsgBox(sMsg, 1+32, "Insert " & sProgName & " Programmer") = 1)
End If

AttachProgrammer = bDoneAlready
End Function
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: VBS script return-code not affecting installation process

Hi,

This behavior may be encountered if Windows Installer doesn't check the return code of the custom action. Can you please send us the AIP you are using to support at advancedinstaller dot com so we can investigate it?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”