| 984 | |
| 985 | #ifndef RARDLL |
| 986 | bool CmdExtract::ExtrGetPassword(Archive &Arc,const wchar *ArcFileName) |
| 987 | { |
| 988 | if (!Cmd->Password.IsSet()) |
| 989 | { |
| 990 | if (!uiGetPassword(UIPASSWORD_FILE,ArcFileName,&Cmd->Password)/* || !Cmd->Password.IsSet()*/) |
| 991 | { |
| 992 | // Suppress "test is ok" message if user cancelled the password prompt. |
| 993 | // 2019.03.23: If some archives are tested ok and prompt is cancelled for others, |
| 994 | // do we really need to suppress "test is ok"? Also if we set an empty password |
| 995 | // and "Use for all archives" in WinRAR Ctrl+P and skip some encrypted archives. |
| 996 | // We commented out this UIERROR_INCERRCOUNT for now. |
| 997 | // uiMsg(UIERROR_INCERRCOUNT); |
| 998 | return false; |
| 999 | } |
| 1000 | Cmd->ManualPassword=true; |
| 1001 | } |
| 1002 | #if !defined(SILENT) |
| 1003 | else |
| 1004 | if (!GlobalPassword && !Arc.FileHead.Solid) |
| 1005 | { |
| 1006 | eprintf(St(MUseCurPsw),ArcFileName); |
| 1007 | switch(Cmd->AllYes ? 1 : Ask(St(MYesNoAll))) |
| 1008 | { |
| 1009 | case -1: |
| 1010 | ErrHandler.Exit(RARX_USERBREAK); |
| 1011 | case 2: |
| 1012 | if (!uiGetPassword(UIPASSWORD_FILE,ArcFileName,&Cmd->Password)) |
| 1013 | return false; |
| 1014 | break; |
| 1015 | case 3: |
| 1016 | GlobalPassword=true; |
| 1017 | break; |
| 1018 | } |
| 1019 | } |
| 1020 | #endif |
| 1021 | return true; |
| 1022 | } |
| 1023 | #endif |
| 1024 | |
| 1025 | |