подскажите как исправить
[more=Вот скрипт]
Код: #define MyAppName "Prince of Persia: Warrior Within"
#define AppName "Prince of Persia: Warrior Within"
#define NeedSize "4000000000"
#define records
;#define precomp04
#define precomp038
;#define unrar
[Setup]
AppId={{DDA55E82-39A4-4692-999D-4B2A363241CE}
AppName={#AppName}
AppVerName={#MyAppName}
DefaultDirName={pf}\Prince of Persia Warrior Within
DefaultGroupName=Prince of Persia Warrior Within
DirExistsWarning=no
OutputBaseFilename=setup
;InternalCompressLevel=ultra64
;Compression=lzma/ultra64
;SolidCompression=true
SetupIconFile=Files\icon.ico
DisableReadyPage=True
DiskSpanning=true
DiskSliceSize=1063004405
SlicesPerDisk=3
WizardImageFile=Files\1.bmp
WizardImageStretch=False
WizardSmallImageFile=Files\smallimage.bmp
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
[Files]
Source: Files\button.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Files\1.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Files\2.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Files\1.cjstyles; DestDir: {tmp}; Flags: dontcopy
Source: Files\logo.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Files\ISSkin.dll; DestDir: {tmp}; Flags: dontcopy
;Source: Files\isgsg.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp04
Source: Files\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\precomp04.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp038
Source: Files\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef unrar
Source: Files\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#include "Messages.iss"
[CustomMessages]
rus.ExtractedFile=Ðàñïàêîâûâàåòñÿ ôàéë:
rus.CancelButton=Îòìåíèòü ðàñïàêîâêó
rus.Error=Îøèáêà ðàñïàêîâêè!
[Registry]
Root: HKLM; SubKey: SOFTWARE\Ubisoft\Prince of Persia Warrior Within\1.00.999; ValueType: string; ValueName: Product_Path; ValueData: {app}; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Ubisoft\Prince of Persia Warrior Within\1.00.999; ValueType: string; ValueName: Product_Executable; ValueData: PrinceOfPersia.exe; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Ubisoft\Prince of Persia Warrior Within\1.00.999; ValueType: string; ValueName: Product_Language; ValueData: 9; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Ubisoft\Prince of Persia Warrior Within\1.00.999; ValueType: string; ValueName: Product_Release; ValueData: Retail EMEA; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Ubisoft\Prince of Persia Warrior Within\1.00.999; ValueType: string; ValueName: Profiles_Path; ValueData: C:\ProgramData; Flags: uninsdeletevalue uninsdeletekeyifempty
[Run]
Filename: {src}\Redist\DXSETUP.exe; WorkingDir: {src}\Redist\;StatusMsg:"Óñòàíîâêà DirectX"; Flags:waituntilterminated; BeforeInstall:;
[Icons]
Name: "{group}\Prince of Persia Warrior Within"; IconFilename: {app}\PrinceOfPersia.EXE; Filename: {app}\PrinceOfPersia.EXE;Comment: Çàïóñê èãðû;
Name: "{userdesktop}\Prince of Persia Warrior Within"; IconFilename: {app}\PrinceOfPersia.EXE; Filename: {app}\PrinceOfPersia.EXE;Comment: Çàïóñê èãðû;
[Code_]
const
ButtonWidth = 80;
ButtonHeight = 23;
bidBack = 0;
bidNext = 1;
bidCancel = 2;
bidDirBrowse = 3;
bidGroupBrowse = 4;
//***********************Ïåðåìåííûå***********************\\
var
MainImage : TBitmapImage;
FinishedImage: TBitmapImage;
WelcomeLabel1, WelcomeLabel2,FinishedLabel, FinishedHeadingLabel: TLabel;
LabelPct,LabelCurrFileName: TLabel;
ISDoneProgressBar: TNewProgressBar;
MyCancelButton: TButton;
OveralPct,Cancel:integer;
CallBack:longword;
MyError:boolean;
BtnPanel: TPanel;
BtnImage: TBitmapImage;
//***********************Êîíåö-Ïåðåìåííûå***********************\\
type
TCallback = function (Pct: integer;CurrentFile:string): longword;
TMessage = record hWnd: HWND; msg, wParam: Word; lParam: LongWord; Time: TFileTime; pt: TPoint; end;
function PeekMessage(var lpMsg: TMessage; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: TMessage): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: TMessage): Longint; external 'DispatchMessageA@user32.dll stdcall';
function WrapMyCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:innocallback.dll stdcall';
function ISArcExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password, CfgFile, WorkPath: AnsiString):BOOL; external 'ISArcExtract@files:ISDone.dll stdcall';
function IS7ZipExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password: AnsiString):BOOL; external 'IS7zipExtract@files:ISDone.dll stdcall';
function ISRarExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password: AnsiString):BOOL; external 'ISRarExtract@files:ISDone.dll stdcall';
function ISPrecompExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISPrecompExtract@files:ISDone.dll stdcall';
function ISSRepExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile, IdxFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISSrepExtract@files:ISDone.dll stdcall';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):BOOL; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall';
function StartRecord(RecordFileName:AnsiString; AllComponents:longword):BOOL; external 'StartRecord@files:ISDone.dll stdcall';
function CheckPoint(CurComponent:Integer):BOOL; external 'CheckPoint@files:ISDone.dll stdcall';
function StopRecord:BOOL; external 'StopRecord@files:ISDone.dll stdcall';
function ProgressCallback(Pct: integer; CurrentFile:AnsiString): longword;
var Msg: TMessage;
begin
if Pct<=ISDoneProgressBar.Max then
ISDoneProgressBar.Position := Pct;
LabelPct.Caption := IntToStr(Pct div 10)+'.'+chr(48 + Pct mod 10)+'%';
LabelCurrFileName.Caption :=ExpandConstant('{cm:ExtractedFile} ')+CurrentFile;
while PeekMessage(Msg, 0, 0, 0, 1) do begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
Result := Cancel;
end;
//***********************Íà÷àëî-ñêèí***********************\\
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';
procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('1.cjstyles');
LoadSkin(ExpandConstant('{tmp}\1.cjstyles'), '');
Result := True;
end;
procedure DeinitializeSetup();
begin
UnloadSkin();
end;
//***********************Êîíåö-ñêèí***********************\\
procedure urlbuttonclick(sender:tobject);
var rescode:Integer;
begin
shellexec('open', 'http://www.flibustierka.com/', '', '',sw_shownormal, ewnowait, rescode)
end;
//***********************Èçîáðàæåíèå èíñòàëà***********************\\
procedure InitializeWizard();
begin
ExtractTemporaryFile('1.bmp');
MainImage := TBitmapImage.Create(WizardForm);
with MainImage do
begin
Parent := WizardForm;
Left := 0;
Top := 0;
Width := 500;
Height := 313;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
begin
with WizardForm do begin
with MainPanel do
Height := Height - 1;
with WizardSmallBitmapImage do begin
Left := 0;
Top := 0;
Height := 58; //Ðàçìåð ðèñóíêà
Width := 497; //
end;
with PageNameLabel do begin
Width := Width - 497; //Ïîñòàâüòå çäåñü çíà÷åíèÿ íà 0, åñëè õîòèòå âåðíóòü òåêñò
Left := Left + 497; //
end;
with PageDescriptionLabel do begin
Width := Width - 497; //Ïîñòàâüòå çäåñü çíà÷åíèÿ íà 0, åñëè õîòèòå âåðíóòü òåêñò
Left := Left + 497; //
begin
BtnPanel:=TPanel.Create(WizardForm)
with BtnPanel do begin
Left:=5
Top:=320
Width:=180
Height:=39
Cursor:=crHand
onclick:=@urlbuttonclick;
Parent:=WizardForm
end
BtnImage:=TBitmapImage.Create(WizardForm)
with BtnImage do begin
AutoSize:=True
Enabled:=False
ExtractTemporaryFile('Logo.bmp')
Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Logo.bmp')
Parent:=BtnPanel
end
end;
begin
ISDoneProgressBar := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar do begin
Left := ScaleX(0);
Top := ScaleY(40);
Width := ScaleX(417);
Max := 1000;
Height := WizardForm.ProgressGauge.Height;
Parent := WizardForm.InstallingPage;
end;
LabelPct := TLabel.Create(WizardForm);
with LabelPct do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Top := WizardForm.ProgressGauge.Top + ScaleY(40);
Alignment := taCenter;
Caption := '';
end;
LabelCurrFileName := TLabel.Create(WizardForm);
with LabelCurrFileName do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Left := ScaleX(0);
Top := WizardForm.ProgressGauge.Top + ScaleY(25);
Caption := '';
end;
end;
end;
end;
end;
end;
ExtractTemporaryFile('2.bmp');
FinishedImage := TBitmapImage.Create(WizardForm);
with FinishedImage do
begin
Parent := WizardForm;
Left := 0;
Top := 0;
Width := 500;
Height := 313;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp'));
end;
//WelcomePage, ñîçäàåì íàäïèñè íà ñòðàíèöå
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
Left:= ScaleX(176);
Top:= ScaleY(66);
Width:= ScaleX(301);
Height:= ScaleY(71);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Size:= 14;
Font.Color:=ClBlack
Font.Style := [fsBold]
Parent:= WizardForm;
Font.Name:= 'Georgia'
Caption:= WizardForm.WelcomeLabel1.Caption;
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
Top:= ScaleY(136);
Left:= ScaleX(176);
Width:= ScaleX(301);
Height:= ScaleY(300);
AutoSize:= false;
WordWrap:= true;
Font.Color:=ClBlack
Font.Name:= 'Georgia'
Font.Size:= 10;
Transparent:= true;
Parent:= WizardForm;
Caption:= WizardForm.WelcomeLabel2.Caption;
end;
FinishedHeadingLabel:=TLabel.Create(WizardForm);
with FinishedHeadingLabel do
begin
Top:= ScaleY(66);
Left:= ScaleX(176);
Width:= ScaleX(301);
Height:= ScaleY(70);
AutoSize:= false;
WordWrap:= true;
Font.Size:= 12;
Font.Color:=ClBlack
Font.Name:= 'Georgia'
Font.Style := [fsBold]
Transparent:= true;
Parent:= WizardForm;
Caption:= WizardForm.FinishedHeadingLabel.Caption;
end;
FinishedLabel:= TLabel.Create(WizardForm);
with FinishedLabel do
begin
Left:= ScaleX(176);
Top:= ScaleY(140);
Width:= ScaleX(301);
Height:= ScaleY(540);
AutoSize:= false;
WordWrap:= true;
Transparent:= true;
Font.Color:=ClBlack
Font.Size:= 10;
Font.Name:= 'Georgia'
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:FinishedLabel}') + ExpandConstant(' {cm:FinishedLabel2}')
end;
end;
procedure HideComponents;
begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
end;
procedure ShowComponents(CurPageID: Integer);
begin
case CurPageID of
wpWelcome:
begin
WelcomeLabel1.Show
WelcomeLabel2.Show
end;
wpFinished:
begin
FinishedHeadingLabel.Show;
FinishedLabel.Show;
end;
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
HideComponents;
ShowComponents(CurPageID);
if CurPageID = wpWelcome then
begin
WizardForm.OuterNotebook.Hide;
FinishedImage.Hide;
end
else if CurPageID = wpFinished then
begin
WizardForm.OuterNotebook.Hide;
MainImage.Hide;
FinishedImage.Show;
end
else WizardForm.OuterNotebook.Show;
Begin
if (CurPageID = wpFinished) and MyError then
begin
WizardForm.Caption:= ExpandConstant('{cm:Error}');
WizardForm.FinishedLabel.Font.Color:= clRed;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var ChComp, TmpValue:longword;
n:integer;
begin
if CurStep = ssInstall then begin //Åñëè íåîáõîäèìî, ìîæíî ïåðåäåëàòü íà ssPostInstall
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Visible:=false;
MyCancelButton:=TButton.Create(WizardForm);
with MyCancelButton do begin
Parent:=WizardForm;
Width:=ScaleX(135);
Caption:=ExpandConstant('{cm:CancelButton}');
Left:=ScaleX(360);
Top:=WizardForm.cancelbutton.top;
OnClick:=@CancelButtonOnClick;
end;
CallBack:=WrapMyCallback(@ProgressCallback,2);
Cancel:=1;
OveralPct:=0;
// Ðàñïàêîâêà âñåõ íåîáõîäèìûõ ôàéëîâ â ïàïêó {tmp}. Ýòî íåîáõîäèìî äëÿ òîãî, ÷òîáû
//âûïîëíÿòü óñòàíîâêó â ìîìåíò ssInstall, è ñåêöèÿ [Run] âûïîëíÿëàñü ïîñëå óñòàíîâêè.
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp04
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('RTconsole.exe');
ExtractTemporaryFile('precomp04.exe');
#endif
#ifdef precomp038
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('RTconsole.exe');
ExtractTemporaryFile('precomp038.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef unrar
ExtractTemporaryFile('Unrar.dll');
#endif
// Ïîäãîòàâëèâàåì ïåðåìåííóþ, ñîäåðæàùóþ âñþ èíôîðìàöèþ î âûäåëåííûõ êîìïîíåíòàõ äëÿ ISDone.dll
ChComp:=0;
#ifdef Components
TmpValue:=1;
if IsComponentSelected('text\rus') then ChComp:=ChComp+TmpValue; //êîìïîíåíò 1
TmpValue:=TmpValue*2;
if IsComponentSelected('text\eng') then ChComp:=ChComp+TmpValue; //êîìïîíåíò 2
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\rus') then ChComp:=ChComp+TmpValue; //êîìïîíåíò 3
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\eng') then ChComp:=ChComp+TmpValue; //êîìïîíåíò 4
#endif
StartRecord(ExpandConstant('{src}\records.inf'),ChComp);
repeat
MyError:=true;
// if not ISRarExtract ( 0, OveralPct, 0, ExpandConstant('{src}\aaa.rar'), ExpandConstant('{app}'), false,CallBack, '' ) then break;
if not ISArcExtract ( 0, OveralPct, 0, ExpandConstant('{src}\setup-1b.bin'), ExpandConstant('{app}\'), false,CallBack, '', '', '') then break;
if not ISArcExtract ( 0, OveralPct, 0, ExpandConstant('{src}\setup-1c.bin'), ExpandConstant('{app}\'), false,CallBack, '', '', '') then break;
if not ISArcExtract ( 0, OveralPct, 0, ExpandConstant('{src}\setup-1d.bin'), ExpandConstant('{app}\'), false,CallBack, '', '', '') then break;
if not ISArcExtract ( 0, OveralPct, 0, ExpandConstant('{src}\setup-1e.bin'), ExpandConstant('{app}\'), false,CallBack, '', '', '') then break;
if not ISSRepExtract ( 0, OveralPct, 0, ExpandConstant('{app}\setup-1.srep'), ExpandConstant('{app}\setup-1.pcf'), '', true, CallBack ) then break;
if not ISPrecompExtract( 0, OveralPct, 0, ExpandConstant('{app}\setup-1.pcf'), ExpandConstant('{app}\setup-1.7z'), true, CallBack ) then break;
if not IS7ZipExtract ( 0, OveralPct, 0, ExpandConstant('{app}\setup-1.7z'), ExpandConstant('{app}\'), true, CallBack, '' ) then break;
//if not ShowChangeDiskWindow('Ïîæàëóéñòà, âñòàâüòå äèñê 2 è äîæäèòåñü åãî èíèöèàëèçàöèè.', ExpandConstant('{src}'),'CODMW2_Disk2.arc' ) then break;
//if not ISArcExtract ( 1, OveralPct, 0, ExpandConstant('{src}\rustext.arc'), ExpandConstant('{app}'), false,CallBack, '', '', '') then break;
//if not ISArcExtract ( 2, OveralPct, 0, ExpandConstant('{src}\engtext.arc'), ExpandConstant('{app}'), false,CallBack, '', '', '') then break;
//if not ISArcExtract ( 3, OveralPct, 0, ExpandConstant('{src}\rusvoice.arc'),ExpandConstant('{app}'), false,CallBack, '', '', '') then break;
//if not ISArcExtract ( 4, OveralPct, 0, ExpandConstant('{src}\engvoice.arc'),ExpandConstant('{app}'), false,CallBack, '', '', '') then break;
MyError:=false;
until true;
StopRecord;
MyCancelButton.Visible:=false;
WizardForm.CancelButton.Visible:=true;
end;
if (CurStep=ssPostInstall) and MyError then
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n);
end;
//***********************Êîíåö-Èçîáðàæåíèå èíñòàëà***********************\\
//***********************Êíîïêà îòìåíû***********************\\
procedure CancelButtonClick(CurPage: Integer; var Cancel, Confirm: Boolean);
begin
Cancel:=False;
Confirm:=False;
if MsgBox('Âû äåéñòâèòåëüíî õîòèòå îòìåíèòü óñòàíîâêó {#MyAppName}? ', mbError, MB_YESNO) = idYes
then
Cancel:=true;
end;
//***********************Êîíåö-Êíîïêà îòüìåíû***********************\\