smpackage: Added "Abort, Retry, Ignore" on unzip error

This commit is contained in:
Chris Danford
2003-02-26 01:35:45 +00:00
parent aafd886025
commit f9bc3f125f
2 changed files with 28 additions and 4 deletions
@@ -180,17 +180,41 @@ void CSMPackageInstallDlg::OnOK()
SendMessage( WM_PAINT );
UpdateWindow(); // Force the silly thing to hadle WM_PAINT now!
retry_unzip:
// Extract the files
try
{
// skip extracting "thumbs.db" files
CZipFileHeader fhInfo;
if( m_zip.GetFileInfo(fhInfo, (WORD)i) )
{
CString sFileName = fhInfo.GetFileName();
sFileName.MakeLower();
if( sFileName.Find("thumbs.db") != -1 )
continue; // skip to next file
}
m_zip.ExtractFile( (WORD)i, sInstallDir, true ); // extract file to current directory
}
catch (CException* e)
{
e->ReportError();
char szError[4096];
e->GetErrorMessage( szError, sizeof(szError) );
e->Delete();
exit( 1 );
switch( MessageBox( szError, "Error Extracting File", MB_ABORTRETRYIGNORE|MB_ICONEXCLAMATION ) )
{
case IDABORT:
exit(1);
break;
case IDRETRY:
goto retry_unzip;
break;
case IDIGNORE:
// do nothing
break;
}
}
}