UninstallData.GetItem

table UninstallData.GetItem ( 

number ItemType,

string Identifier )

Example 1

tItemData = UninstallData.GetItem(UNINDATA_FOLDERS, sFolderPath);

Gets the details of the folder path stored in the string "sFolderPath", and stores them in the table "tItemData".

Example 2

tSessionVars = UninstallData.GetItemList(UNINDATA_SESSIONVARS);
sOutput = "";

for nIndex, sName in pairs(tSessionVars) do
    tDetails = UninstallData.GetItem(UNINDATA_SESSIONVARS, sName);
    sOutput = sOutput .. tDetails.Name .. ": " .. tDetails.Value .. "\r\n";
end

TextFile.WriteFromString("C:\\SessionVariables.txt", sOutput, false);

Gets a list of the session variables stored in the uninstall configuration file.  Each of these session variables, and their stored values are stored in the string sOutput, and written out to a text file.

Example 3

-- Get the data for file globals.dll from the uninstall data file
Item_Data = UninstallData.GetItem(UNINDATA_FILES, SessionVar.Expand("%SourceFolder%\\globals.dll"));

if Item_Data.Backup ~= "" then
    -- Copy the backed up file to the original location
    File.Copy(Item_Data.Backup, SessionVar.Expand("%SourceFolder%\\globals.dll"), false, true, false, true, nil);
    -- Delete the backed up file
    File.Delete(Item_Data.Backup, false, false, true, nil);
end

Restores the backed-up version of the globals.dll if it was backed up.   If it was not backed up, nothing happens.

See also:  Related Actions