rctshine
03-21-2005, 06:57 PM
I get this message when trying to unzip a file.
Here is the code I am using:
-- These actions are performed before the screen is shown.
--Instructions.
result = Dialog.Message("Notice", "A box will now pop up. in this box, please select where you would like the program to install the Darkflash template.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
--Rename for Unzipping.
file_rn = File.Rename("_TempFolder..\\xaosd.txt", "_TempFolder..\\xaosd.zip");
--check for errors.
error1 = Application.GetLastError();
--if there are errors, display them.
if (error1 ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
-- Allow the user to select a directory to unzip the files.
target_folder = Dialog.FolderBrowse("Select a Folder", "C:\\");
-- Check to see if the user cancelled or an error occurred.
if (target_folder ~= "CANCEL") and (target_folder ~= "") then
-- Gets a list of the contents of a zip file.
zip_contents = Zip.GetContents("_TempFolder..\\xaosd.zip", true);
-- Get the error code of the last action.
error = Application.GetLastError();
-- If an error occurred, display the error code message.
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
-- Take the table and turn it into a string with newlines for displaying.
zip_contents_display = Table.Concat(zip_contents, "\r\n", 1, TABLE_ALL);
-- Ask the user if they are sure they would like to unzip the contents.
result2 = Dialog.Message("Information", "The following files will be unzipped:\r\nClick the Cancel button to abort the process.\r\n\r\n"..zip_contents_display, MB_OKCANCEL)
-- If the user clicked Ok, unzip the files.
if (result2 == IDOK) then
-- Show the status dialog.
StatusDlg.Show();
-- Extract the contents of the Zip file.
Zip.Extract("xaosd.zip", {"*.*"}, target_folder, true, true, "", ZIP_OVERWRITE_ALWAYS, nil);
-- Check the error code for the last action.
error = Application.GetLastError();
-- Show the status dialog.
StatusDlg.Show(MB_ICONNONE, false);
-- If an error occurred, display the error code message.
if (error ~= 0) then
Dialog.Message("Errror", tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
Dialog.Message("Success", "The unzipping was successful.", MB_OK, MB_ICONINFORMATION);
end
end
end
end
end
I'm at my wits-end.
I don't know what to do.
Help! :huh
Here is the code I am using:
-- These actions are performed before the screen is shown.
--Instructions.
result = Dialog.Message("Notice", "A box will now pop up. in this box, please select where you would like the program to install the Darkflash template.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
--Rename for Unzipping.
file_rn = File.Rename("_TempFolder..\\xaosd.txt", "_TempFolder..\\xaosd.zip");
--check for errors.
error1 = Application.GetLastError();
--if there are errors, display them.
if (error1 ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
-- Allow the user to select a directory to unzip the files.
target_folder = Dialog.FolderBrowse("Select a Folder", "C:\\");
-- Check to see if the user cancelled or an error occurred.
if (target_folder ~= "CANCEL") and (target_folder ~= "") then
-- Gets a list of the contents of a zip file.
zip_contents = Zip.GetContents("_TempFolder..\\xaosd.zip", true);
-- Get the error code of the last action.
error = Application.GetLastError();
-- If an error occurred, display the error code message.
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
-- Take the table and turn it into a string with newlines for displaying.
zip_contents_display = Table.Concat(zip_contents, "\r\n", 1, TABLE_ALL);
-- Ask the user if they are sure they would like to unzip the contents.
result2 = Dialog.Message("Information", "The following files will be unzipped:\r\nClick the Cancel button to abort the process.\r\n\r\n"..zip_contents_display, MB_OKCANCEL)
-- If the user clicked Ok, unzip the files.
if (result2 == IDOK) then
-- Show the status dialog.
StatusDlg.Show();
-- Extract the contents of the Zip file.
Zip.Extract("xaosd.zip", {"*.*"}, target_folder, true, true, "", ZIP_OVERWRITE_ALWAYS, nil);
-- Check the error code for the last action.
error = Application.GetLastError();
-- Show the status dialog.
StatusDlg.Show(MB_ICONNONE, false);
-- If an error occurred, display the error code message.
if (error ~= 0) then
Dialog.Message("Errror", tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
Dialog.Message("Success", "The unzipping was successful.", MB_OK, MB_ICONINFORMATION);
end
end
end
end
end
I'm at my wits-end.
I don't know what to do.
Help! :huh