smpackage: Added "Abort, Retry, Ignore" on unzip error
This commit is contained in:
@@ -180,17 +180,41 @@ void CSMPackageInstallDlg::OnOK()
|
|||||||
SendMessage( WM_PAINT );
|
SendMessage( WM_PAINT );
|
||||||
UpdateWindow(); // Force the silly thing to hadle WM_PAINT now!
|
UpdateWindow(); // Force the silly thing to hadle WM_PAINT now!
|
||||||
|
|
||||||
|
retry_unzip:
|
||||||
|
|
||||||
// Extract the files
|
// Extract the files
|
||||||
try
|
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
|
m_zip.ExtractFile( (WORD)i, sInstallDir, true ); // extract file to current directory
|
||||||
}
|
}
|
||||||
catch (CException* e)
|
catch (CException* e)
|
||||||
{
|
{
|
||||||
e->ReportError();
|
char szError[4096];
|
||||||
|
e->GetErrorMessage( szError, sizeof(szError) );
|
||||||
e->Delete();
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ Resource1=IDR_MAINFRAME
|
|||||||
Resource2=IDD_DIALOG_NAME
|
Resource2=IDD_DIALOG_NAME
|
||||||
Class3=CSMPackageInstallDlg
|
Class3=CSMPackageInstallDlg
|
||||||
Class4=CSmpackageExportDlg
|
Class4=CSmpackageExportDlg
|
||||||
Resource3=IDD_EXPORTER
|
Resource3=IDD_INSTALL
|
||||||
Class5=EnterName
|
Class5=EnterName
|
||||||
Resource4=IDD_INSTALL
|
Resource4=IDD_EXPORTER
|
||||||
Class6=EditInsallations
|
Class6=EditInsallations
|
||||||
Resource5=IDD_EDIT_INSTALLATIONS
|
Resource5=IDD_EDIT_INSTALLATIONS
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user