OverviewExamples
table SetupData.GetFileList ( |
tFiles = SetupData.GetFileList(ARCHIVE_LIST);
Gets the list of archive files (and corresponding properties) from the installation, and stores them in table "tFiles".
-- Function to convert any boolean values to strings
function BoolToString(value)
if type (value) == "boolean" then
if value then
return "True";
else
return "False";
end
else
return value;
end
end
-- Get the list of files and properties
tFileList = SetupData.GetFileList(BOTH_LISTS);
-- Initialize variable to hold information
StringToWrite = "";
-- Traverse through each file in the table
for nIndex, PropTable in pairs(tFileList) do
-- Get filename and write it to the string
StringToWrite = StringToWrite .. "#########################################" .. "\r\n";
StringToWrite = StringToWrite .. "Filename: " .. PropTable.FileName .. "\r\n\r\n";
-- Traverse through property table
for sSubIndex, Value in pairs(PropTable) do
-- If the current property is not the filename, and is not a table, store in string
if sSubIndex ~= "FileName" and type(Value) ~= "table" then
StringToWrite = StringToWrite .. sSubIndex .. ": " .. BoolToString(Value) .. "\r\n";
-- If the current property is packages, traverse the table and store in string
elseif sSubIndex == "Packages" and Value then
StringToWrite = StringToWrite .. sSubIndex .. ": ..." .. "\r\n";
for nPackageIndex, sPackageName in pairs(Value) do
StringToWrite = StringToWrite .. " [PACKAGE " .. nPackageIndex .. "] " .. sPackageName .. "\r\n";
end
end
end
-- Finish off current filename in string with a nice 'footer'
StringToWrite = StringToWrite .. "#########################################" .. "\r\n\r\n\r\n";
end
-- Write string to a file
TextFile.WriteFromString("C:\\Project_File_Report.txt", StringToWrite, false);
Gets the list of files from the setup, and outputs it (and corresponding properties) to "C:\Project_File_Report.txt".
See also: Related Actions