Functions

This is a list of the functions available in ITD.





ITD_AddFile


This function adds a file that is to be downloaded when a download screen is reached. Usernames, passwords and port numbers can be provided as part of the URL, eg: ftp://username:password@www.mywebsite.com:8080/myfile.exe


Prototype

procedure ITD_AddFile(const url, filename: string);


Parameters

url - The full address of the file to be downloaded. Eg. 'http://www.mywebsite.com/file.jpg'

filename - The filename of the saved file. Give a complete path, eg. expandconstant('{tmp}\file.jpg')




ITD_AddFileSize


This function adds a file to be downloaded when a download screen is reached, but specifies the size of the file on the server. This avoids delays before the download begins because ITD doesn't have to check the file size on the server.


Prototype

procedure ITD_AddFileSize(const url, filename: string; size:integer);


Parameters

url - The full address of the file to be downloaded. Eg. 'http://www.mywebsite.com/file.jpg'

filename - The filename of the saved file. Give a complete path, eg. expandconstant('{tmp}\file.jpg')

size - The size, in bytes, of the file to be downloaded




ITD_AddMirror


This function adds another URL for a filename which has already been added by ITD_AddFile or ITD_AddFileSize. The new URL will be used as a mirror if downloading from the original URL fails. You can add as many mirrors as you like for a given filename (The mirrors will be checked in order of addition when downloading the file).


Prototype

procedure ITD_AddMirror(const url, filename: string);


Parameters

url - The full address of the file to be downloaded. Eg. 'http://www.mywebsite.com/file.jpg'

filename - The filename of the saved file. Give a complete path, eg. expandconstant('{tmp}\file.jpg')




ITD_Cancel


Calling this function cancels a download that is in progress


Prototype

procedure ITD_Cancel;




ITD_ClearFiles


Clear the list of files that have been added with ITD_AddFile(). Files are automatically removed from the queue once they are downloaded, so you don't normally need to call this function.


Prototype

procedure ITD_ClearFiles;




ITD_DownloadAfter


This function tells ITD that a download screen should be shown after the given page id. You would typically call this once during IntializeWizard().


Prototype

procedure ITD_DownloadAfter(afterID: integer);


Parameters

afterID - The PageID of the wizard page to add after, eg wpReady.




ITD_DownloadFile


Downloads the given file immediately, without giving any UI indication of what is happening. Returns once the file has been downloaded.


Prototype

function ITD_DownloadFile(const url, filename: string): boolean;


Parameters

url - The full address of the file to be downloaded. Eg. 'http://www.mywebsite.com/file.jpg'

filename - The filename of the saved file. Give a complete path, eg. expandconstant('{tmp}\file.jpg')


Result

Returns true if the download succeeded, false otherwise




ITD_DownloadFiles


Downloads the files added by ITD_AddFile() immediately, without giving any UI indication of what is happening. Returns once the files have been downloaded.


Prototype

function ITD_DownloadFiles: boolean;


Result

Returns true if all files downloaded successfully, false otherwise




ITD_Init


Performs initialization for internal routines. You must call this function before using any other ITD function. You should only call it once!


Prototype

procedure ITD_Init;




ITD_GetFileSize


Gets the size of the file at the given URL. Returns true if successful, false otherwise. The size is stored into the passed size variable.


Prototype

function ITD_GetFileSize(const url: string; var size:cardinal): boolean;


Parameters

url - The full address of the file to check the size of. Eg. 'http://www.mywebsite.com/file.jpg'

size - The variable to store the size into


Result

Returns true if the check succeeded, false otherwise




ITD_GetOption


Check the value of an ITD option. List of possible settings.


Prototype

function ITD_GetOption(const option: string): string;


Parameters

option - The option to be checked


Result

Returns the value of the option, or an empty string if the option does not exist.




ITD_SetOption


Set the value of an ITD option. List of possible settings.


Prototype

procedure ITD_SetOption(const option, value: string);


Parameters

option - The name of the setting to be changed

value - The value to be set




ITD_GetString


Get the value of a language string in ITD. See Language Strings for more details.


Prototype

function ITD_GetString(index:integer): string;


Parameters

index - The index of the language string to get


Result

Returns the current language string for the given index, or the empty string if there is no string associated with this index.




ITD_SetString


Set the value of a language string in ITD. See Language Strings for more details.


Prototype

procedure ITD_SetString(index:integer; const value: string);


Parameters

index - The index of the language string to set

value - The value to be set




ITD_LoadStrings


Loads a set of language strings from an ini file. See Language Strings for more details.


Prototype

function ITD_LoadStrings(const filename: string): boolean;


Parameters

filename - The name of the file to load strings from.


Result

Returns true if loading was successful, false otherwise.




ITD_PostPage


This function performs an HTTP POST with the given data to the given URL. It returns true if the post was successful, or false otherwise. If the server sends any data in its reply, it is available through the response string (Pass a string variable in for response to receive the data) - note that this string is only set if the POST was successful.


Prototype

function ITD_PostPage(const url, data: string; out response: string): boolean;


Parameters

url - The full address of the page to POST to. Eg. 'http://www.mywebsite.com/mypage.php'

data - The data to send to the page

response - Pass a string variable here to receive the response from the server


Result

Returns true if posting was successful, false otherwise

Copyright 2008, Sherlock Software

This help file has been generated by the freeware version of HelpNDoc