Пользователь
Сообщения: 128
Благодарности: 22
|
Профиль
|
Отправить PM
| Цитировать
Доброе утро всем. почему у меня не получается приделать вот этот пример = " когда после установки игры, если ещё раз хочешь запустить установку автоматом, то запускается деинсталлятор?"
читать дальше »
В секции [Setup] генерируешь appid (например AppID={{0872DB47-24CB-4C7F-AC4B-E6EFC27BD244}),
в секцию добавляешь следущее:
[_Code]
var
ResultStr:string;
ResultCode: Integer;
function InitializeSetup(): Boolean;
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0872DB47-24CB-4C7F-AC4B-E6EFC27BD244}_is1', 'UninstallString', ResultStr)
if ResultStr='' then
begin
Result := True;
end
else
ResultStr:=RemoveQuotes(ResultStr);
Exec(ResultStr, '', '', SW_SHOWNORMAL, ewNoWait, ResultCode)
end;
этот пример я не могу приделать (использовать) именно в этом скрипте, или запускается и установка и удаление или ошибка "runtime error couldn't...." подскажите что и где делаю не так
читать дальше »
#define MyAppName "Assassin's Creed III"
#define MyAppVerName "Assassin's Creed III [v 1.01]"
#define NeedSize 10752
#define Components
;#define records
;#define facompress
;#define PrecompInside
#define SrepInside
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppName}
AppPublisher=Fakt_37
DefaultDirName={pf}\Fakt_37\{#MyAppName}
DefaultGroupName=Fakt_37\{#MyAppName}
DirExistsWarning=no
AppID={{0872DB47-24CB-4C7F-AC4B-E6EFC27BD244}
VersionInfoDescription={#MyAppName}
DisableReadyPage=yes
LZMAAlgorithm=1
LZMAMatchFinder=BT
LZMANumFastBytes=273
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[CustomMessages]
rus.Welcome=Вас приветствует Мастер установки игры «{#MyAppName}» %nРекомендуется закрыть антивирусные программы, а также все прочие приложения перед тем, как продолжить.%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки.
rus.Dir1=Программа установит «{#MyAppName}» в следующую папку.
rus.Group1=Программа создаст ярлыки в следующей папке меню «Пуск».
rus.FreeSpace=Доступно места на диске:
rus.NeedSpace=Требуется места для установки:
rus.nic=Не создавать папку в меню «Пуск»
rus.Fin=%nУстановка игры «{#MyAppName}» успешно завершена. %nНажмите "Завершить", чтобы выйти из программы установки.
rus.FinError=Установка игры «{#MyAppName}» не завершена. %nВо время установки произошла ошибка, пожалуйста отключите сторонние программы и повторите попытку установки. %nНажмите "Завершить", чтобы выйти из программы установки.
rus.Extracted=Распаковка файлов...
rus.rbc=Откат установки...
rus.Dir2=Нажмите «Далее», чтобы продолжить. Если Вы хотите выбрать другую папку, нажмите «Обзор»
#ifdef Components
[Registry]
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Components]
Name: Dector; Description: Дополнительные ярлыки:; Types: full
Name: Dector\a; Description: Добавить ярлык на рабочий стол; Types: full
Name: PO; Description: Дополнительное програмное обеспечения:; Types: full
Name: PO\a; Description: Обновить DirectX; Types: full
Name: PO\b; Description: Установить/обновить Microsoft Visual C++; Types: full
Name: PO\c; Description: Установить/обновить Microsoft Visual C++; Types: full
#endif
[Files]
Source: Files\fon.png; Flags: dontcopy
Source: Files\pb1.png; Flags: dontcopy
Source: Files\pb2.png; Flags: dontcopy
Source: Files\1.bmp; Flags: dontcopy
Source: Files\form.png; Flags: dontcopy
Source: Files\form1.png; Flags: dontcopy
Source: Files\logo.png; Flags: dontcopy
Source: Files\button.png; Flags: dontcopy
Source: dll\*.*; Flags: dontcopy
Source: ISDone\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\ISDone.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PrecompInside
Source: ISDone\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\precomp.exe; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef SrepInside
Source: ISDone\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef facompress
Source: ISDone\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif
[Icons]
Name: {userdesktop}\{#MyAppName}; Filename: {app}\AC3SP.exe; WorkingDir: {app}; IconFilename: {app}\AC3SP.exe; Components: Dector\a; Check: CheckError
Name: {group}\{#MyAppName}; Filename: {app}\AC3SP.exe; WorkingDir: {app}; IconFilename: {app}\AC3SP.exe; Comment: Запустить игру; Check: CheckError
Name: {group}\Удалить игру; Filename: {uninstallexe}; Comment: Удалить игру; Check: CheckError
[Run]
Filename: {src}\Redist\directx.exe; WorkingDir: {src}\Redist\; Parameters: /Q; Flags: waituntilterminated runminimized; Components: PO\a; Check: CheckError
Filename: {src}\Redist\vcredist_x86.exe; WorkingDir: {src}\Redist\; Parameters: /Q; Flags: waituntilterminated; Components: PO\b; Check: CheckError
Filename: {src}\Redist\PhysX.msi; Parameters: /Q; WorkingDir: {src}\Redist; Components: PO\c; Check: CheckError
[code]
const
PCFonFLY=true;
notPCFonFLY=false;
var
Enabled: Boolean;
hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn: HWND;
Welcomelbl1, Selectlbl1, Selectlbl2, MainLabel, Mb1, Mb2, NoIconsLabel, islbl1, islbl2, islbl3: TLabel;
WFButtonFont: TFont;
form, form1: Longint;
NoIconsCheck: TNewCheckBox;
IntList, VoiceList: TNewCheckListBox;
ISDoneCancel: Integer;
ISDoneError: Boolean;
PCFVer: Double;
s: AnsiString;
function ReleaseCapture: Longint; external 'ReleaseCapture@user32.dll stdcall';
procedure LabelOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
SendMessage(WizardForm.Handle, $0112, $F012, 0)
end;
#include "AddIss\botva2.iss"
#include "AddIss\progressbar.iss"
var
ISDonePB: TImgPB;
function InitializeSetup:boolean;
begin
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
if not FileExists(ExpandConstant('{tmp}\b2p.dll')) then ExtractTemporaryFile('b2p.dll');
Result:=True;
end;
function cm(s: PAnsiChar): String;
begin
Result:= ExpandConstant('{cm:'+s+'}');
end;
type
TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
function WrapCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:ISDone.dll stdcall delayload';
function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean; external 'ISArcExtract@files:ISDone.dll stdcall delayload';
function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'ISRarExtract@files:ISDone.dll stdcall delayload';
function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean; external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean; external 'ISPackZIP@files:ISDone.dll stdcall delayload';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';
function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean; external 'Exec2@files:ISDone.dll stdcall delayload';
function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer; external 'ISFindFiles@files:ISDone.dll stdcall delayload';
function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean; external 'ISPickFilename@files:ISDone.dll stdcall delayload';
function ISGetName(TypeStr:integer):PAnsichar; external 'ISGetName@files:ISDone.dll stdcall delayload';
function ISFindFree(FindHandle:integer):boolean; external 'ISFindFree@files:ISDone.dll stdcall delayload';
function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean; external 'ISExec@files:ISDone.dll stdcall delayload';
function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean; external 'SrepInit@files:ISDone.dll stdcall delayload';
function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean; external 'PrecompInit@files:ISDone.dll stdcall delayload';
function FileSearchInit(RecursiveSubDir:boolean):boolean; external 'FileSearchInit@files:ISDone.dll stdcall delayload';
function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean; external 'ISDoneInit@files:ISDone.dll stdcall';
function ISDoneStop:boolean; external 'ISDoneStop@files:ISDone.dll stdcall';
function ChangeLanguage(Language:AnsiString):boolean; external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
function SuspendProc:boolean; external 'SuspendProc@files:ISDone.dll stdcall';
function ResumeProc:boolean; external 'ResumeProc@files:ISDone.dll stdcall';
function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
if OveralPct<=1000 then ImgPBSetPosition(ISDonePB, OveralPct);
WizardForm.Caption:= s + ' - ' + IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
islbl1.Caption:= cm('Extracted') + ' ' + IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
islbl2.Caption:= MinimizePathName(ExpandConstant('{app}\')+CurrentFile, islbl2.Font, ScaleX(400));
Result := ISDoneCancel;
end;
procedure CancelButtonOnClick(hBtn: HWND);
begin
SuspendProc;
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then begin
ISDoneCancel:=1;
islbl1.Caption:= cm('rbc');
end;
ResumeProc;
end;
function CheckError:boolean;
begin
Result:= not ISDoneError;
end;
procedure CreateWizardImg;
begin
with WizardForm do begin
ClientWidth:=ScaleX(623);
ClientHeight:=ScaleY(382);
InnerNotebook.Hide;
OuterNotebook.Hide;
Bevel.Hide;
Center;
Color:= $191919;
end;
ImgLoad(WizardForm.Handle, 'fon.png', ScaleX(0), ScaleY(0), WizardForm.ClientWidth, WizardForm.ClientHeight, True, True);
form:= ImgLoad(WizardForm.Handle, 'form.png', ScaleX(0), ScaleY(0), WizardForm.ClientWidth, WizardForm.ClientHeight, True, True);
form1:= ImgLoad(WizardForm.Handle, 'form1.png', ScaleX(0), ScaleY(0), WizardForm.ClientWidth, WizardForm.ClientHeight, True, True);
ImgLoad(WizardForm.Handle, 'logo.png', ScaleX(20), ScaleY(326), ScaleX(190), ScaleY(39), True, True);
ImgSetVisibility(form1, false);
ImgApplyChanges(WizardForm.Handle);
end;
procedure SetStateNewButtons;
begin
with WizardForm.BackButton do begin
BtnSetText(hBackBtn,PAnsiChar(Caption));
BtnSetVisibility(hBackBtn,Visible);
BtnSetEnabled(hBackBtn,Enabled);
end;
with WizardForm.NextButton do begin
BtnSetText(hNextBtn,PAnsiChar(Caption));
BtnSetVisibility(hNextBtn,Visible);
BtnSetEnabled(hNextBtn,Enabled);
end;
with WizardForm.CancelButton do begin
BtnSetText(hCancelBtn,PAnsiChar(Caption));
BtnSetVisibility(hCancelBtn,Visible);
BtnSetEnabled(hCancelBtn,Enabled);
end;
BtnSetText(hDirBrowseBtn,PAnsiChar(WizardForm.DirBrowseButton.Caption));
BtnSetText(hGroupBrowseBtn,PAnsiChar(WizardForm.GroupBrowseButton.Caption));
end;
procedure WizardFormBtnClick(hBtn:HWND);
var
Btn: TButton;
begin
case hBtn of
hCancelBtn: Btn:=WizardForm.CancelButton;
hNextBtn: Btn:=WizardForm.NextButton;
hBackBtn: Btn:=WizardForm.BackButton;
hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton;
end;
Btn.OnClick(Btn);
SetStateNewButtons;
BtnRefresh(hBtn);
end;
procedure NoIconsCheckClick(Sender: TObject);
begin
if NoIconsCheck.Checked then begin
WizardForm.GroupEdit.Enabled:= false;
WizardForm.GroupBrowseButton.Enabled:= false;
BtnSetEnabled(hGroupBrowseBtn, false);
end else begin
WizardForm.GroupEdit.Enabled:= true;
WizardForm.GroupBrowseButton.Enabled:= true;
BtnSetEnabled(hGroupBrowseBtn, true);
end;
WizardForm.NoIconsCheck.Checked:= NoIconsCheck.Checked;
WizardForm.GroupEdit.Color:= clblack;
end;
procedure NoIconsLabelClick(Sender: TObject);
begin
NoIconsCheck.Checked:= not NoIconsCheck.Checked;
NoIconsCheckClick(nil);
end;
procedure ButtonsTextures;
begin
WFButtonFont:=TFont.Create;
WFButtonFont.Style:=[fsBold];
WFButtonFont.Name:= 'Arial';
WFButtonFont.Size:= 8;
with WizardForm.BackButton do begin
hBackBtn:= BtnCreate(WizardForm.Handle, ScaleX(Left+28), ScaleY(Top+3), ScaleX(100), ScaleY(35), 'button.png', 1, False);
BtnSetEvent(hBackBtn, BtnClickEventID, CallbackAddr('WizardFormBtnClick'));
BtnSetFont(hBackBtn, WFButtonFont.Handle);
BtnSetFontColor(hBackBtn, clblack, clblack, clblack, clblack);
Width:=0;
Height:=0;
end;
with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle, ScaleX(Left+55), ScaleY(Top+3), ScaleX(100), ScaleY(35), 'button.png', 1, False);
BtnSetEvent(hNextBtn,BtnClickEventID, CallbackAddr('WizardFormBtnClick'));
BtnSetFont(hNextBtn,WFButtonFont.Handle);
BtnSetFontColor(hNextBtn, clblack, clblack, clblack, clblack);
Width:=0;
Height:=0;
end;
with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle, ScaleX(Left+85), ScaleY(Top+3), ScaleX(100), ScaleY(35), 'button.png', 1, False);
BtnSetEvent(hCancelBtn,BtnClickEventID, CallbackAddr('WizardFormBtnClick'));
BtnSetFont(hCancelBtn,WFButtonFont.Handle);
BtnSetFontColor(hCancelBtn, clblack, clblack, clblack, clblack);
Width:=0;
Height:=0;
end;
with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle, ScaleX(Left+90), ScaleY(Top+164), ScaleX(100), ScaleY(35), 'button.png', 1, False);
BtnSetEvent(hDirBrowseBtn,BtnClickEventID, CallbackAddr('WizardFormBtnClick'));
BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hDirBrowseBtn, clblack, clblack, clblack, clblack);
Width:=0;
Height:=0;
end;
with WizardForm.GroupBrowseButton do begin
hGroupBrowseBtn:=BtnCreate(WizardForm.Handle, ScaleX(Left+90), ScaleY(Top+164), ScaleX(100), ScaleY(35), 'button.png', 1, False);
BtnSetEvent(hGroupBrowseBtn,BtnClickEventID, CallbackAddr('WizardFormBtnClick'));
BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hGroupBrowseBtn, clblack, clblack, clblack, clblack);
Width:=0;
Height:=0;
end;
end;
function NumToStr(Float: Extended): string;
begin
Result:=Format('%.2n', [Float]);
StringChange(Result, ',', '.');
while ((Result[Length(Result)]='0') or (Result[Length(Result)]='.')) and (Pos('.',Result)>0) do SetLength(Result,Length(Result)-1);
end;
function MbOrTB(Float: Extended): string;
begin
if Float<1024 then Result:=NumToStr(Float)+' MB'
else if (Float/1024)<1024 then Result:=NumToStr(Float/1024)+' GB'
else if (Float/(1024*1024))<1024 then Result:=NumToStr(Float/(1024*1024))+' TB'
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Enable: Boolean;
Path: AnsiString;
FreeMB, TotalMB: Cardinal;
begin
Path:= ExtractFileDrive(WizardForm.DirEdit.Text);
Enable:= GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if not Enable then begin
mb1.Caption:= cm('FreeSpace') + ' ' + '0 Мб';
mb2.Caption:= cm('NeedSpace') + ' ' + MborTb({#NeedSize});
WizardForm.NextButton.Enabled:= false;
BtnSetEnabled(hNextBtn, false);
Exit;
end;
if Enable then begin
mb1.Caption:= cm('FreeSpace') + ' ' + MbOrTb(FreeMB);
mb2.Caption:= cm('NeedSpace') + ' ' + MborTb({#NeedSize});
WizardForm.NextButton.Enabled:= true;
BtnSetEnabled(hNextBtn, true);
end;
if FreeMB < {#NeedSize} then begin WizardForm.NextButton.Enabled:= false; BtnSetEnabled(hNextBtn, false); end else begin WizardForm.NextButton.Enabled:= true; BtnSetEnabled(hNextBtn, true); end;
end;
procedure CreateLabel;
begin
Welcomelbl1:= TLabel.Create(WizardForm);
with Welcomelbl1 do
begin
Left:= ScaleX(80);
Top:= ScaleY(244);
Width:= ScaleX(450);
Height:= ScaleY(450);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Color:= clwhite;
Font.Style := [fsBold];
Alignment := taCenter;
Parent:= WizardForm;
Caption:= cm('Welcome');
end;
with WizardForm.DirEdit do begin
Parent:= WizardForm;
Left:= ScaleX(100);
Top:= ScaleY(250);
Color:= clblack;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:= clwhite;
Width:= ScaleX(324);
Height:= ScaleY(18);
end;
with WizardForm.GroupEdit do begin
Parent:= WizardForm;
Left:= ScaleX(100);
Top:= ScaleY(250);
Color:= clblack;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:= clwhite;
Width:= ScaleX(324);
Height:= ScaleY(18);
end;
Selectlbl1:=TLabel.Create(WizardForm);
with Selectlbl1 do
begin
Left:= ScaleX(100);
Top:= ScaleY(200);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= clwhite;
Parent:= WizardForm;
Caption:= cm('dir1');
end;
Selectlbl2:=TLabel.Create(WizardForm);
with Selectlbl2 do
begin
Left:= ScaleX(100);
Top:= ScaleY(216);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= clwhite;
Parent:= WizardForm;
Caption:= cm('dir2');
end;
mb1:=TLabel.Create(WizardForm);
with mb1 do
begin
Left:= ScaleX(100);
Top:= ScaleY(278);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= clwhite;
Parent:= WizardForm;
end;
mb2:=TLabel.Create(WizardForm);
with mb2 do
begin
Left:= ScaleX(100);
Top:= ScaleY(295);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= clwhite;
Parent:= WizardForm;
end;
WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
NoIconsCheck:= TNewCheckbox.Create(WizardForm);
with NoIconsCheck do
begin
Left:= ScaleX(100);
Top:= ScaleY(280);
Width:= ScaleX(13);
Height:= ScaleY(13);
Parent:= WizardForm;
OnClick:= @NoIconsCheckClick;
end;
ExtractTemporaryFile('1.bmp');
with WizardForm.ComponentsList do begin
LoadBGBmpFromFile(ExpandConstant('{tmp}\1.bmp'), Left+100, Top+150);
Parent:= WizardForm;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Font.Color:= clwhite;
left:= ScaleX(100);
BorderStyle:= bsNone;
Top:= ScaleY(200);
Height:= Height - 50;
end;
DeleteFile(ExpandConstant('{tmp}\1.bmp'));
islbl1:=TLabel.Create(WizardForm);
with islbl1 do
begin
Left:= ScaleX(100);
Top:= ScaleY(255);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= clwhite;
Parent:= WizardForm;
Caption:= cm('Extracted');
end;
islbl2:=TLabel.Create(WizardForm);
with islbl2 do
begin
Left:= ScaleX(100);
Top:= ScaleY(270);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= clwhite;
Parent:= WizardForm;
end;
NoIconsLabel:=TLabel.Create(WizardForm);
with NoIconsLabel do
begin
Left:= ScaleX(120);
Top:= ScaleY(280);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= clwhite;
Parent:= WizardForm;
Caption:= cm('nic');
OnClick:= @NoIconsLabelClick;
end;
end;
procedure InitializeWizard;
begin
s:= WizardForm.Caption;
Enabled:= true;
CreateLabel;
CreateWizardImg;
ButtonsTextures;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
SetStateNewButtons;
Welcomelbl1.Hide;
WizardForm.DirEdit.Hide;
WizardForm.GroupEdit.Hide;
Selectlbl1.Hide;
Selectlbl2.Hide;
BtnSetVisibility(hDirBrowseBtn, false);
BtnSetVisibility(hGroupBrowseBtn, false);
mb1.Hide;
mb2.Hide;
NoIconsCheck.Hide;
NoIconsLabel.Hide;
WizardForm.ComponentsList.Hide;
islbl1.Hide;
if CurPageID = wpWelcome then
begin
Welcomelbl1.Show;
ImgSetVisibility(form, true);
ImgSetVisibility(form1, false);
end;
if CurPageID = wpSelectDir then
begin
GetFreeSpaceCaption(nil);
Selectlbl2.Caption:= cm('Dir2');
WizardForm.DirEdit.Show;
Selectlbl1.Show;
Selectlbl1.Caption:= cm('Dir1');
Selectlbl2.Show;
BtnSetVisibility(hDirBrowseBtn, true);
ImgSetVisibility(form1, true);
ImgSetVisibility(form, false);
mb1.Show;
mb2.Show;
end;
if CurPageID = wpSelectComponents then WizardForm.ComponentsList.Show;
if CurPageID = wpSelectProgramGroup then
begin
Selectlbl1.Caption:= cm('Group1');
Selectlbl1.Show;
Selectlbl2.Show;
Selectlbl2.Caption:= cm('Dir2');
WizardForm.GroupEdit.Show;
BtnSetVisibility(hGroupBrowseBtn, true);
NoIconsCheck.Show;
NoIconsLabel.Show;
WizardForm.NextButton.Caption:= 'Установить';
end;
if CurPageID = wpSelectTasks then
begin
end;
if CurPageID = wpReady then
begin
ImgSetVisibility(form1, true);
end;
if CurPageID = wpInstalling then
begin
ImgSetVisibility(form, true);
ImgSetVisibility(form1, false);
islbl1.Show;
end;
if CurPageID = wpFinished then
begin
ImgSetVisibility(form, true);
islbl2.Hide;
Welcomelbl1.Show;
Welcomelbl1.Caption:= cm('Fin');
Welcomelbl1.Top:= Welcomelbl1.Top+ScaleY(5);
end;
if (CurPageID = wpFinished) and ISDoneError then
begin
Welcomelbl1.Show;
Welcomelbl1.Font.Color:= clred;
Welcomelbl1.Caption:= cm('FinError');
end;
ImgApplyChanges(WizardForm.Handle);
end;
procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:cardinal;
FindHandle1,ColFiles1,CurIndex1,tmp:integer;
ExecError:boolean;
InFilePath,OutFilePath,OutFileName:PAnsiChar;
begin
if CurStep = ssInstall then begin
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Hide;
ISDonePB:= ImgPBCreate(WizardForm.Handle, ExpandConstant('pb2.png'),ExpandConstant('pb1.png'), ScaleX(100), ScaleY(290), ScaleX(420), ScaleY(19));
WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
ISDoneCancel:=0;
ExtractTemporaryFile('unarc.dll');
#ifdef PrecompInside
ExtractTemporaryFile('CLS-precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('packjpg_dll1.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif
#ifdef facompress
ExtractTemporaryFile('facompress.dll');
#endif
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
Comps1:=0; Comps2:=0; Comps3:=0;
#ifdef Components
TmpValue:=1;
if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue;
TmpValue:=TmpValue*2;
if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue;
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\rus') then Comps1:=Comps1+TmpValue;
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue;
#endif
#ifdef precomp
PCFVer:={#precomp};
#else
PCFVer:=0;
#endif
ISDoneError:=true;
if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, 0, @ProgressCallback) then begin
repeat
if not SrepInit('',512,0) then break;
if not PrecompInit('',128,PCFVer) then break;
if not FileSearchInit(true) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data-1.fakt'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data-2.fakt'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data-3.fakt'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data-4.fakt'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
if not ShowChangeDiskWindow ('Пожалуйста, вставьте второй диск и дождитесь его инициализации.', ExpandConstant('{src}'),'sound.fakt') then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\sound.fakt'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\video.fakt'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
(*
*)
ISDoneError:=false;
until true;
ImgPBDelete(ISDonePB);
islbl2.Hide;
islbl1.Caption:= SetupMessage(msgStatusRunProgram);
ISDoneStop;
end;
WizardForm.CancelButton.Visible:=true;
WizardForm.CancelButton.Enabled:=false;
end;
if (CurStep=ssPostInstall) and ISDoneError then begin
Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
end;
end;
procedure DeinitializeSetup;
begin
if Enabled then gdipShutdown;
WizardForm.Free;
end;
|