As I haven't changed anything today to this code, I guess there isn't =
really anything to change to it :-) It's the initial loader with as less =
code as possible (because we want to handle as much as possible in =
dynamically updatable, loadable and unloadable modules)
The module shows a splashscreen at start, checks for the existence of =
the core API and the update module; runs the update module, exits =
afterwards if beeing told or else loads the core API. I've localised it =
too so it shows up a readable errormessage in other languages too (if =
localisation data is available, else it shows the hard-coded default =
message on error).
---[ Module : modLoader.BAS =
]-------------------------------------------------------------
'------------------------------------------------------------------------=
-------------
' CodeBlue/IM Modular Loader v1.0
'
' Date Coder Description
' =3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
' 02-14-04 Wimz Initial Creation
'
'
'
' Modular loader for CodeBlue/IM
'
' Checks for updates of the CodeBlue/IM components at startup, downloads =
and installs
' updates if available and launches the program afterwards. Using =
modular code, we
' can save loads of time and effort telling everyone there's a new =
update to be
' downloaded, especially while still in heavy development.
'
'------------------------------------------------------------------------=
-------------
Private Sub Main()
'--[ Display the form =
]-------------------------------------------------------
frmSplash.Show
=20
'--[ Setup basic error handeling =
]--------------------------------------------
On Error Resume Next
=20
DoEvents
'--[ Load Localised Messages =
]------------------------------------------------
szErrMissingMSG =3D VB.LoadResString(1900)
szErrMissingTtl =3D VB.LoadResString(1901)
'--[ Catch Localisation Errors =
]----------------------------------------------
If szErrMissingMSG =3D "" Then
szErrMissingTtl =3D "CodeBlue/IM - Critical Error"
szErrMissingMSG =3D "Core components could not be found; =
please re-install" + vbCrLf + _
" CodeBlue/IM. CodeBlue/IM will now be =
terminated."
End If
=20
'--[ Check if components exist =
]----------------------------------------------
If FileSystem.Dir(App.Path & "\" & "cbupwiz.dll") =3D "" Or _
FileSystem.Dir(App.Path & "\" & "cbimapi.dll") =3D "" Then
' --[ Display error & Exit =
]------------------------------------------
MsgBox szErrMissingMSG, vbCritical, szErrMissingTtl
End
End If
=20
'--[ Check for updates =
]------------------------------------------------------
Dim ctlCBWUD
Set ctlCBWUD =3D CreateObject("CBUpWiz.modUpdate")
If ctlCBWUD.StartUpdate =3D True Then
End
End If
Set ctlCBWUD =3D Nothing
=20
'--[ Start CodeBlue Messenger =
]-----------------------------------------------
Dim ctlCBAPI
Set ctlCBAPI =3D CreateObject("CBIMApi.CodeBlue")
frmSplash.Hide
ctlCBAPI.StartUp
Set ctlCBAPI =3D Nothing
=20
'--[ Exit to Windows =
]--------------------------------------------------------
End
End Sub
|