Added madExcept

Updated some captions
Improved the "Cancel" button
This commit is contained in:
Christian Hammacher 2006-01-29 17:24:49 +00:00
parent bc5445d255
commit 44db80bc75
7 changed files with 87 additions and 15 deletions

View File

@ -24,6 +24,7 @@
-$X+ -$X+
-$YD -$YD
-$Z1 -$Z1
-GD
-cg -cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+ -H+
@ -33,6 +34,7 @@
-K$00400000 -K$00400000
-LE"c:\programme\borland\delphi7\Projects\Bpl" -LE"c:\programme\borland\delphi7\Projects\Bpl"
-LN"c:\programme\borland\delphi7\Projects\Bpl" -LN"c:\programme\borland\delphi7\Projects\Bpl"
-DmadExcept
-w-UNSAFE_TYPE -w-UNSAFE_TYPE
-w-UNSAFE_CODE -w-UNSAFE_CODE
-w-UNSAFE_CAST -w-UNSAFE_CAST

View File

@ -80,7 +80,7 @@ UnsafeType=0
UnsafeCode=0 UnsafeCode=0
UnsafeCast=0 UnsafeCast=0
[Linker] [Linker]
MapFile=0 MapFile=3
OutputObjs=0 OutputObjs=0
ConsoleApp=1 ConsoleApp=1
DebugInfo=0 DebugInfo=0
@ -96,7 +96,7 @@ PackageDLLOutputDir=
PackageDCPOutputDir= PackageDCPOutputDir=
SearchPath= SearchPath=
Packages=vcl;rtl;vclx;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;VclSmp;dbrtl;dbexpress;vcldb;dsnap;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;JvStdCtrlsD7R;JvAppFrmD7R;JvCoreD7R;JvBandsD7R;JvBDED7R;JvDBD7R;JvDlgsD7R;JvCmpD7R;JvCryptD7R;JvCtrlsD7R;JvCustomD7R;JvDockingD7R;JvDotNetCtrlsD7R;JvEDID7R;qrpt;JvGlobusD7R;JvHMID7R;JvInspectorD7R;JvInterpreterD7R;JvJansD7R;JvManagedThreadsD7R;JvMMD7R;JvNetD7R;JvPageCompsD7R;JvPluginD7R;JvPrintPreviewD7R;JvSystemD7R;JvTimeFrameworkD7R;JvUIBD7R;JvValidatorsD7R;JvWizardD7R;JvXPCtrlsD7R;DelphiX_for7;Indy70;DJcl;tb2k_d7;FlatStyle_D5;scited7;mxFlatPack_D7;mbXPLib Packages=vcl;rtl;vclx;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;VclSmp;dbrtl;dbexpress;vcldb;dsnap;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;JvStdCtrlsD7R;JvAppFrmD7R;JvCoreD7R;JvBandsD7R;JvBDED7R;JvDBD7R;JvDlgsD7R;JvCmpD7R;JvCryptD7R;JvCtrlsD7R;JvCustomD7R;JvDockingD7R;JvDotNetCtrlsD7R;JvEDID7R;qrpt;JvGlobusD7R;JvHMID7R;JvInspectorD7R;JvInterpreterD7R;JvJansD7R;JvManagedThreadsD7R;JvMMD7R;JvNetD7R;JvPageCompsD7R;JvPluginD7R;JvPrintPreviewD7R;JvSystemD7R;JvTimeFrameworkD7R;JvUIBD7R;JvValidatorsD7R;JvWizardD7R;JvXPCtrlsD7R;DelphiX_for7;Indy70;DJcl;tb2k_d7;FlatStyle_D5;scited7;mxFlatPack_D7;mbXPLib
Conditionals= Conditionals=madExcept
DebugSourceDirs= DebugSourceDirs=
UsePackages=0 UsePackages=0
[Parameters] [Parameters]

View File

@ -15,6 +15,11 @@ program AMXInstaller;
} }
uses uses
madExcept,
madLinkDisAsm,
madListHardware,
madListProcesses,
madListModules,
Forms, Forms,
UnitfrmMain in 'UnitfrmMain.pas' {frmMain}, UnitfrmMain in 'UnitfrmMain.pas' {frmMain},
UnitFunctions in 'UnitFunctions.pas', UnitFunctions in 'UnitFunctions.pas',

Binary file not shown.

View File

