Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 3]
EvilAlex
26-03-2011, 10:02
insombia, я имелл ввиду что при установке, файлы игры и файлы инсталла в перепешку, а мне надо чтобы инсталл создовал дополнительную папку в папке с игрой и в эту папку распаковывал свои файлы ...
Как сейчас у меня:
http://i013.radikal.ru/1103/7c/6c07824867fd.jpg
Как хотелось бы:
http://s004.radikal.ru/i205/1103/94/5fc99cbb20ff.jpg
EvilAlex,
Эээ.. А позвольте задать вопрос: нафига временные файлы кидать в {app}?
insombia
26-03-2011, 10:53
кто знает как сделать чтобы при установке писало осталось примерно 5 мин до конца установки прошло 10 мин установки?
Как сделать чтоб ярлык не создавался в папке. Например оригинальный ярлык находится в ...папка/bin
Как сделать чтоб ярлык был ток в ...папка/bin а в папке его не было?
EvilAlex
26-03-2011, 11:15
nik1967, потомучто они не временные, они остаются почему то ...
EvilAlex, Так пропиши:
Source: файлик; DestDir: {tmp}; Flags: dontcopy
по надобности:
ExtractTemporaryFile('файлик')
и не понадобиться твоя "сортировка"...
EvilAlex
26-03-2011, 21:35
Спс всем, разобрался, заработало ...
Gnom_aka_Lexander
27-03-2011, 15:22
Не знаю, мож кому полезно будет, собрал пачку скинов (более 600 штук) Скачать (http://ifolder.ru/22633839)
Подскажите пожалуйста, как в Caption поместить путь, куда была установлена программа? {#SetupSetting("DefaultDirName")} - не катит, так и напишет - {pf}\моя программа.
R.i.m.s.k.y.
27-03-2011, 18:02
попробуй ExpandConstant('{#SetupSetting("DefaultDirName")}')
Gnom_aka_Lexander
27-03-2011, 18:05
Я-же написал:{#SetupSetting("DefaultDirName")} - не катит, так и напишет - {pf}\моя программа. »
:) а добавка ExpandConstant вызывает ошибку синтаксиса, нужно както прочитать путь установки, куда была установлена программа, а не куда должна быть установлена :)
C783RPunk
27-03-2011, 19:17
Помогите пожалуйста, не могу это осуществить, несколько форумов обрыл, но ответа не нашел :(.
http://i.piccy.info/i5/02/26/1282602/2011-03-26_180238_500.jpg (http://piccy.info/view3/1282602/82b1a78165dd7335bc4e03e1e077d7ae/)
1. При переходе на страницу Выбора компонентов автоматически выбераются Классические модели в 2-х группах, как отключить автоматический выбор компонентов?
2. Как убрать ячейки и оставить только надпись?
3. Как убрать размер компонентов?
4. И как сделать кнопку Далее активной только при выборе 2-х компонентов (1 компонент оружия и 1 компонент игроков), а то у меня получается так, что выбераешь только компонент оружия или компонент игроков и кнопка Далее становится активной?
5. И еще как на странице "Приветствие установки программы" и "Завершение установки" упорядочить текст по центру.
Вот мой скрипт
[Setup]
[Setup]
SourceDir=.
OutputDir=Setup
AppName=Counter-Strike HD
AppVerName=Counter-Strike HD
AppVersion=1.6.0.0
VersionInfoVersion=4.5.5.4
AppPublisher=Created by C783RPnuk
AppCopyright=C783RPnuk
AppPublisherURL=http://forum.ipcom.lg.ua/
AppSupportURL=http://forum.ipcom.lg.ua/
AppUpdatesURL=http://forum.ipcom.lg.ua/
DefaultDirName=C:\Games\Counter-Strike HD
DefaultGroupName=Counter-Strike HD
InfoBeforeFile=C:\Users\C783RPunk\Desktop\Prog\about.txt
InfoAfterFile=C:\Users\C783RPunk\Desktop\Prog\README.txt
OutputBaseFilename=Counter-Strike HD
WizardImageFile=C:\Users\C783RPunk\Desktop\ICO\big.bmp
WizardSmallImageFile=C:\Users\C783RPunk\Desktop\ICO\small.bmp
SetupIconFile=C:\Users\C783RPunk\Desktop\ICO\install.ico
AllowNoIcons=yes
DisableProgramGroupPage=yes
AlwaysShowGroupOnReadyPage=yes
DisableReadyMemo=yes
DisableReadyPage=yes
WindowVisible=no
WindowShowCaption=no
WindowResizable=no
Compression=lzma/normal
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[CustomMessages]
russian.FreeSpace=Доступно места на диске:
russian.NeedSpace=Требуется места на диске:
russian.hour= часов
russian.min= мин
russian.sec= сек
[Types]
Name: "full"; Description: "Полная установка"; Flags: iscustom
[Components]
Name: g0; Description: "МОДЕЛИ ОРУЖИЯ"; Types: full; Flags: disablenouninstallwarning checkablealone fixed
Name: g0\c1; Description: HD; Types: full; Flags: exclusive
Name: g0\c2; Description: Next Generation; Types: full; Flags: exclusive
Name: g0\c3; Description: New Era; Types: full; Flags: exclusive
Name: g0\c4; Description: "Классические"; Types: full; Flags: exclusive
Name: g1; Description: "МОДЕЛИ ИГРОКОВ"; Types: full; Flags: disablenouninstallwarning checkablealone fixed
Name: g1\c1; Description: HD; Types: full; Flags: exclusive
Name: g1\c2; Description: Source; Types: full; Flags: exclusive
Name: g1\c3; Description: Steam; Types: full; Flags: exclusive
Name: g1\c4; Description: "Классические"; Types: full; Flags: exclusive
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
[Files]
Source: C:\Users\C783RPunk\Desktop\ICO\papka.bmp; DestDir: {tmp}; Flags: dontcopy
Source: ISSkin.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
Source: steam.cjstyles; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
Source: compiler:innocallback.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "C:\Users\C783RPunk\Desktop\Prog\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension external
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Weapons\HD\*"; DestDir: "{app}\cstrike\models\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g0\c1
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Weapons\Next Generation\*"; DestDir: "{app}\cstrike\models\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g0\c2
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Sound\Weapons\Next Generation\*"; DestDir: "{app}\cstrike\sound\weapons\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g0\c2
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Weapons\New Era\*"; DestDir: "{app}\cstrike\models\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g0\c3
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Weapons\Classic\*"; DestDir: "{app}\cstrike\models\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g0\c4
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Players\HD\*"; DestDir: "{app}\cstrike\models\player\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g1\c1
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Players\Source\*"; DestDir: "{app}\cstrike\models\player\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g1\c2
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Players\Steam\*"; DestDir: "{app}\cstrike\models\player\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g1\c3
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Players\Classic\*"; DestDir: "{app}\cstrike\models\player\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g1\c4
[Icons]
Name: "{group}\{cm:LaunchProgram,Counter-Strike HD}"; Filename: "{app}\CSHD.exe"; WorkingDir: "{app}";
Name: "{userdesktop}\Counter-Strike HD"; Filename: "{app}\CSHD.exe"; WorkingDir: "{app}"; Tasks: desktopicon;
Name: "{group}\{cm:UninstallProgram,Counter-Strike HD}"; Filename: "{uninstallexe}"
[UninstallDelete]
Type: filesandordirs; Name: "{app}"
(Code)
const
dURL=2;
MF_DELETE = $200;
var
URLLabel,URLLabelShadow:TLabel;
function GetSystemMetrics(nIndex: Integer): Integer; external 'GetSystemMetrics@user32.dll stdcall';
procedure LoadSkin(lpszPath: String; lpszIniFileName: String ); external 'LoadSkin@files:isskin.dll stdcall delayload setuponly';
procedure LoadSkinA(lpszPath: String; lpszIniFileName: String ); external 'LoadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall';
function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';
function AppendMenu(hMenu: HMENU; uFlags, uIDNewItem: UINT; lpNewItem: PChar): BOOL; external 'AppendMenuA@user32.dll stdcall';
function GetSystemMenu(hWnd: HWND; bRevert: BOOL): HMENU; external 'GetSystemMenu@user32.dll stdcall';
procedure URLLabelClick(Sender: TObject);
var
ErrorCode:integer;
begin
ShellExec('open','Created by C783RPnuk','','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
end;
procedure URLLabelMouseDown(Sender:TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
begin
URLLabel.Top:=URLLabel.Top+dURL;
URLLabel.Left:=URLLabel.Left+dURL;
URLLabel.Font.Style:=URLLabel.Font.Style-[fsUnderline];
URLLabel.Font.Color:=$50B5C4;
URLLabelShadow.Visible:=False;
end;
procedure URLLabelMouseUp(Sender:TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
begin
URLLabel.Top:=URLLabel.Top-dURL;
URLLabel.Left:=URLLabel.Left-dURL;
URLLabel.Font.Style:=URLLabel.Font.Style-[fsUnderline];
URLLabel.Font.Color:=$708A7A;
URLLabelShadow.Visible:=True;
end;
var
RestoreDir: TButton;
procedure ButtonOnClick(Sender: TObject);
begin
WizardForm.DirEdit.Text:= ExpandConstant('C:\Games\Counter-Strike HD');
end;
type
TTimerProc = procedure(HandleW, Msg, idEvent, TimeSys: LongWord);
var
StartInstall: Integer;
TimeLabel: TLabel;
TimerID: Longword;
function GetTickCount: DWord; external 'GetTickCount@kernel32';
function WrapTimerProc(callback: TTimerProc; Paramcount: Integer): longword; external 'wrapcallback@files:innocallback.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): longword; external 'SetTimer@user32';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32 stdcall delayload';
Function cm(Message: String): String; Begin Result:= ExpandConstant('{cm:'+ Message +'}') End;
Function TicksToTime(Ticks: DWord; h,m,s: String; detail: Boolean): String;
Begin
if detail then {hh: mm:ss format}
Result:= PADZ(IntToStr(Ticks/3600000), 2) +':'+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +':'+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2)
else if Ticks/3600 >= 1000 then {more than hour}
Result:= IntToStr(Ticks/3600000) +h+' '+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +m
else if Ticks/60 >= 1000 then {1..60 minutes}
Result:= IntToStr(Ticks/60000) +m+' '+ IntToStr(Ticks/1000 - Ticks/1000/60*60) +s
else Result:= Format('%.1n', [Abs(Ticks/1000)]) +s {less than one minute}
End;
procedure GetTime(HandleW, Msg, idEvent, TimeSys: LongWord);
var Remaining: Integer;
begin
with WizardForm.ProgressGauge do begin
if position > 0 then Remaining:= trunc((GetTickCount - StartInstall) * Abs((max - position)/position))
TimeLabel.Caption:= 'Подождите... ' + TicksToTime(Remaining, cm('hour'), cm('min'), cm('sec'), false)
if (Remaining = 0) then TimeLabel.Caption:= 'Подождите... '
end;
end;
var
NeedSpaceLabel,FreeSpaceLabel: TLabel;
FreeMB, TotalMB: Cardinal;
SizeStr: String;
SizeInt: Integer;
SymbolNumber: Integer;
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 GetSize(): Integer;
begin
SizeStr:= WizardForm.DiskSpaceLabel.Caption;
for SymbolNumber:= 97 to 122 do begin
while (Pos(Chr(SymbolNumber), SizeStr) > 0) do Delete(SizeStr, Pos(Chr(SymbolNumber), SizeStr),1);
while (Pos( AnsiUppercase(Chr(SymbolNumber)), SizeStr) > 0) do Delete(SizeStr, Pos( AnsiUppercase(Chr(SymbolNumber)), SizeStr),1); end ;
for SymbolNumber:= 192 to 255 do begin
while (Pos(Chr(SymbolNumber), SizeStr) > 0) do Delete(SizeStr, Pos(Chr(SymbolNumber), SizeStr),1); end;
while (Pos('.', SizeStr) > 0) do Delete(SizeStr, Pos('.', SizeStr), 1)
Delete(SizeStr, Pos(',', SizeStr), 5)
Result:= StrToInt(Trim(SizeStr));
end;
function CompareNum(FirstNum, SecondNum: Integer): Boolean;
begin
if FirstNum < SecondNum then Result:= False else Result:= True;
end;
Function MbOrTb( Byte: Extended): String ;
begin
if Byte < 1024 then Result:= NumToStr(Byte) + ' Мб else
if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' Гб else
Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' Тб
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
FreeSpaceLabel.Caption:= ExpandConstant('{cm:FreeSpace} ') + MbOrTb(FreeMB)
NeedSpaceLabel.Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTb(SizeInt)
if WizardForm.CurPageID = wpSelectDir then begin
WizardForm.NextButton.Enabled:= CompareNum(FreeMB, SizeInt)
end;
end;
procedure ComponentOnClick(Sender: TObject);
begin
if WizardSelectedComponents(False) = '' then
WizardForm.NextButton.Enabled:= False
else WizardForm.NextButton.Enabled:= True;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
If CurStep = ssInstall then
begin
StartInstall:= GetTickCount
TimerID:= SetTimer(0,0, 500, WrapTimerProc(@GetTime, 4))
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpSelectDir then begin
GetFreeSpaceCaption(nil)
end;
end;
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('steam.cjstyles');
LoadSkin(ExpandConstant('{tmp}\steam.cjstyles'), '');
Result:= true
end;
function InitializeUninstall(): Boolean;
begin
FileCopy(ExpandConstant('{app}\isskin.dll'), ExpandConstant('{tmp}\isskin.dll'), False);
FileCopy(ExpandConstant('{app}\steam.cjstyles'), ExpandConstant('{tmp}\steam.cjstyles'), False);
LoadSkinA(ExpandConstant('{tmp}\steam.cjstyles'), '');
Result:=True;
end;
procedure InitializeWizard();
begin
URLLabelShadow:=TLabel.Create(WizardForm);
with URLLabelShadow do begin
Top:=ScaleY(331);
Left:=ScaleX(25);
Caption:='Created by C783RPnuk';
AutoSize:=True;
Parent:=WizardForm;
Transparent:=True;
Font.Color:=$041207;
Font.Size:=9;
Font.Style:=Font.Style+[fsBold];
end;
URLLabel:=TLabel.Create(WizardForm);
with URLLabel do begin
Top:=ScaleY(331)-dURL;
Left:=ScaleX(25)-dURL;
Caption:='Created by C783RPnuk';
AutoSize:=True;
Parent:=WizardForm;
Cursor:=crHand;
Transparent:=True;
Font.Color:=$708A7A;
Font.Size:=9;
Font.Style:=Font.Style+[fsBold];
BringToFront;
OnClick:=@URLLabelClick;
OnMouseDown:=@URLLabelMouseDown;
OnMouseUp:=@URLLabelMouseUp;
end;
begin
RestoreDir:= TButton.Create(WizardForm);
RestoreDir.Width := WizardForm.DirBrowseButton.Width;
RestoreDir.Height := WizardForm.DirBrowseButton.Height;
RestoreDir.Top := WizardForm.DirBrowseButton.Top + RestoreDir.Height + ScaleX(10);
RestoreDir.Left := WizardForm.DirBrowseButton.Left;
RestoreDir.OnClick := @ButtonOnClick;
RestoreDir.Parent := WizardForm.SelectDirPage;
RestoreDir.Visible:= True;
RestoreDir.Caption := 'Сбросить';
end;
begin
TimeLabel:= TLabel.Create(WizardForm)
TimeLabel.SetBounds(ScaleX(0), ScaleY(80), ScaleX(457), ScaleY(20));
TimeLabel.AutoSize:= False
TimeLabel.Transparent:= True;
TimeLabel.Parent:= WizardForm.InstallingPage;
end;
begin
AppendMenu(GetSystemMenu(Wizardform.Handle, True), MF_DELETE, 0, SetupMessage(msgAboutSetupMenuItem));
end;
begin
WizardForm.DiskSpaceLabel.Hide;
#ifdef NeedSize
SizeInt:= {#NeedSize}
#else
SizeInt:= GetSize;
#endif
NeedSpaceLabel := TLabel.Create(WizardForm);
NeedSpaceLabel.SetBounds(ScaleX(0), ScaleY(198), ScaleX(209), ScaleY(13))
NeedSpaceLabel.Parent := WizardForm.SelectDirPage;
NeedSpaceLabel.Transparent:=true;
FreeSpaceLabel := TLabel.Create(WizardForm);
FreeSpaceLabel.SetBounds(ScaleX(0), ScaleY(216), ScaleX(209), ScaleY(13))
FreeSpaceLabel.Parent := WizardForm.SelectDirPage;
FreeSpaceLabel.Transparent:=true;
WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
end;
begin
ExtractTemporaryFile('papka.bmp');
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectDirBitmapImage.AutoSize:=true;
WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectGroupBitmapImage.AutoSize:=true;
end;
begin
WizardForm.BorderStyle := bsDialog;
end;
begin
WizardForm.FileNameLabel.Visible:= False;
end;
begin
WizardForm.ComponentsList.OnClick := @ComponentOnClick;
end;
WizardForm.TypesCombo.ItemIndex:=0;
WizardForm.BeveledLabel.Enabled:=True;
WizardForm.BeveledLabel.visible:=False;
WizardForm.Bevel.visible:=False;
WizardForm.Bevel1.visible:=False;
end;
procedure DeinitializeSetup;
begin
ShowWindow(WizardForm.Handle,0);
KillTimer(0, TimerID);
UnloadSkin();
end;
Сделайте кто-нибудь пожалуйста или дайте скрипт на кажый вопрос я сам вставлю в свой скрипт. Это мой первый и последний инсталлятор, я больше ничего не попрошу.
как на странице "приветствие установки программы" и "завершение установки" упорядочить текст по центру (сверху-снизу и по бокам) »
Страница приветствия: WizardForm.WelcomeLabel1 и WizardForm.WelcomeLabel2;
Финальная страница: WizardForm.FinishedHeadingLabel и WizardForm.FinishedLabel.
Для каждого статика можете менять координаты Left, Top, Width, Height
как в Caption поместить путь, куда была установлена программа? »
Можно несколькими способами, один из вариантов:
procedure InitializeWizard();
begin
WizardForm.Caption := ExpandConstant('{reg:HKLM\' +
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 5_is1,InstallLocation|{pf}\My Program}');
end;
newmangor
27-03-2011, 23:25
помогите пожалуйста с вопросом:
делаю репак игры, надо чтобы в конце инсталятора на странице установка завершена, помимо пояление значка запустить установленное приложение, появились иконки (что то вроде поставить голочку убрать) для установки дополнительного ПО для игры, таких как direct x и т.д и соответственно выбрав ее пользователь нажимает завершить и запускаются установочные файлы ?
заранее благодарен !
gigabyte502
28-03-2011, 00:14
newmangor, попробуй так:
в секцию [Run] добавь
FileName: {константа}\файл; Description: Описание; Flags: postinstall nowait skipifsilent; Tasks: ; Languages:
newmangor
[Tasks]
Name: Redist; Description: Дополнительное программное обеспечение:;
Name: Redist\directx; Description: Обновить Microsoft DirectX; Flags: unchecked;
Name: Redist\visualc; Description: Установить Microsoft Visual C++ Redist; Flags: unchecked;
[Run]
Filename: {src}\Redist\DirectX\DXSETUP.exe; WorkingDir: {src}\Redist\DirectX\; Parameters: /silent; Tasks: Redist\directx; Flags: waituntilterminated;
Filename: {src}\Redist\VisualC++\vcredist_x86.exe; WorkingDir: {src}\Redist\VisualC++\; Parameters: /q; Tasks: Redist\visualc; Flags: waituntilterminated; Check: not IsWin64;
Filename: {src}\Redist\VisualC++\vcredist_x64.exe; WorkingDir: {src}\Redist\VisualC++\; Parameters: /q; Tasks: Redist\visualc; Flags: waituntilterminated; Check: IsWin64;
Доброго времени суток у меня такой вопрос нужно разбить установку на два диска можно ли сделать это в Inno Setup или это делается при записи дисков
Как сделать картинку на весь инсталл в последнем окне?
Gnom_aka_Lexander
28-03-2011, 20:38
shidow,
procedure InitializeWizard();
begin
WizardForm.WizardBitmapImage2.Width := WizardForm.Width;
end;
Как исправить? http://i18.fastpic.ru/big/2011/0328/33/17c5c7371458ac8f9b451cf8ec3f4033.png
Вот секция код
[_Code]
////// Кнопки \\\\\\
const
ButtonWidth = 80;
ButtonHeight = 23;
var
WizardLabel: TLabel;
ButtonPanel: array of TPanel;
ButtonImage: array of TBitmapImage;
ButtonLabel: array of TLabel;
UsedButtons: array of TButton;
ButtonsCount: Integer;
procedure ButtonLabelClick(Sender: TObject);
var Button: TButton; n, i: Integer;
begin
i:= TLabel(Sender).Tag; ButtonImage[i].Left:= 0
for n:=0 to (ButtonsCount-1) do begin
if i = n then Button:= UsedButtons[n];
end;
Button.OnClick(Button)
end;
procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Enabled then ButtonImage[TLabel(Sender).Tag].Left:=-ButtonWidth*2
end;
procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Enabled then ButtonImage[TLabel(Sender).Tag].Left:=0
end;
procedure ButtonLabelMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var n, I: Integer;
begin
I:=TLabel(Sender).Tag;
//Сначала восстанавливаем картинку у всех кнопок, так надо иначе могут быть глюки
for n:=0 to (ButtonsCount-1) do begin if (ButtonLabel[n].Enabled)and(ButtonImage[n].Left <> -ButtonWidth*2)and(I<>N) then ButtonImage[n].Left:= 0; end;
//Теперь собственно ставим нужную картинку
if (ButtonLabel[I].Enabled)and(ButtonImage[I].Left <> -ButtonWidth*2) then begin ButtonImage[I].Left:= -ButtonWidth; end;
end;
procedure WizardLabelMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var n: Integer;
begin
//Т.к Sender'ом выступает WizardLabel то не получится испльзовать индекс кнопки
for n:=0 to (ButtonsCount-1) do if (ButtonLabel[n].Enabled)and(ButtonImage[n].Left <> -ButtonWidth*2) then begin ButtonImage[n].Left:= 0; end;
end;
procedure LoadButtonImage(AButton: TButton);
var n: Integer;
begin
n:=ButtonsCount; SetArrayLength(ButtonPanel, n+1);
SetArrayLength(ButtonImage, n+1); SetArrayLength(ButtonLabel, n+1);
SetArrayLength(UsedButtons, n+1); UsedButtons[n]:= AButton;
ButtonPanel[n]:=TPanel.Create(WizardForm)
ButtonPanel[n].SetBounds(AButton.Left, AButton.Top, AButton.Width, AButton.Height)
ButtonPanel[n].Tag:= n
ButtonPanel[n].Enabled:= AButton.Enabled
ButtonPanel[n].Parent:=AButton.Parent
ButtonImage[n]:=TBitmapImage.Create(WizardForm)
ButtonImage[n].SetBounds(ScaleX(0), ScaleY(0), ScaleX(320), ScaleY(23))
ButtonImage[n].Enabled:=False
ButtonImage[n].Bitmap.LoadFromFile(ExpandConstant('{tmp}\Button.bmp'))
ButtonImage[n].Parent:=ButtonPanel[n]
with TLabel.Create(WizardForm) do begin
Tag:=n
Parent:=ButtonPanel[n]
Width:=AButton.Width
Height:=AButton.Height
Transparent:=True
OnClick:=@ButtonLabelClick
OnDblClick:=@ButtonLabelClick
OnMouseMove:=@ButtonLabelMove
OnMouseDown:=@ButtonLabelMouseDown
OnMouseUp:=@ButtonLabelMouseUp
end
ButtonLabel[n]:=TLabel.Create(WizardForm)
ButtonLabel[n].Autosize:=True
ButtonLabel[n].Alignment:=taCenter
ButtonLabel[n].Tag:=n
ButtonLabel[n].Enabled:= AButton.Enabled
ButtonLabel[n].Transparent:=True
ButtonLabel[n].Font.Color:=clWhite
ButtonLabel[n].Caption:=AButton.Caption
ButtonLabel[n].OnClick:=@ButtonLabelClick
ButtonLabel[n].OnDblClick:=@ButtonLabelClick
ButtonLabel[n].OnMouseMove:=@ButtonLabelMove
ButtonLabel[n].OnMouseDown:=@ButtonLabelMouseDown
ButtonLabel[n].OnMouseUp:=@ButtonLabelMouseUp
ButtonLabel[n].Parent:=ButtonPanel[n]
ButtonsCount:= ButtonsCount+1
end;
procedure UpdateButtons();
var n: Integer;
begin
for n:=0 to ButtonsCount-1 do begin
ButtonLabel[n].Caption:=UsedButtons[n].Caption
ButtonPanel[n].Visible:=UsedButtons[n].Visible
if (UsedButtons[n].Enabled = False) then ButtonImage[n].Left:= -ButtonWidth*3 else ButtonImage[n].Left:= 0;
ButtonLabel[n].Enabled:= UsedButtons[n].Enabled;
ButtonPanel[n].Enabled:= UsedButtons[n].Enabled;
//Ставим Left и Top лейбла соразмерно размеру лейбла
ButtonLabel[n].Left:= ButtonPanel[n].Width div 2 - ButtonLabel[n].Width div 2;
ButtonLabel[n].Top:= ButtonPanel[n].Height div 2 - ButtonLabel[n].Height div 2;
end;
end;
procedure LicenceAcceptedRadioOnClick(Sender: TObject);
begin
//Делаем кнопку активной
WizardForm.NextButton.Enabled:= True;
//Обновляем текстурированную кнопку (обновляем активность и текстуру)
UpdateButtons();
end;
procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
begin
//Делаем кнопку неактивной
WizardForm.NextButton.Enabled:= False;
//Обновляем текстурированную кнопку (обновляем активность и текстуру)
UpdateButtons()
end;
procedure InitializeWizard2();
begin
WizardLabel:= TLabel.Create(WizardForm)
WizardLabel.SetBounds(ScaleX(0), ScaleY(0), ScaleX(WizardForm.Width), ScaleY(WizardForm.Height))
WizardLabel.Transparent:= True;
WizardLabel.AutoSize:=false;
WizardLabel.OnMouseMove:=@WizardLabelMove
WizardLabel.Parent:= WizardForm;
WizardForm.BackButton.Width:= ButtonWidth
WizardForm.BackButton.Height:= ButtonHeight
WizardForm.NextButton.Width:= ButtonWidth
WizardForm.NextButton.Height:= ButtonHeight
WizardForm.CancelButton.Width:=ButtonWidth
WizardForm.CancelButton.Height:= ButtonHeight
WizardForm.DirBrowseButton.Left:=ScaleX(337)
WizardForm.DirBrowseButton.Width:= ButtonWidth
WizardForm.DirBrowseButton.Height:=ButtonHeight
WizardForm.GroupBrowseButton.Left:=ScaleX(337)
WizardForm.GroupBrowseButton.Width:= ButtonWidth
WizardForm.GroupBrowseButton.Height:=ButtonHeight
WizardForm.LicenseAcceptedRadio.OnClick:=@LicenceAcceptedRadioOnClick
WizardForm.LicenseNotAcceptedRadio.OnClick:=@LicenceNotAcceptedRadioOnClick
ExtractTemporaryFile('button.bmp')
LoadButtonImage(WizardForm.BackButton)
LoadButtonImage(WizardForm.NextButton)
LoadButtonImage(WizardForm.CancelButton)
LoadButtonImage(WizardForm.DirBrowseButton)
LoadButtonImage(WizardForm.GroupBrowseButton)
end;
procedure CurPageChanged(CurPageID: Integer);
begin
UpdateButtons()
end;
const
////// Инстал черный \\\\\\
Color = $000000; // Общий цвет инсталлятора $000000 - чёрный
procedure InitializeWizard1();
begin
WizardForm.Font.Color:=clWhite; // общий цвет шрифта
WizardForm.Color:=Color;
WizardForm.WelcomePage.Color:=Color;
WizardForm.InnerPage.Color:=Color;
WizardForm.FinishedPage.Color:=Color;
WizardForm.LicensePage.Color:=Color;
WizardForm.PasswordPage.Color:=Color;
WizardForm.InfoBeforePage.Color:=Color;
WizardForm.UserInfoPage.Color:=Color;
WizardForm.SelectDirPage.Color:=Color;
WizardForm.SelectComponentsPage.Color:=Color;
WizardForm.SelectProgramGroupPage.Color:=Color;
WizardForm.SelectTasksPage.Color:=Color;
WizardForm.ReadyPage.Color:=Color;
WizardForm.PreparingPage.Color:=Color;
WizardForm.InstallingPage.Color:=Color;
WizardForm.InfoAfterPage.Color:=Color;
WizardForm.DirEdit.Color:=$100800;
WizardForm.DiskSpaceLabel.Color:=Color;
WizardForm.GroupEdit.Color:=$100800;
WizardForm.PasswordLabel.Color:=Color;
WizardForm.PasswordEdit.Color:=Color;
WizardForm.PasswordEditLabel.Color:=Color;
WizardForm.ReadyMemo.Color:=Color;
WizardForm.TypesCombo.Color:=Color;
WizardForm.WelcomeLabel1.Color:=Color;
WizardForm.WelcomeLabel1.Font.Color:=Color;
WizardForm.InfoBeforeClickLabel.Color:=Color;
WizardForm.MainPanel.Color:=Color;
WizardForm.PageNameLabel.Color:=Color;
WizardForm.PageDescriptionLabel.Color:=Color;
WizardForm.ReadyLabel.Color:=Color;
WizardForm.FinishedLabel.Color:=Color;
WizardForm.YesRadio.Color:=Color;
WizardForm.NoRadio.Color:=Color;
WizardForm.WelcomeLabel2.Color:=Color;
WizardForm.LicenseLabel1.Color:=Color;
WizardForm.InfoAfterClickLabel.Color:=Color;
WizardForm.ComponentsList.Color:=Color;
WizardForm.ComponentsDiskSpaceLabel.Color:=Color;
WizardForm.BeveledLabel.Color:=Color;
WizardForm.StatusLabel.Color:=Color;
WizardForm.FilenameLabel.Color:=Color;
WizardForm.SelectDirLabel.Color:=Color;
WizardForm.SelectStartMenuFolderLabel.Color:=Color;
WizardForm.SelectComponentsLabel.Color:=Color;
WizardForm.SelectTasksLabel.Color:=Color;
WizardForm.LicenseAcceptedRadio.Color:=Color;
WizardForm.LicenseNotAcceptedRadio.Color:=Color;
WizardForm.UserInfoNameLabel.Color:=Color;
WizardForm.UserInfoNameEdit.Color:=Color;
WizardForm.UserInfoOrgLabel.Color:=Color;
WizardForm.UserInfoOrgEdit.Color:=Color;
WizardForm.PreparingLabel.Color:=Color;
WizardForm.FinishedHeadingLabel.Color:=clWhite;
WizardForm.FinishedHeadingLabel.Font.Color:=clWhite;
WizardForm.UserInfoSerialLabel.Color:=Color;
WizardForm.UserInfoSerialEdit.Color:=Color;
WizardForm.TasksList.Color:=Color;
WizardForm.RunList.Color:=Color;
WizardForm.SelectDirBrowseLabel.Color:=Color;
WizardForm.SelectStartMenuFolderBrowseLabel.Color:=Color;
WizardForm.PageNameLabel.Font.Color:=clWhite;
//Избавиться от разделительных полос сверху и снизу
WizardForm.Bevel.visible:=true; // Если не надо, то закомментировать
WizardForm.BeveledLabel.visible:=true; // Если не надо, то закомментировать
WizardForm.Bevel1.visible:=true; // Если не надо, то закомментировать
//Избавляемся от полосы прокрутки в меню Всё готово к установке
WizardForm.ReadyMemo.ScrollBars:= ssNone // Если не надо, то закомментировать
end;
////// Картинка в левый нижний угол \\\\\\
var
LogoImage:TBitmapImage;
LogoLabel: TLabel;
LogoPanel: TPanel;
procedure LogoOnClick(Sender: TObject);
var ReturnCode: Integer;
begin
ShellExec('open', 'http://shidow.com', '', '', SW_SHOWNORMAL, ewNoWait, ReturnCode)
end;
procedure InitializeWizard3();
begin
ExtractTemporaryFile('logo.bmp');
LogoPanel := TPanel.Create(WizardForm);
with LogoPanel do
begin
Parent := WizardForm;
Left := ScaleX(5);
Top := ScaleY(320);
Width := ScaleX(165);
Height := ScaleY(35);
BevelOuter := bvNone;
end;
LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
Parent := LogoPanel;
Left := ScaleX(0);
Top := ScaleY(0);
AutoSize:=true;
ReplaceColor:=clFuchsia;
ReplaceWithColor:=clBtnFace;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
end;
LogoLabel := TLabel.Create(WizardForm);
with LogoLabel do
begin
Parent := LogoPanel;
Width := LogoPanel.Width;
Height := LogoPanel.Height;
Transparent:=True;
Cursor := crHand;
OnClick:=@LogoOnClick;
end;
end;
////// Папка \\\\\\
procedure InitializeWizard4();
begin
ExtractTemporaryFile('papka.bmp');
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectDirBitmapImage.AutoSize:=true;
WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectGroupBitmapImage.AutoSize:=true;
end;
////// Верхняя картинка \\\\\\
procedure InitializeWizard5();
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
Font.Name := 'Tahoma'
Width := Width - 497; //Поставьте здесь значения на 0, если хотите вернуть текст
Left := Left + 497; //
end;
with PageDescriptionLabel do begin
Font.Name := 'Tahoma'
Width := Width - 497; //Поставьте здесь значения на 0, если хотите вернуть текст
Left := Left + 497; //
end;
end;
end;
var
WelcomeLabel1, WelcomeLabel2: TLabel;
BmpFile: TBitmapImage;
////// Cтраница приветствия \\\\\\
procedure InitializeWizard6();
begin
ExtractTemporaryFile('fon.bmp');
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\fon.bmp'));
BmpFile.SetBounds(0, 0, 497, 320);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.WelcomePage;
with WizardForm do
begin
WelcomeLabel1.Hide;
WelcomeLabel2.hide;
end;
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
WelcomeLabel1.Alignment:=taCenter;
Left:= ScaleX(176);
Top:= ScaleY(66);
Width:= ScaleX(301);
Height:= ScaleY(71);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Name:='Tahoma'
Font.Size:= 12;
Font.Color:=ClWhite
Parent:= WizardForm.WelcomePage;
Caption:= WizardForm.WelcomeLabel1.Caption;
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
WelcomeLabel2.Alignment:=taCenter;
Top:= ScaleY(136);
Left:= ScaleX(176);
Width:= ScaleX(301);
Height:= ScaleY(300);
AutoSize:= false;
WordWrap:= true;
Font.Color:=ClWhite
Font.Name:='Segoe UI'
Transparent:= true;
Parent:= WizardForm.WelcomePage;
Caption:= WizardForm.WelcomeLabel2.Caption;
end;
end;
procedure InitializeWizard();
begin
InitializeWizard1();
InitializeWizard2();
InitializeWizard3();
InitializeWizard4();
InitializeWizard5();
InitializeWizard6();
end;
Привет всем! Мне нужна ваша помощь:)
Скрипт переменной для отмены:
function ISCreateProcessCallback(): boolean;
begin
Result := isexec_cancel;
begin
if not(isexec_cancel) then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
end;
end;
end;
Это код для отмены, но он не работает:(. Если поставить Result :=true;, то все распаковывается на ура, но кнопка отмены не работает. А если оставить Result := isexec_cancel; , то кнопка отмены работает, но архивы не распаковываются. Вот весь скрипт:
#define MyAppName "Fallout New Vegas"
#define MyAppVersion "1.0"
#define MyAppPublisher "Microsoft Game Studios"
#define vers1 "1.0.0.0"
#define MAX "2"
[Setup]
AppName={#MyAppName}
AppverName={#MyAppVersion}
AppVersion={#MyAppVersion}
VersionInfoVersion={#vers1}
VersionInfoTextVersion={#vers1}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
ShowTasksTreeLines=yes
OutputDir=.
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[Files]
Source: "ISExec.dll"; DestDir: {tmp}; Flags: dontcopy
Source: "srep.dll"; DestDir: "{tmp}"; Flags: dontcopy
Source: "arc.dll"; DestDir: "{tmp}"; Flags: dontcopy
Source: "precomp.exe"; DestDir: "{tmp}"; Flags: dontcopy
Source: "packjpg_dll.dll"; DestDir: "{tmp}"; Flags: dontcopy
Source: "zlib1.dll"; DestDir: "{tmp}"; Flags: dontcopy
Source: "oggdec.exe"; DestDir: "{tmp}"; Flags: dontcopy
[UninstallDelete]
Type: filesandordirs; Name: {app};
[code]
var
FLabel1, FLabel2, WLabel1, WLabel2, PageNameLabel, PageDescriptionLabel,NeedSpaceLabel,FreeSpaceLabel: TLabel;
NeedSize:Integer;
FreeMB, TotalMB: Cardinal;
LogoImage: TBitmapImage;
ProgressBar1:TNewProgressBar;
const SmallWidth = 497;
procedure InitializeWizard();
begin
ProgressBar1:=TNewProgressBar.Create(WizardForm);
with WizardForm.ProgressGauge do
begin
ProgressBar1.Left := WizardForm.ProgressGauge.Left;
ProgressBar1.Top := WizardForm.ProgressGauge.Top;
ProgressBar1.min:=0;
ProgressBar1.Width :=WizardForm.ProgressGauge.Width;
ProgressBar1.Height := WizardForm.ProgressGauge.Height;
ProgressBar1.Parent := WizardForm.InstallingPage;
ProgressBar1.Max:= {#MAX};
end;
end;
var
isexec_cancel: boolean;
Cancel:integer;
type
TISCreateProcessCallback = function(): boolean;
function CreateProcess(callback: TISCreateProcessCallback; EXEName: PAnsiChar; DIRName: PAnsiChar; Show: boolean; Comfort: boolean; hWnd: HWND): BOOL; external 'isexec_cp@files:isexec.dll stdcall';
function ISCreateProcessCallback(): boolean;
begin
Result := true;
begin
if not(isexec_cancel) then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
end;
end;
end;
var
Files: Array of String;
S: String;
n: Integer;
Function StringToArray(Text, Cut: String): array of String; var i, k: Integer;
Begin
SetArrayLength(Result, 0); if Cut = '' then Cut:= #1310;
Repeat k:= Pos(Cut,Text);
if k = 1 then begin Delete(Text, 1, Length(Cut)); CONTINUE
end;
SetArrayLength(Result, GetArrayLength(Result) +1); i:= GetArrayLength(Result) -1;
if k = 0 then
Result[i]:=Text
else begin
Result[i]:= Copy(Text, 1, k -1); Delete(Text, 1, Length(Result[i]) + Length(Cut));
end;
Until Length(Text) * k = 0;
End;
procedure FindFiles(FromDir: String; Mask: String);
var FSR, DSR: TFindRec; FindResult: Boolean;
begin
FindResult:= FindFirst(AddBackslash(FromDir)+Mask, FSR)
while FindResult do begin
if FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then begin
S:= S + AddBackslash(fromDir) + FSR.Name +'|';
end;
FindResult:= FindNext(FSR);
end;
FindResult:= FindFirst(AddBackslash(FromDir)+ '*.*', DSR)
while FindResult do begin
if ((DSR.Attributes and FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY) and not ((DSR.Name = '.') or (DSR.Name = '..')) then begin
FindFiles(AddBackSlash(FromDir)+DSR.Name, Mask)
end;
FindResult:= FindNext(DSR);
end;
FindClose(FSR); FindClose(DSR)
end;
procedure FindAllFiles(_Dir: string; var _i: integer);
var
SearchRec: TFindRec;
begin
_Dir := AddBackslash(_Dir);
if FindFirst(_Dir + '*.*', SearchRec) then
begin
try
repeat
if (SearchRec.Name = '.') or (SearchRec.Name = '..') then
Continue;
if (SearchRec.Attributes and FILE_ATTRIBUTE_DIRECTORY) <> 0 then
FindAllFiles(_Dir + SearchRec.Name, _i)
else
_i := _i + 1;
until
not FindNext(SearchRec);
finally
FindClose(SearchRec);
end;
end;
end;
procedure Extract_ogg;
var ResultCode: integer; CurFile: String;
begin
FindFiles(ExpandConstant('{app}'), '*.ogg')
Files:= StringToArray(S, '|')
for n:=(GetArrayLength(Files)-1) downto 0 do begin
CurFile:= Files[n]
StringChange(CurFile, AddBackslash(ExtractFilePath(Files[n])), '')
if not(CreateProcess(@ISCreateProcessCallback, ExpandConstant('{tmp}\oggdec.exe') + ' ' + ' -Q '+ CurFile, AddBackslash(ExtractFilePath(Files[n])), FALSE, FALSE, WizardForm.Handle)) then exit;
DeleteFile(Files[n])
ProgressBar1.Position:= ProgressBar1.Position +1;
end;end;
procedure Extract_pcf;
var ResultCode: integer; CurFile: String;
begin
FindFiles(ExpandConstant('{app}'), '*.pcf')
Files:= StringToArray(S, '|')
for n:=(GetArrayLength(Files)-1) downto 0 do begin
CurFile:= Files[n]
StringChange(CurFile, AddBackslash(ExtractFilePath(Files[n])), '')
if not(CreateProcess(@ISCreateProcessCallback, ExpandConstant('{tmp}\precomp.exe') + ' ' + ' -r '+ CurFile, AddBackslash(ExtractFilePath(Files[n])), FALSE, FALSE, WizardForm.Handle)) then exit;
DeleteFile(Files[n])
ProgressBar1.Position:= ProgressBar1.Position +1;
end;end;
procedure Extract_Arc(arcArchName,arcDestDir: string);
begin
if not(CreateProcess(@ISCreateProcessCallback, ExpandConstant('{tmp}\Arc.dll') + ' ' + 'x '+AddQuotes(ExpandConstant(arcArchName))+' -y -dp'+AddQuotes(ExpandConstant(arcDestDir)), '', FALSE, FALSE, WizardForm.Handle)) then exit;
ProgressBar1.Position:= ProgressBar1.Position +10;
end;
procedure Extract_srep(srepArchName,srepDestDir: string);//srep
begin
if not(CreateProcess(@ISCreateProcessCallback, ExpandConstant('{tmp}\Srep.dll') + ' ' + '-d '+AddQuotes(ExpandConstant(srepArchName))+' '+AddQuotes(ExpandConstant(srepDestDir)),'', FALSE, FALSE, WizardForm.Handle)) then exit;
ProgressBar1.Position := ProgressBar1.Position+10;
end;
function PlsInsertNextDisk(num: integer; CheckedFile: string): string;
var Capt:string;
CheckedDir:string;
begin
if not(isexec_cancel) then exit;
CheckedFile:=ExpandConstant(CheckedFile);
if not FileExists(CheckedFile) then begin
Capt:=ExpandConstant('{cm:disk}')+' ¹%n'+ExpandConstant('{cm:disk2}');
StringChange(Capt, '%n', inttostr(num));
StringChange(Capt, '%f', ExtractFileName(CheckedFile));
MsgBox(Capt, mbInformation, MB_OK);
PlsInsertNextDisk(num, CheckedFile);
end;
Result := CheckedFile;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
i: integer;
tmp:integer;
begin
if CurStep = ssInstall then
begin
WizardForm.StatusLabel.Caption:=SetupMessage(msgStatusExtractFiles);
ExtractTemporaryFile('arc.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('Srep.dll');
ExtractTemporaryFile('oggdec.exe');
ProgressBar1.Position := ProgressBar1.Position+1;
end;
if CurStep = ssInstall then
begin
Extract_Arc('{src}\data.bin', '{app}');
//Extract_ogg
WizardForm.StatusLabel.Caption:=SetupMessage(msgStatusRunProgram);
end;
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
Cancel:=True;
if CurPageID = wpInstalling then
begin
isexec_cancel := true;
end;
end;
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.
Available in ZeroNet 1osznRoVratMCN3bFoFpR2pSV5c9z6sTC