Смотрите видео ниже, чтобы узнать, как установить наш сайт в качестве веб-приложения на домашнем экране.
Примечание: Эта возможность может быть недоступна в некоторых браузерах.
спасибо,а можете помочь с этим скриптом https://yadi.sk/d/3CCSiXy7e94P3 то там проблема при свертывании и развертывании на стр backup.Вот так например:
[code]
var
Comp1Check, Comp2Check,Comp3Check,Comp4Check: HWND;
Comp1Label, Comp2Label, Comp3Label, Comp4Label: TLabel;
function InitializeSetup:boolean;
begin
ExtractTemporaryFile('botva2.dll');
ExtractTemporaryFile('b2p.dll');
ExtractTemporaryFile('CallbackCtrl.dll');
ExtractTemporaryFile('RadioBatton.png');
Result:=True;
end;
procedure MouseEnter(Sender: TObject);
begin
end;
procedure BtnEnter(hBtn:HWND);
begin
DelTree(ExpandConstant('res_mods'), True, True, True);
CreateDir(ExpandConstant('res_mods\'));
end;
function Comp1: Boolean;
begin
Result:= BtnGetChecked(Comp1Check);
end;
procedure Comp1Click(hBtn:HWND);
begin
if BtnGetChecked(hBtn) then Comp1Label.Font.Color:=$22A4CA else Comp1Label.Font.Color:=$FFFFFF;
if BtnGetChecked(hBtn) then Comp2Label.Font.Color:=$FFFFFF else Comp2Label.Font.Color:=$22A4CA;
if BtnGetChecked(Comp1Check) then BtnSetChecked(Comp2Check,False) and BtnSetChecked(Comp3Check,False) and BtnSetChecked(Comp4Check,False);
end;
procedure Comp1LabelClick(Sender:TObject);
begin
BtnSetChecked(Comp1Check, not BtnGetChecked(Comp1Check));
if BtnGetChecked(Comp1Check) then BtnSetChecked(Comp2Check ,False) and BtnSetChecked(Comp3Check,False) and BtnSetChecked(Comp4Check,False);
Comp1Click(Comp1Check);
end;
function Comp2: Boolean;
begin
Result:= BtnGetChecked(Comp2Check);
end;
procedure Comp2Click(hBtn:HWND);
begin
if BtnGetChecked(hBtn) then Comp2Label.Font.Color:=$22A4CA else Comp2Label.Font.Color:=$FFFFFF;
if BtnGetChecked(hBtn) then Comp1Label.Font.Color:=$FFFFFF else Comp1Label.Font.Color:=$22A4CA;
if BtnGetChecked(Comp2Check) then BtnSetChecked(Comp1Check,False) and BtnSetChecked(Comp3Check,False) and BtnSetChecked(Comp4Check,False);
end;
procedure Comp2LabelClick(Sender:TObject);
begin
BtnSetChecked(Comp2Check, not BtnGetChecked(Comp2Check));
if BtnGetChecked(Comp2Check) then BtnSetChecked(Comp1Check,False) and BtnSetChecked(Comp3Check,False) and BtnSetChecked(Comp4Check,False);
Comp2Click(Comp2Check);
end;
function Comp3: Boolean;
begin
Result:= BtnGetChecked(Comp3Check);
end;
procedure Comp3Click(hBtn:HWND);
begin
if BtnGetChecked(hBtn) then Comp3Label.Font.Color:=$22A4CA else Comp3Label.Font.Color:=$FFFFFF;
if BtnGetChecked(hBtn) then Comp1Label.Font.Color:=$FFFFFF else Comp1Label.Font.Color:=$22A4CA;
if BtnGetChecked(Comp3Check) then BtnSetChecked(Comp2Check,False) and BtnSetChecked(Comp1Check,False) and BtnSetChecked(Comp4Check,False);
end;
procedure Comp3LabelClick(Sender:TObject);
begin
BtnSetChecked(Comp3Check, not BtnGetChecked(Comp3Check));
if BtnGetChecked(Comp3Check) then BtnSetChecked(Comp2Check,False) and BtnSetChecked(Comp1Check,False) and BtnSetChecked(Comp4Check,False);
Comp3Click(Comp3Check);
end;
function Comp4: Boolean;
begin
Result:= BtnGetChecked(Comp4Check);
end;
procedure Comp4Click(hBtn:HWND);
begin
if BtnGetChecked(hBtn) then Comp4Label.Font.Color:=$22A4CA else Comp4Label.Font.Color:=$FFFFFF;
if BtnGetChecked(hBtn) then Comp1Label.Font.Color:=$FFFFFF else Comp1Label.Font.Color:=$22A4CA;
if BtnGetChecked(Comp4Check) then BtnSetChecked(Comp1Check,False) and BtnSetChecked(Comp2Check,False) and BtnSetChecked(Comp3Check,False);
end;
procedure Comp4LabelClick(Sender:TObject);
begin
BtnSetChecked(Comp4Check, not BtnGetChecked(Comp4Check));
if BtnGetChecked(Comp4Check) then BtnSetChecked(Comp1Check,False) and BtnSetChecked(Comp2Check,False) and BtnSetChecked(Comp3Check,False);
Comp4Click(Comp4Check);
end;
procedure InitializeWizard();
begin
WizardForm.OuterNotebook.Hide
WizardForm.InnerNotebook.Hide
Comp1Check:=BtnCreate(WizardForm.Handle,ScaleX(30),ScaleY(100),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\RadioBatton.png'),8,True);
BtnSetEvent(Comp1Check,BtnClickEventID,WrapBtnCallback(@Comp1Click,1));
BtnSetEvent(Comp1Check,BtnMouseEnterEventID,WrapBtnCallback(@BtnEnter,1));
BtnSetChecked(Comp1Check,True);
//BtnSetVisibility(Comp1Check,false);
Comp1Label := TLabel.Create(WizardForm);
with Comp1Label do begin
AutoSize:=False;
SetBounds(ScaleX(60), ScaleY(105), ScaleX(105), ScaleY(17));
OnClick:= @Comp1LabelClick;
Transparent:=True;
Font.Size:= 11;
Font.Color:=$22A4CA;
OnMouseEnter:=@MouseEnter;
Caption := 'Удалить файлы'
Parent := WizardForm;
end;
Comp2Check:=BtnCreate(WizardForm.Handle,ScaleX(30),ScaleY(125),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\RadioBatton.png'),8,True);
BtnSetEvent(Comp2Check,BtnClickEventID,WrapBtnCallback(@Comp2Click,1));
BtnSetEvent(Comp2Check,BtnMouseEnterEventID,WrapBtnCallback(@BtnEnter,1));
// BtnSetVisibility(Comp2Check,false);
Comp2Label := TLabel.Create(WizardForm);
with Comp2Label do begin
AutoSize:=False;
SetBounds(ScaleX(60), ScaleY(130), ScaleX(105), ScaleY(17));
OnClick:= @Comp2LabelClick;
Transparent:=True;
Font.Size:= 11;
Font.Color:=$FFFFFF;
OnMouseEnter:=@MouseEnter;
//Font.Style:=[fsBold,fsItalic];
Caption := 'Сделать резервную копию файлов'
Parent := WizardForm;
end;
Comp3Check:=BtnCreate(WizardForm.Handle,ScaleX(30),ScaleY(125),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\RadioBatton.png'),8,True);
BtnSetEvent(Comp3Check,BtnClickEventID,WrapBtnCallback(@Comp3Click,1));
BtnSetEvent(Comp3Check,BtnMouseEnterEventID,WrapBtnCallback(@BtnEnter,1));
// BtnSetVisibility(Comp2Check,false);
Comp3Label := TLabel.Create(WizardForm);
with Comp2Label do begin
AutoSize:=False;
SetBounds(ScaleX(60), ScaleY(155), ScaleX(105), ScaleY(17));
OnClick:= @Comp2LabelClick;
Transparent:=True;
Font.Size:= 11;
Font.Color:=$FFFFFF;
OnMouseEnter:=@MouseEnter;
//Font.Style:=[fsBold,fsItalic];
Caption := 'Обновить существующие файлы'
Parent := WizardForm;
end;
Comp4Check:=BtnCreate(WizardForm.Handle,ScaleX(30),ScaleY(125),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\RadioBatton.png'),8,True);
BtnSetEvent(Comp4Check,BtnClickEventID,WrapBtnCallback(@Comp4Click,1));
BtnSetEvent(Comp4Check,BtnMouseEnterEventID,WrapBtnCallback(@BtnEnter,1));
// BtnSetVisibility(Comp2Check,false);
Comp4Label := TLabel.Create(WizardForm);
with Comp2Label do begin
AutoSize:=False;
SetBounds(ScaleX(60), ScaleY(175), ScaleX(105), ScaleY(17));
OnClick:= @Comp2LabelClick;
Transparent:=True;
Font.Size:= 11;
Font.Color:=$FFFFFF;
OnMouseEnter:=@MouseEnter;
//Font.Style:=[fsBold,fsItalic];
Caption := 'Ничего не трогать'
Parent := WizardForm;
end;
end;
Почти всё. При чём, ошибка одна и та же.что тут не верно?
if BtnGetChecked(Comp4Check) then BtnSetChecked(Comp1Check,False) and BtnSetChecked(Comp2Check,False) and BtnSetChecked(Comp3Check,False);
if BtnGetChecked(Comp4Check) then
begin
BtnSetChecked(Comp1Check,False);
BtnSetChecked(Comp2Check,False);
BtnSetChecked(Comp3Check,False);
end;
а что сейчас не так?Почти всё. При чём, ошибка одна и та же.
Это неправильная конструкция:
Код:if BtnGetChecked(Comp4Check) then BtnSetChecked(Comp1Check,False) and BtnSetChecked(Comp2Check,False) and BtnSetChecked(Comp3Check,False);
Это правильная:
Код:if BtnGetChecked(Comp4Check) then begin BtnSetChecked(Comp1Check,False); BtnSetChecked(Comp2Check,False); BtnSetChecked(Comp3Check,False); end;
var
DeleteCheck,BackupCheck,UpdateCheck,NoneCheck: HWND;
DeleteLabel,BackupLabel,UpdateLabel,NoneLabel: TLabel;
//*********************************************************************************************************\\
//=====================УДАЛЕНИЕ ФАЙЛОВ=====================\\
procedure DeleteEnter(hBtn:HWND);
begin
DelTree(ExpandConstant('{app}\res_mods'), True, True, True);
CreateDir(ExpandConstant('{app}\res_mods\{#Patch}'));
end;
//---------------------------------------------------------\\
//=====================БЕКАП ФАЙЛОВ=====================\\
procedure BackupEnter(hBtn:HWND);
begin
MoveDir(ExpandConstant('{app}\res_mods\{#Patch}\'),ExpandConstant('{app}\res_mods\backup\{#Patch}'));
MoveDir(ExpandConstant('{app}\res_mods\xvm\'),ExpandConstant('{app}\res_mods\backup\xvm'));
CreateDir(ExpandConstant('{app}\res_mods\{#Patch}'));
end;
//---------------------------------------------------------\\
//=====================ОБНОВЛЕНИЕ ФАЙЛОВ=====================\\
function MoveFile(const srcFile, destFile: PChar): Integer;
external 'MoveFileA@kernel32.dll stdcall';
procedure UpdateFileEnter(hBtn:HWND);
var
srcFile, destFile: string;
basePath, shortPath: string;
begin
basePath := ExpandConstant('{app}\res_mods');
srcFile := ExpandConstant(CurrentFileName);
shortPath := srcFile;
StringChangeEx(shortPath, basePath, '', True);
destFile := ExpandConstant('{app}\res_mods\Backup') + shortPath;
ForceDirectories(ExtractFilePath(destFile));
MoveFile(PChar(srcFile), PChar(destFile));
end;
//---------------------------------------------------------\\
//()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()\\
//()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()\\
//*********************************************************************************************************\\
//=====================УДАЛЕНИЕ ФАЙЛОВ=====================\\
function Delete: Boolean;
begin
Result:= BtnGetChecked(DeleteCheck);
end;
//---------------------------------------------------------\\
procedure DeleteClick(hBtn:HWND);
begin
if BtnGetChecked(DeleteCheck) then
begin
BtnSetChecked(BackupCheck,False);
BtnSetChecked(UpdateCheck,False);
BtnSetChecked(NoneCheck,False);
end;
end;
//---------------------------------------------------------\\
procedure DeleteLabelClick(Sender:TObject);
begin
BtnSetChecked(DeleteCheck, not BtnGetChecked(DeleteCheck));
if BtnGetChecked(DeleteCheck) then
begin
BtnSetChecked(BackupCheck,False);
BtnSetChecked(UpdateCheck,False);
BtnSetChecked(NoneCheck,False);
end;
DeleteClick(DeleteCheck);
end;
//=====================БЕКАП ФАЙЛОВ=====================\\
function Backup: Boolean;
begin
Result:= BtnGetChecked(BackupCheck);
end;
//---------------------------------------------------------\\
procedure BackupClick(hBtn:HWND);
begin
if BtnGetChecked(BackupCheck) then
begin
BtnSetChecked(DeleteCheck,False);
BtnSetChecked(UpdateCheck,False);
BtnSetChecked(NoneCheck,False);
end;
end;
//---------------------------------------------------------\\
procedure BackupLabelClick(Sender:TObject);
begin
BtnSetChecked(BackupCheck, not BtnGetChecked(BackupCheck));
if BtnGetChecked(BackupCheck) then
begin
BtnSetChecked(DeleteCheck,False);
BtnSetChecked(UpdateCheck,False);
BtnSetChecked(NoneCheck,False);
end;
BackupClick(BackupCheck);
end;
//=====================ОБНОВЛЕНИЕ ФАЙЛОВ=====================\\
function Update: Boolean;
begin
Result:= BtnGetChecked(UpdateCheck);
end;
//---------------------------------------------------------\\
procedure UpdateClick(hBtn:HWND);
begin
if BtnGetChecked(UpdateCheck) then
begin
BtnSetChecked(DeleteCheck,False);
BtnSetChecked(BackupCheck,False);
BtnSetChecked(NoneCheck,False);
end;
end;
//---------------------------------------------------------\\
procedure UpdateLabelClick(Sender:TObject);
begin
BtnSetChecked(UpdateCheck, not BtnGetChecked(UpdateCheck));
if BtnGetChecked(UpdateCheck) then
begin
BtnSetChecked(DeleteCheck,False);
BtnSetChecked(BackupCheck,False);
BtnSetChecked(NoneCheck,False);
end;
UpdateClick(UpdateCheck);
end;
//=====================ОСТАВИТЬ ФАЙЛЫ КАК ЕСТЬ=====================\\
function None: Boolean;
begin
Result:= BtnGetChecked(NoneCheck);
end;
//---------------------------------------------------------\\
procedure NoneClick(hBtn:HWND);
begin
if BtnGetChecked(NoneCheck) then
begin
BtnSetChecked(DeleteCheck,False);
BtnSetChecked(BackupCheck,False);
BtnSetChecked(UpdateCheck,False);
end;
end;
//---------------------------------------------------------\\
procedure NoneLabelClick(Sender:TObject);
begin
BtnSetChecked(NoneCheck, not BtnGetChecked(NoneCheck));
if BtnGetChecked(NoneCheck) then
begin
BtnSetChecked(DeleteCheck,False);
BtnSetChecked(BackupCheck,False);
BtnSetChecked(UpdateCheck,False);
end;
NoneClick(NoneCheck);
end;
//*********************************************************************************************************\\
procedure InitializeWizard1();
begin
//*********************************************************************************************************\\
//=====================УДАЛЕНИЕ ФАЙЛОВ=====================\\
DeleteCheck:=BtnCreate(WizardForm.Handle,ScaleX(30),ScaleY(100),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\RadioBatton.png'),8,True);
BtnSetEvent(DeleteCheck,BtnClickEventID,WrapBtnCallback(@DeleteClick,1));
BtnSetEvent(DeleteCheck,BtnMouseEnterEventID,WrapBtnCallback(@DeleteEnter,1));
BtnSetChecked(DeleteCheck,True);
//------------------------------------------------------------------------------------------------------------\\
DeleteLabel := TLabel.Create(WizardForm);
with DeleteLabel do begin
AutoSize:=False;
SetBounds(ScaleX(60), ScaleY(105), ScaleX(105), ScaleY(17));
OnClick:= @DeleteLabelClick;
Transparent:=True;
Font.Size:= 11;
Font.Color:=$22A4CA;
Caption := 'Удалить файлы'
Parent := WizardForm;
end;
//*********************************************************************************************************\\
//=====================БЕКАП ФАЙЛОВ=====================\\
BackupCheck:=BtnCreate(WizardForm.Handle,ScaleX(30),ScaleY(125),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\RadioBatton.png'),8,True);
BtnSetEvent(BackupCheck,BtnClickEventID,WrapBtnCallback(@BackupClick,1));
BtnSetEvent(BackupCheck,BtnMouseEnterEventID,WrapBtnCallback(@BackupEnter,1));
//------------------------------------------------------------------------------------------------------------\\
BackupLabel := TLabel.Create(WizardForm);
with BackupLabel do begin
AutoSize:=False;
SetBounds(ScaleX(60), ScaleY(130), ScaleX(300), ScaleY(17));
OnClick:= @BackupLabelClick;
Transparent:=True;
Font.Size:= 11;
Font.Color:=$22A4CA;
Caption := 'Сделать резервную копию файлов'
Parent := WizardForm;
end;
//*********************************************************************************************************\\
//=====================ОБНОВЛЕНИЕ ФАЙЛОВ=====================\\
UpdateCheck:=BtnCreate(WizardForm.Handle,ScaleX(30),ScaleY(150),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\RadioBatton.png'),8,True);
BtnSetEvent(UpdateCheck,BtnClickEventID,WrapBtnCallback(@UpdateClick,1));
BtnSetEvent(UpdateCheck,BtnMouseEnterEventID,WrapBtnCallback(@UpdateFileEnter,1));
//------------------------------------------------------------------------------------------------------------\\
UpdateLabel := TLabel.Create(WizardForm);
with UpdateLabel do begin
AutoSize:=False;
SetBounds(ScaleX(60), ScaleY(155), ScaleX(300), ScaleY(17));
OnClick:= @UpdateLabelClick;
Transparent:=True;
Font.Size:= 11;
Font.Color:=$22A4CA;
Caption := 'Обновить существующие файлы'
Parent := WizardForm;
end;
//*********************************************************************************************************\\
//=====================ОСТАВИТЬ ФАЙЛЫ КАК ЕСТЬ=====================\\
NoneCheck:=BtnCreate(WizardForm.Handle,ScaleX(30),ScaleY(175),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\RadioBatton.png'),8,True);
BtnSetEvent(NoneCheck,BtnClickEventID,WrapBtnCallback(@NoneClick,1));
//------------------------------------------------------------------------------------------------------------\\
NoneLabel := TLabel.Create(WizardForm);
with NoneLabel do begin
AutoSize:=False;
SetBounds(ScaleX(60), ScaleY(180), ScaleX(150), ScaleY(17));
OnClick:= @NoneLabelClick;
Transparent:=True;
Font.Size:= 11;
Font.Color:=$22A4CA;
Caption := 'Ничего не трогать'
Parent := WizardForm;
end;
end;
//*********************************************************************************************************\\
Где?а что сейчас не так?
во всем коде
Конкретно на какой строке ошибка. Или прикрепляй архив со всем проектом, чтобы не собирать всё самому по кускам.во всем коде
Лучше CurPage.как еще задать в курстеп все процедуры,что бы они выполнялись перед установкой?
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
ComponentsListBtnImageFile=btnimage.bmp
[Components]
Name: text; Description: Язык субтитров; Types: full;
Name: text\rus; Description: Русский; Flags: exclusive;
Name: text\eng; Description: Английский; Flags: exclusive;
Name: voice; Description: Язык озвучки; Types: full;
Name: voice\rus; Description: Русский; Flags: exclusive;
Name: voice\eng; Description: Английский; Flags: exclusive;
Похоже, быть бедным снова...!