@ -381,8 +381,11 @@ begin
MakeDir(ePath + 'addons\metamod\dlls'); MakeDir(ePath + 'addons\metamod\dlls');
// rest... // rest...
for i := 0 to DirList.Count -1 do begin for i := 0 to DirList.Count -1 do begin
if Cancel then if Cancel then begin
AddStatus('', clBlack, False);
AddStatus('Installation canceled by user!', clBlack, False);
exit; exit;
end;
if Pos('base', DirList[i]) = 1 then begin if Pos('base', DirList[i]) = 1 then begin
MakeDir(ePath + 'addons\amxmodx\' + Copy(DirList[i], 6, Length(DirList[i]))); MakeDir(ePath + 'addons\amxmodx\' + Copy(DirList[i], 6, Length(DirList[i])));
@ -435,8 +438,11 @@ begin
AddStatus('', clBlack, False); AddStatus('', clBlack, False);
AddStatus('Copying files...', clBlack); AddStatus('Copying files...', clBlack);
for i := 0 to FileList.Count -1 do begin for i := 0 to FileList.Count -1 do begin
if Cancel then if Cancel then begin
AddStatus('', clBlack, False);
AddStatus('Installation canceled by user!', clBlack, False);
exit; exit;
end;
if not IsForbidden(FileList[i], OS) then begin if not IsForbidden(FileList[i], OS) then begin
if Pos('base', FileList[i]) = 1 then begin if Pos('base', FileList[i]) = 1 then begin
@ -578,7 +584,9 @@ var eStr: TStringList;
CopyConfig: Boolean; CopyConfig: Boolean;
eGoBack: Boolean; eGoBack: Boolean;
begin begin
Screen.Cursor := crAppStart;
frmMain.cmdCancel.Show; frmMain.cmdCancel.Show;
frmMain.cmdCancel.Caption := '&Cancel';
frmMain.cmdNext.Hide; frmMain.cmdNext.Hide;
Screen.Cursor := crHourGlass; Screen.Cursor := crHourGlass;
AddStatus('Scanning for directories...', clBlack); AddStatus('Scanning for directories...', clBlack);
@ -609,8 +617,11 @@ begin
eStr := TStringList.Create; eStr := TStringList.Create;
eStr.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam'); eStr.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam');
if eStr.IndexOf('gamedll "addons\metamod\dlls\metamod.dll"') = -1 then begin if eStr.IndexOf('gamedll "addons\metamod\dlls\metamod.dll"') = -1 then begin
if Cancel then if Cancel then begin
AddStatus('', clBlack, False);
AddStatus('Installation canceled by user!', clBlack, False);
exit; exit;
end;
for i := 0 to eStr.Count -1 do begin for i := 0 to eStr.Count -1 do begin
if Pos('gamedll', TrimLeft(eStr[i])) = 1 then if Pos('gamedll', TrimLeft(eStr[i])) = 1 then
@ -649,8 +660,11 @@ begin
AddStatus('Creating directories...', clBlack); AddStatus('Creating directories...', clBlack);
// rest... // rest...
for i := 0 to DirList.Count -1 do begin for i := 0 to DirList.Count -1 do begin
if Cancel then if Cancel then begin
AddStatus('', clBlack, False);
AddStatus('Installation canceled by user!', clBlack, False);
exit; exit;
end;
AddStatus('Creating directory: ' + DirList[i], clBlack); AddStatus('Creating directory: ' + DirList[i], clBlack);
CreateAgain: CreateAgain:
@ -659,7 +673,11 @@ begin
FTPMakeDir(ePath + DirList[i]); FTPMakeDir(ePath + DirList[i]);
except except
on E: Exception do begin on E: Exception do begin
if Cancel then exit; if Cancel then begin
AddStatus('', clBlack, False);
AddStatus('Installation canceled by user!', clBlack, False);
exit;
end;
if frmMain.IdFTP.Connected then begin if frmMain.IdFTP.Connected then begin
if MessageBox(frmMain.Handle, PChar('An error occured while creating "' + FileList[i] + '"!' + #13 + E.Message + #13 + #13 + 'Retry?'), PChar(Application.Title), MB_ICONSTOP + MB_YESNO) = mrYes then if MessageBox(frmMain.Handle, PChar('An error occured while creating "' + FileList[i] + '"!' + #13 + E.Message + #13 + #13 + 'Retry?'), PChar(Application.Title), MB_ICONSTOP + MB_YESNO) = mrYes then
@ -691,8 +709,11 @@ begin
AddStatus('Uploading files...', clBlack); AddStatus('Uploading files...', clBlack);
AddStatus('', clBlack, False); AddStatus('', clBlack, False);
for i := 0 to FileList.Count -1 do begin for i := 0 to FileList.Count -1 do begin
if Cancel then if Cancel then begin
AddStatus('', clBlack, False);
AddStatus('Installation canceled by user!', clBlack, False);
exit; exit;
end;
if not IsForbidden(FileList[i], OS) then begin if not IsForbidden(FileList[i], OS) then begin
AddStatus('Uploading file: ' + FileList[i], clBlack); AddStatus('Uploading file: ' + FileList[i], clBlack);
@ -719,7 +740,11 @@ begin
end; end;
except except
on E: Exception do begin on E: Exception do begin
if Cancel then exit; if Cancel then begin
AddStatus('', clBlack, False);
AddStatus('Installation canceled by user!', clBlack, False);
exit;
end;
if frmMain.IdFTP.Connected then begin if frmMain.IdFTP.Connected then begin
if MessageBox(frmMain.Handle, PChar('An error occured while uploading "' + FileList[i] + '"!' + #13 + E.Message + #13 + #13 + 'Retry?'), PChar(Application.Title), MB_ICONSTOP + MB_YESNO) = mrYes then if MessageBox(frmMain.Handle, PChar('An error occured while uploading "' + FileList[i] + '"!' + #13 + E.Message + #13 + #13 + 'Retry?'), PChar(Application.Title), MB_ICONSTOP + MB_YESNO) = mrYes then

View File

@ -4924,7 +4924,7 @@ object frmMain: TfrmMain
Left = 172 Left = 172
Top = 82 Top = 82
Width = 353 Width = 353
Height = 26 Height = 13
Caption = Caption =
'This wizard will guide you through the installation of AMX Mod X' + 'This wizard will guide you through the installation of AMX Mod X' +
' (version).' ' (version).'
@ -5980,6 +5980,7 @@ object frmMain: TfrmMain
Top = 0 Top = 0
Width = 527 Width = 527
Height = 314 Height = 314
OnShow = jspFTPShow
object lblStep1: TLabel object lblStep1: TLabel
Left = 44 Left = 44
Top = 60 Top = 60
@ -6455,7 +6456,7 @@ object frmMain: TfrmMain
ColorBorder = clBtnShadow ColorBorder = clBtnShadow
ColorHighLight = clBtnShadow ColorHighLight = clBtnShadow
ColorShadow = clBtnShadow ColorShadow = clBtnShadow
Caption = '&Cancel' Caption = '&Close'
ParentColor = False ParentColor = False
TabOrder = 1 TabOrder = 1
OnClick = cmdCancelClick OnClick = cmdCancelClick

View File

@ -124,6 +124,7 @@ type
var AllowExpansion: Boolean); var AllowExpansion: Boolean);
procedure trvDirectoriesCollapsing(Sender: TObject; Node: TTreeNode; procedure trvDirectoriesCollapsing(Sender: TObject; Node: TTreeNode;
var AllowCollapse: Boolean); var AllowCollapse: Boolean);
procedure jspFTPShow(Sender: TObject);
private private
OldProgress: Integer; OldProgress: Integer;
CurrProgress: Integer; CurrProgress: Integer;
@ -150,7 +151,30 @@ end;
procedure TfrmMain.cmdCancelClick(Sender: TObject); procedure TfrmMain.cmdCancelClick(Sender: TObject);
begin begin
Close; if (jplWizard.ActivePage = jspFTP) and (cmdConnect.Caption = 'Connecting...') then begin
Screen.Cursor := crDefault;
Cancel := True;
try
IdFTP.Disconnect;
except
// oh, hello BAILOPAN!
end;
cmdCancel.Caption := 'Close';
end
else if (jplWizard.ActivePage = jspInstallProgress) then begin
if Cancel then
Close
else if MessageBox(Handle, 'Do you really want to cancel the installation?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then begin
Screen.Cursor := crDefault;
Application.OnException := ExceptionHandler;
Cancel := True;
if IdFTP.Connected then
IdFTP.Quit;
end;
cmdCancel.Caption := 'Close';
end
else
Close;
end; end;
procedure TfrmMain.cmdNextClick(Sender: TObject); procedure TfrmMain.cmdNextClick(Sender: TObject);
@ -219,8 +243,10 @@ begin
Sleep(1500); Sleep(1500);
ggeAll.Progress := 0; ggeAll.Progress := 0;
ggeItem.Progress := 0; ggeItem.Progress := 0;
InstallCustom(ExtractFilePath(ParamStr(0)) + 'temp\', ChosenMod, eOS);
cmdNext.Hide; cmdNext.Hide;
InstallCustom(ExtractFilePath(ParamStr(0)) + 'temp\', ChosenMod, eOS);
if Cancel then
exit;
AddStatus('', clBlack, False); AddStatus('', clBlack, False);
AddStatus('', clBlack, False); AddStatus('', clBlack, False);
AddStatus('- - - - -', clBlack, False); AddStatus('- - - - -', clBlack, False);
@ -230,7 +256,6 @@ begin
// ... then upload ... // ... then upload ...
ggeAll.Progress := 0; ggeAll.Progress := 0;
ggeItem.Progress := 0; ggeItem.Progress := 0;
Screen.Cursor := crAppStart;
InstallFTP(ChosenMod, eOS); InstallFTP(ChosenMod, eOS);
end end
else if jplWizard.ActivePage = jspInstallProgress then else if jplWizard.ActivePage = jspInstallProgress then
@ -467,6 +492,7 @@ begin
txtPassword.Enabled := False; txtPassword.Enabled := False;
chkPassive.Enabled := False; chkPassive.Enabled := False;
cmdConnect.Caption := 'Connecting...'; cmdConnect.Caption := 'Connecting...';
cmdCancel.Caption := '&Cancel';
// ... set values ... // ... set values ...
IdFTP.Host := txtHost.Text; IdFTP.Host := txtHost.Text;
IdFTP.Port := StrToInt(txtPort.Text); IdFTP.Port := StrToInt(txtPort.Text);
@ -487,6 +513,7 @@ begin
trvDirectories.Enabled := True; trvDirectories.Enabled := True;
cmdConnect.Enabled := True; cmdConnect.Enabled := True;
cmdConnect.Caption := 'Disconnect'; cmdConnect.Caption := 'Disconnect';
cmdCancel.Caption := '&Close';
CurNode := nil; CurNode := nil;
if eStr.Count <> 0 then begin if eStr.Count <> 0 then begin
@ -508,6 +535,7 @@ begin
CurNode.Expand(False); CurNode.Expand(False);
except except
on E: Exception do begin on E: Exception do begin
Screen.Cursor := crDefault;
// reset button properties // reset button properties
cmdConnect.Enabled := True; cmdConnect.Enabled := True;
txtHost.Enabled := True; txtHost.Enabled := True;
@ -518,6 +546,11 @@ begin
cmdProxySettings.Enabled := True; cmdProxySettings.Enabled := True;
cmdNext.Enabled := False; cmdNext.Enabled := False;
cmdConnect.Caption := 'Connect'; cmdConnect.Caption := 'Connect';
cmdCancel.Caption := '&Cancel';
if Cancel then begin
Cancel := False;
exit;
end;
// analyze messages // analyze messages
if Pos('Login incorrect.', E.Message) <> 0 then begin // login failed if Pos('Login incorrect.', E.Message) <> 0 then begin // login failed
MessageBox(Handle, 'Login incorrect. Check your FTP settings and try again.', PChar(Application.Title), MB_ICONWARNING); MessageBox(Handle, 'Login incorrect. Check your FTP settings and try again.', PChar(Application.Title), MB_ICONWARNING);
@ -541,11 +574,11 @@ begin
end end
else else
MessageBox(Handle, PChar(E.Message), PChar(Application.Title), MB_ICONWARNING); // unknown error MessageBox(Handle, PChar(E.Message), PChar(Application.Title), MB_ICONWARNING); // unknown error
// ... connect failed, leave procedure ... // ... connect failed, leave procedure ...
exit; exit;
end; end;
end; end;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end end
else begin else begin
@ -561,6 +594,7 @@ begin
txtPassword.Enabled := True; txtPassword.Enabled := True;
chkPassive.Enabled := True; chkPassive.Enabled := True;
cmdConnect.Caption := 'Connect'; cmdConnect.Caption := 'Connect';
cmdCancel.Caption := '&Close';
cmdNext.Enabled := False; cmdNext.Enabled := False;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; end;
@ -747,4 +781,9 @@ begin
Node.SelectedIndex := 0; Node.SelectedIndex := 0;
end; end;
procedure TfrmMain.jspFTPShow(Sender: TObject);
begin
Cancel := False;
end;
end. end.