|
From: Darko K. <da...@ho...> - 2004-02-16 15:32:56
|
Hello all... I made some minor modifications to loader code..
Darko
'---------------------------------------------------------------------------
----------
' CodeBlue/IM Modular Loader v1.0
'
' Date Coder Description
' ========= ===========
==============================================================
' 02-14-04 Wimz Initial Creation
' 02-16-04 Darko Some performance tweaks
'
'
'
' 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.
'
'---------------------------------------------------------------------------
----------
Option Explicit 'We have to declare every variable
Option Compare Text 'Default compare option is now text (not case sensitive)
instead of binary
Private Sub Main()
'--[ Variable declaration
]---------------------------------------------------
Dim szErrMissingMSG As String
Dim szErrMissingTtl As String
'--[ Display the form
]-------------------------------------------------------
frmSplash.Show
'--[ Setup basic error handeling
]--------------------------------------------
On Error Resume Next
'--[ Load Localised Messages
]------------------------------------------------
szErrMissingMSG = VB.LoadResString(1900)
szErrMissingTtl = VB.LoadResString(1901)
'--[ Catch Localisation Errors
]----------------------------------------------
If LenB(szErrMissingMSG) = 0 Then 'Note that LenB() is faster for
checking if variable is empty
szErrMissingTtl = "CodeBlue/IM - Critical Error"
szErrMissingMSG = "Core components could not be found; please
re-install" + vbNewLine + _
" CodeBlue/IM. CodeBlue/IM will now be
terminated."
End If
'--[ Check if components exist
]----------------------------------------------
If LenB(FileSystem.Dir(App.Path & "\" & "cbupwiz.dll")) = 0 Or _
LenB(FileSystem.Dir(App.Path & "\" & "cbimapi.dll")) = 0 Then
' --[ Display error & Exit
]------------------------------------------
MsgBox szErrMissingMSG, vbCritical, szErrMissingTtl
End
End If
'--[ Check for updates
]------------------------------------------------------
Dim ctlCBWUD As Object
Set ctlCBWUD = CreateObject("CBUpWiz.modUpdate")
If ctlCBWUD.StartUpdate = True Then
End
End If
Set ctlCBWUD = Nothing
'--[ Start CodeBlue Messenger
]-----------------------------------------------
Dim ctlCBAPI As Object
Set ctlCBAPI = CreateObject("CBIMApi.CodeBlue")
frmSplash.Hide
ctlCBAPI.StartUp
Set ctlCBAPI = Nothing
'--[ Exit to Windows
]--------------------------------------------------------
End
End Sub
|