Alt255,
I received errors at the File Open and Close statements in your following code:
----------------------------------------------
' This is the name of your program.
MyExe$ = "PigiBack.exe"
' You would probably use...
' App.ExeName & ".EXE" instead.
F1 = FreeFile
Open MyExe$ For Binary As #F1
Get #F1, LOF(F1) - 3, Test&
' Check to see if the last 4 bytes of the EXE
' contain a file size.
If Test& > 0 Then
Close #F1
MsgBox "File has already been piggybacked."
Exit Sub
End If
' Read the contents of the program files
' and appendf them to your app EXE.
For Rep = 0 To UBound(EXEinfo)
With EXEinfo(Rep)
f2 = FreeFile
Open .EXEname For Binary As #f2
G$ = String$(LOF(f2), 0)
.FileSize = Len(G$)
Get #f2, 1, G$
Close #f2
.StartByte = LOF(F1) + 1
Put #F1, , G$
End With
Next
' Write the file information
' records at the end of the EXE.
For Rep = 0 To UBound(EXEinfo)
Put #F1, , EXEinfo(Rep)
Next
Close #F1
End Sub
Private Sub ExtractExes_Click()
' This sub just retrieves the stored
' program names and places them in
' a list box.
MyExe$ = "PigiBack.exe"
F1 = FreeFile
Open MyExe$ For Binary As #F1
Get #F1, LOF(F1) - 3, Test&
' Check to see if the last 4 bytes of the EXE
' contain a file size.
If Test& = 0 Then
Close #F1
MsgBox "File has not been piggybacked yet."
Exit Sub
End If
RecSize = Len(EXEinfo(0))
' Get the file information records.
For Rep = 0 To UBound(EXEinfo)
Get #F1, LOF(F1) - (RecSize * (Rep + 1)) + 1, EXEinfo(Rep)
List1.AddItem EXEinfo(Rep).EXEname
Next
Close #F1
End Sub
----------------------------------------------
How can I contact you via email to proceed with this program. There is always a new solution for the same problem.
Anonymous