#define MyAppName "Test Program"
#define AppName "Test Program"
#define MyAppVersion "1.0"
#define MyAppPublisher "Home"
#define MyAppExeName "Test Program.exe"
[Setup]
AppName={#AppName}
AppVerName={#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppName}
AppendDefaultDirName=no
CreateAppDir=yes
CreateUninstallRegKey=no
AppCopyright={#AppName}
SolidCompression=true
Compression=lzma2/Ultra64
InternalCompressLevel=Ultra64
Uninstallable=false
UsePreviousAppDir=no
UsePreviousGroup=no
UsePreviousTasks=no
DirExistsWarning=no
OutputBaseFilename={#AppName}
OutputDir=.
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[Files]
Source: Fon.bmp; DestDir: {tmp}; Flags: ignoreversion
[Tasks]
Name: desktopicon; Description: íà Ðàáî÷åì ñòîëå; Flags: unchecked
Name: groupicon; Description: â ìåíþ «Ïóñê»; Flags: unchecked
Name: quickicon; Description: â Ïàíåëè áûñòðîãî çàïóñêà; Flags: unchecked
[Types]
Name: full; Description: Ðóññêèé (ïî óìîë÷àíèþ); Flags: iscustom
Name: compact; Description: English
[Code]
//const
// BM_CLICK=$00F5;
var
fon:TBitmapimage;
Parameters, ParametersBack:TButton;
function NextButtonClick(CurPage: Integer): Boolean;
var
sz:Integer;
s:string;
h:Longint;
begin
Result:=True;
If CurPage=1 then begin
h:=FindWindowByClassName('My-Program-WINDOW');
If h<>0 then
SendMessage(h, 16, 0, 0); //Âîò ýòî è åñòü çàêðûòèå ïðîãðàììû
end
else
If CurPage=10 then begin
//Ïðîâåðêà ïðèñóòñòâèÿ îïðåäåëåííûõ ôàéëîâ â ïàïêå ñ óñòàíîâëåííîé ïðîãðàììîé íà ñòðàíèöå âûáîðà ïàïêè íàçíà÷åíèÿ
If (FileSearch('Main.exe', ExpandConstant('{#AppName}'))='') then begin//èùåì ôàéë [Main.exe] â ïàïêå {app}.
s:='Èçâèíèòå, â äèðåêòîðèè '+ExpandConstant('{#AppName}')+'' #13 'íå îáíàðóæåíû ôàéëû, ïîäòâåðæäàþùèå ïîäëèííîñòü ïðîãðàììû.' #13#13 'Ïîæàëóéñòà, âûáåðèòå ïðàâèëüíûé ïóòü äëÿ óñòàíîâêè îáíîâëåíèÿ.';
MsgBox(s, mbError, mb_Ok);
Result:= False
end;
end;
end;
procedure ParametersOnClick(Snder:TObject);
begin
Parameters.Hide;
Fon.Hide;
WizardForm.TypesCombo.Show;
WizardForm.DirEdit.Show;
WizardForm.DirBrowseButton.Show;
WizardForm.TasksList.Show;
ParametersBack.Show;
end;
procedure ParametersbackOnclick(Sender:TObject);
begin
WizardForm.TypesCombo.Hide;
WizardForm.DirEdit.Hide;
WizardForm.DirBrowseButton.Hide;
WizardForm.TasksList.Hide;
Parametersback.Hide;
Parameters.Show;
fon.Show;
end;
procedure Buttons;
begin
WizardForm.NextButton.Left:=ScaleX(279);
WizardForm.NextButton.Top:=ScaleY(338);
WizardForm.NextButton.Width:=ScaleX(179);
WizardForm.NextButton.Height:=ScaleY(25);
WizardForm.CancelButton.Left:=ScaleX(465);
WizardForm.CancelButton.Top:=ScaleY(338);
WizardForm.CancelButton.Width:=ScaleX(119);
WizardForm.CancelButton.Height:=ScaleY(25);
with WizardForm.DirBrowseButton do begin
Left:=ScaleX(434);
Top:=ScaleY(86);
Width:=ScaleX(124);
Height:=ScaleY(23);
Parent:=WizardForm;
Caption:='Èçìåíèòü...';
Hide;
end;
Parameters:=TButton.Create(WizardForm);
with Parameters do begin
Left:=ScaleX(20);
Top:=ScaleY(338);
Width:=ScaleX(119);
Height:=ScaleY(25);
Caption:='Ïàðàìåòðû';
Parent:=WizardForm;
OnClick:=@ParametersOnClick
end;
Parametersback:=TButton.Create(WizardForm);
with Parametersback do begin
Left:=ScaleX(20);
Top:=ScaleY(338);
Width:=ScaleX(119);
Height:=ScaleY(25);
Caption:='Íàçàä';
Parent:=WizardForm;
OnClick:=@ParametersbackOnclick
Hide;
end;
end;
procedure form;
begin
ExtractTemporaryFile('fon.bmp');
WizardForm.OuterNotebook.Hide;
WizardForm.Width:=ScaleX(600);
WizardForm.Height:=ScaleY(404);
WizardForm.Bevel.Hide;
WizardForm.Caption:='Óñòàíîâêà {#MyAppName}'
fon:=TBitmapImage.Create(WizardForm);
with fon do begin
Parent:=WizardForm;
Left:=ScaleX(0);
Top:=ScaleY(0);
Width:=ScaleX(613);
Height:=ScaleY(225);
Bitmap.LoadFromFile(ExpandConstant('{tmp}\Fon.bmp'));
end;
with WizardForm.DirEdit do begin
Left:=ScaleX(162);
Top:=ScaleY(87);
Width:=ScaleX(265);
Height:=ScaleY(50);
Parent:=WizardForm;
Color:=clWhite;
Hide;
end;
with WizardForm.TasksList do begin
Left:=ScaleX(162);
Top:=ScaleY(145);
Width:=ScaleX(389);
Height:=ScaleY(70);
Parent:=WizardForm;
Hide;
end;
with WizardForm.ProgressGauge do begin
Parent:=WizardForm;
Left:=ScaleX(145);
Top:=ScaleY(245);
Width:=ScaleX(311);
Height:=ScaleY(1);
Hide;
end;
end;
procedure InitializeWizard;
begin
Form;
Buttons;
WizardForm.BorderIcons:=[biSystemMenu]
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
fon.Show;
WizardForm.ProgressGauge.Show;
WizardForm.DirEdit.Hide;
WizardForm.DirBrowseButton.Hide;
Parameters.hide;
ParametersBack.Hide;
end;
Procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpFinished then begin
WizardForm.ProgressGauge.Hide;
//SendMessage(WizardForm.NextButton.Handle,BM_CLICK,0,0);
end;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := PageIndexFromID(PageID) < PageIndexFromID(wpReady);
end;