Class wwCodeUpdate

The wwCodeUpdate class can be used in Fat Client applications to perform application updates over the Web. The class provides the version checking tools to check against an XML version resource file, the ability to download the update and the ability to swap out the running application by executing a script file to update the running application file and any others that might have changed.

In addition to the information in this help topic tree please see: http://www.west-wind.com/presentations/wwCodeupdate/codeupdate.asp

for a detailed article on this class and the application update process.


Based on:
Relation
Stored in:
wwCodeupdate.prg
Dependencies:
wwUtils.prg
wwHTTP.prg
wwDialogs.vcx
wconnect.h


Class Members

MemberDescription

CreateHTTPClient

Creates an instance of the oHTTP member of the class.

o.CreateHTTPClient()

DownloadUpdate

Downloads the actual update file from the Web site.

o.DownloadUpdate(llCheckforExistingVersion)

GetVersionInfo

Retrieves the online XML resource specified in cVersionUrl and parses the content into object properties.

o.GetVersionInfo()

RunUpdateExe

This method fires the Update Exe or script application by taking a full command line to the external app or script. Runs the app and then QUITs the current instance of Visual FoxPro.

o.RunUpdateExe(lcUpdateExe)

SwapExes

Hot swaps an EXE file by running a Zip Exe file that unzips the update files.

o.SwapExes(lcUpdateFile)

cApplicationName

Name of the application. Used for display in dialogs.

cDownloadPath

cErrorMsg

Error Message if a method failed or lError is .T.

cExeFile

Name of the main application Exe file.

cOnlineFileUrl

The URL to the update file to download. Set after a successful call to GetVersionInfo().

cUserMessage

User message retrieved from the XML resource file.

cVersionType

Type of the version to be retured in vOnlineVersion, vOnlineMinVersion and as the return value from GetVersionInfo().

cVersionUrl

The URL to the online XML version resource file.

cXML

Contains the full XML resource string after a call to GetVersionInfo().

lError

Error flag. Check cErrorMsg if .T.

lShowDialog

Determines whether the file download displays a progress dialog.

nConnectTimeout

The HTTP timeout before a request is considered cancelled. Applies to wait time connecting and downloading.

nFileSize

The filesize retrieved from the XML resource file, so you can display info about the size of the file before actually grabbing it.

oHTTP

Reference to an wwHTTP object that can be configured after a call to CreateHTTPClient().

vOnlineMinVersion

Contains the minimum version number that is allowed to update after a call to GetVersionInfo(). Value is either string or numeric depending on the cVersionType setting.

vOnlineVersion

Contains the version number after a call to GetVersionInfo(). Value is either string or numeric depending on the cVersionType setting.


© West Wind Technologies, 1996-2022 • Updated: 07/29/15
Comment or report problem with topic