Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Программы » Inno Setup (создание инсталяционных пакетов)

Модерирует : gyra, Maz

Widok (23-11-2010 10:55): лимит страниц. продолжаем здесь  Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

MiniMan

Junior Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
#define NeedSize "9017753600"
 
;#define Components
 
 
//#define records
;#define records
#define precomp04
;#define precomp038
;#define unrar
 
[Setup]
AppName=Fallout 3
AppVerName=Fallout 3
DefaultDirName={pf}\Fallout 3
OutputDir=.
OutputBaseFilename=Setup
DefaultGroupName=torrents.omsk.ru\Fallout 3
WizardImageFile=WizardImage.bmp
WizardSmallImageFile=WizardSmallImage.bmp
SolidCompression=yes
SetupIconFile=D:\icon.ico
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
 
#ifdef Components
[Types]
Name: "full"; Description: "Full installation"; Flags: iscustom
 
[Components]
;Name: "text"; Description: "Язык субтитров"; Types: full; Flags: fixed
;Name: "text\rus"; Description: "Русский"; Flags: exclusive; ExtraDiskSpaceRequired: 100000000
;Name: "text\eng"; Description: "Английский"; Flags: exclusive; ExtraDiskSpaceRequired: 200000000
;Name: "voice"; Description: "Язык озвучки"; Types: full; Flags: fixed
;Name: "voice\rus"; Description: "Русский"; Flags: exclusive; ExtraDiskSpaceRequired: 500000000
;Name: "voice\eng"; Description: "Английский"; Flags: exclusive; ExtraDiskSpaceRequired: 600000000
#endif
 
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
 
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
;Name: "directx"; Description: "{cm:UpdateDirect}"; GroupDescription: "{cm:AdditionalTasks}";
;Name: "comrade"; Description: "{cm:InstallComrade}"; GroupDescription: "{cm:AdditionalTasks}"; Flags: unchecked
;Name: "adobe"; Description: "{cm:InstallAcroReader}"; GroupDescription: "{cm:AdditionalTasks}"; Flags: unchecked
 
[Run]
Filename: {src}\Redist\DirectX\dxwebsetup.exe; WorkingDir: {src}\Redist; Parameters: /q;
Filename: {src}\Redist\G4WL\gfwlivesetupmin.exe; WorkingDir: {src}\Redist; Parameters: /q;
;Filename: {src}\Redist\physx\PhysX.exe; WorkingDir: {src}\Redist; Parameters: /q; Check: DirectX; Flags: waituntilterminated; BeforeInstall: OalinstProgress
Filename: {src}\Redist\Visual\vcredist.exe; WorkingDir: {src}\Redist; Parameters: /q;
;Filename: msiexec.exe; Parameters: "-i ""{src}\redist\physx\PhysX.exe"" -qn"; WorkingDir: {src}\redist; Flags: waituntilterminated; BeforeInstall: OalinstProgress
 
[Registry]
Root: HKLM; Subkey: "SOFTWARE\Bethesda Softworks\Fallout3"; ValueName: "Installed Path"; ValueType: String; ValueData: "{app}\"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\Bethesda Softworks\Fallout3"; ValueName: "Version"; ValueType: String; ValueData: "1.7";
Root: HKLM; Subkey: "SOFTWARE\Bethesda Softworks\Fallout3\DLC1"; ValueName: "Version"; ValueType: String; ValueData: "1.0"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\Bethesda Softworks\Fallout3\DLC1"; ValueName: "Language"; ValueType: String; ValueData: "Ru"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\Bethesda Softworks\Fallout3\DLC2"; ValueName: "Version"; ValueType: String; ValueData: "1.0"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\Bethesda Softworks\Fallout3\DLC2"; ValueName: "Language"; ValueType: String; ValueData: "Ru"; Flags: uninsdeletekey
 
[Files]
Source: Include\DLCList.txt; DestDir: {localappdata}\Fallout3\;
Source: Include\plugins.txt; DestDir: {localappdata}\Fallout3\;
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp04
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp04.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp038
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef unrar
Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
 
Source: "DirBitmap.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Source: "GroupBitmap.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Source: "Logo.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Source: "button.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Source: "Logo.bmp"; DestDir: "{app}"; Attribs: hidden system;
Source: "WizardSmallImage.bmp"; DestDir: "{app}"; Attribs: hidden system;
 
[CustomMessages]
russian.ExtractedFile=Распаковывается файл:
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!
russian.FinishedLabel=Программа {#SetupSetting("AppName")} установлена на Ваш компьютер. Приложение можно запустить с помощью соответствующего значка.%n%nНажмите «Завершить», чтобы выйти из программы установки.
russian.AdditionalTasks=Системные задачи:
russian.UpdateDirect=Обновить DirectX
russian.InstallComrade=Установить GameSpy Comrade
russian.InstallAcroReader=Установить Adobe Acrobat Reader
 
[Icons]
Name: "{group}\Fallout 3"; Filename: "{app}\FalloutLauncher.exe"
Name: "{group}\{cm:UninstallProgram,Fallout 3}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Fallout 3"; Filename: "{app}\FalloutLauncher.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Fallout 3"; Filename: "{app}\FalloutLauncher.exe"; Tasks: quicklaunchicon
 
[UninstallDelete]
Type: filesandordirs; Name: {app}
 
[Code]
var
  LabelPct,LabelCurrFileName: TLabel;
  ISDoneProgressBar: TNewProgressBar;
  MyCancelButton: TButton;
  OveralPct,Cancel:integer;
  CallBack:longword;
  MyError:boolean;
   
  LogoImage: TBitmapImage;
 
  ButtonPanel: array [0..4] of TPanel;
  ButtonImage: array [0..4] of TBitmapImage;
  ButtonLabel: array [0..4] of TLabel;
 
  StatusLabel, FileNameLabel, ExtractFile, StatusInfo, FinishedLabel: TLabel;
  FreeMB, TotalMB: Cardinal;
  Texture2, Texture: TBitmapImage;
   
const
  Color = clBlack;
  ButtonWidth = 80;
  ButtonHeight = 23;
   
  bidBack = 0;
  bidNext = 1;
  bidCancel = 2;
  bidDirBrowse = 3;
  bidGroupBrowse = 4;
 
 
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 CancelButtonOnClick(Sender: TObject);
begin
   if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;
 
procedure RepaintInstall();
begin
  ExtractTemporaryFile('button.bmp')
  ExtractTemporaryFile('DirBitmap.bmp');
  ExtractTemporaryFile('GroupBitmap.bmp');
  ExtractTemporaryFile('Logo.bmp');
 
  WizardForm.WizardBitmapImage.Width := ScaleX(224);
  WizardForm.WizardBitmapImage2.Width := ScaleX(224);
  WizardForm.PageNameLabel.Width:=ScaleX(300);
  WizardForm.PageDescriptionLabel.Hide;
 
  WizardForm.Font.Color:=clWhite;
 
  WizardForm.Color:=Color;
  WizardForm.WelcomePage.Color:=Color;
  WizardForm.InnerPage.Color:=Color;
  WizardForm.FinishedPage.Color:=Color;
  WizardForm.SelectDirPage.Color:=Color;
  WizardForm.SelectComponentsPage.Color:=Color;
  WizardForm.SelectProgramGroupPage.Color:=Color;
  WizardForm.SelectTasksPage.Color:=Color;
  WizardForm.ReadyPage.Color:=Color;
  WizardForm.InstallingPage.Color:=Color;
 
  WizardForm.PageNameLabel.Color:=Color;
  WizardForm.PageNameLabel.Font.Color:=ClWhite;
  WizardForm.MainPanel.Color:=Color;
 
  WizardForm.WelcomeLabel1.Hide;
  WizardForm.WelcomeLabel2.Hide;
 
  WizardForm.SelectDirLabel.Color:=Color;
  WizardForm.SelectDirBrowseLabel.Color:=Color;
  WizardForm.DirEdit.Color:=Color;
  WizardForm.DiskSpaceLabel.Color:=Color;
 
  WizardForm.ComponentsList.Color:=Color;
  WizardForm.SelectComponentsLabel.Color:=Color;
  WizardForm.TypesCombo.Hide;
  WizardForm.ComponentsDiskSpaceLabel.Hide;
 
  WizardForm.GroupEdit.Color:=Color;
  WizardForm.SelectStartMenuFolderLabel.Color:=Color;
  WizardForm.SelectStartMenuFolderBrowseLabel.Color:=Color;
 
  WizardForm.SelectTasksLabel.Color:=Color;
  WizardForm.TasksList.Color:=Color;
 
  WizardForm.ReadyMemo.Color:=Color;
  WizardForm.ReadyMemo.ScrollBars:= ssNone
  WizardForm.ReadyLabel.Color:=Color;
 
  WizardForm.StatusLabel.Color:=Color;
  WizardForm.FilenameLabel.Color:=Color;
 
  WizardForm.FinishedHeadingLabel.Hide;
  WizardForm.FinishedLabel.Hide;
 
  WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\DirBitmap.bmp'));
  WizardForm.SelectDirBitmapImage.AutoSize:=true;
 
  WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\GroupBitmap.bmp'));
  WizardForm.SelectGroupBitmapImage.AutoSize:=true;
 
  LogoImage := TBitmapImage.Create(WizardForm);
  with LogoImage do
  begin
    SetBounds(ScaleX(10), ScaleY(320), ScaleX(175), ScaleY(40));
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\Logo.bmp'));
    Parent := WizardForm;
  end;
 
  with WizardForm.WizardSmallBitmapImage do
  begin
    SetBounds(ScaleX(335), ScaleY(2), ScaleX(160), ScaleY(50));
  end;
 
  with WizardForm.ComponentsList do
  begin
    Top:=ScaleY(55);
    Height:=ScaleY(150);
  end;
 
  with TLabel.Create(WizardForm) do begin
    AutoSize:=WizardForm.WelcomeLabel1.AutoSize;
    Left:=WizardForm.WelcomeLabel1.Left;
    Top:=WizardForm.WelcomeLabel1.Top
    Width:=WizardForm.WelcomeLabel1.Width
    Height:=WizardForm.WelcomeLabel1.Height
    WordWrap:=WizardForm.WelcomeLabel1.WordWrap;
    Font.Name:=WizardForm.WelcomeLabel1.Font.Name;
    Font.Size:=WizardForm.WelcomeLabel1.Font.Size;
    Font.Color:=clWhite;
    Font.Style:=WizardForm.WelcomeLabel1.Font.Style;
    Caption:=WizardForm.WelcomeLabel1.Caption;
    Parent:=WizardForm.WelcomeLabel1.Parent
    Transparent:=True
  end;
 
   with TLabel.Create(WizardForm) do begin
    AutoSize:=WizardForm.WelcomeLabel2.AutoSize;
    Left:=WizardForm.WelcomeLabel2.Left;
    Top:=WizardForm.WelcomeLabel2.Top
    Width:=WizardForm.WelcomeLabel2.Width
    Height:=WizardForm.WelcomeLabel2.Height
    WordWrap:=WizardForm.WelcomeLabel2.WordWrap;
    Font.Name:=WizardForm.WelcomeLabel2.Font.Name;
    Font.Size:=WizardForm.WelcomeLabel2.Font.Size;
    Font.Color:=clWhite;
    Font.Style:=WizardForm.WelcomeLabel2.Font.Style;
    Caption:=WizardForm.WelcomeLabel2.Caption;
    Parent:=WizardForm.WelcomeLabel2.Parent
    Transparent:=True
  end;
 
  with TLabel.Create(WizardForm) do begin
    AutoSize:=WizardForm.FinishedHeadingLabel.AutoSize;
    Left:=WizardForm.FinishedHeadingLabel.Left;
    Top:=WizardForm.FinishedHeadingLabel.Top
    Width:=WizardForm.FinishedHeadingLabel.Width
    Height:=WizardForm.FinishedHeadingLabel.Height
    WordWrap:=WizardForm.FinishedHeadingLabel.WordWrap;
    Font.Name:=WizardForm.FinishedHeadingLabel.Font.Name;
    Font.Size:=WizardForm.FinishedHeadingLabel.Font.Size;
    Font.Color:=clWhite;
    Font.Style:=WizardForm.FinishedHeadingLabel.Font.Style;
    Caption:=WizardForm.FinishedHeadingLabel.Caption;
    Parent:=WizardForm.FinishedHeadingLabel.Parent
    Transparent:=True
  end;
 
  FinishedLabel:= TLabel.Create(WizardForm)
  with FinishedLabel do begin
    AutoSize:=WizardForm.FinishedLabel.AutoSize;
    Left:=WizardForm.FinishedLabel.Left;
    Top:=WizardForm.FinishedLabel.Top
    Width:=WizardForm.FinishedLabel.Width;
    Height:=WizardForm.FinishedLabel.Height+50;
    WordWrap:=WizardForm.FinishedLabel.WordWrap;
    Font.Name:=WizardForm.FinishedLabel.Font.Name;
    Font.Size:=WizardForm.FinishedLabel.Font.Size;
    Font.Color:=clWhite;
    Font.Style:=WizardForm.FinishedLabel.Font.Style;
    Caption:=ExpandConstant('{cm:FinishedLabel}');
    Parent:=WizardForm.FinishedLabel.Parent
    Transparent:=True
  end;
end;
 
procedure InitializeUninstallProgressForm;
begin
  FileCopy(ExpandConstant('{app}\WizardSmallImage.bmp'), ExpandConstant('{tmp}\WizardSmallImage.bmp'), False);
  FileCopy(ExpandConstant('{app}\Logo.bmp'), ExpandConstant('{tmp}\Logo.bmp'), False);
 
  UninstallProgressForm.Color:=Color;
  UninstallProgressForm.InnerPage.Color:=Color;
  UninstallProgressForm.MainPanel.Color:=Color;
  UninstallProgressForm.PageNameLabel.Color:=Color;
  UninstallProgressForm.PageDescriptionLabel.Hide;
  UninstallProgressForm.PageNameLabel.Font.Color:=clWhite;
  UninstallProgressForm.PageNameLabel.Width:=ScaleX(300);
  UninstallProgressForm.StatusLabel.Color:=Color;
  UninstallProgressForm.StatusLabel.Font.Color:=clWhite;
 
  LogoImage := TBitmapImage.Create(UninstallProgressForm);
  with LogoImage do
  begin
    SetBounds(ScaleX(10), ScaleY(320), ScaleX(175), ScaleY(40));
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\Logo.bmp'));
    Parent := UninstallProgressForm;
  end;
 
  with UninstallProgressForm.WizardSmallBitmapImage do
  begin
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardSmallImage.bmp'));
    SetBounds(ScaleX(335), ScaleY(2), ScaleX(160), ScaleY(50));
  end;
end;
 
//************************************************ [Конец - Вн. вид инсталла] ***************************************************//
 
//************************************************ [Начало - Кнопки] ***************************************************//
 
procedure ButtonLabelClick(Sender: TObject);
var
  Button: TButton;
begin
  ButtonImage[TLabel(Sender).Tag].Left:=0
  case TLabel(Sender).Tag of
    bidBack: Button:=WizardForm.BackButton
    bidNext: Button:=WizardForm.NextButton
    bidCancel: Button:=WizardForm.CancelButton
    bidDirBrowse: Button:=WizardForm.DirBrowseButton
    bidGroupBrowse: Button:=WizardForm.GroupBrowseButton
  else
    Exit
  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
end;
 
procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ButtonImage[TLabel(Sender).Tag].Left:=0
end;
 
procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer);
var
  Image: TBitmapImage;
  Panel: TPanel;
  Labl: TLabel;
 
begin
  Panel:=TPanel.Create(WizardForm)
  Panel.Left:=AButton.Left
  Panel.Top:=AButton.Top
  Panel.Width:=AButton.Width
  Panel.Height:=AButton.Height
  Panel.Tag:=AButtonIndex
  Panel.Parent:=AButton.Parent
  ButtonPanel[AButtonIndex]:=Panel
 
  Image:=TBitmapImage.Create(WizardForm)
  Image.Width:=160
  Image.Height:=23
  Image.Enabled:=False
  Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button.bmp'))
  Image.Parent:=Panel
  ButtonImage[AButtonIndex]:=Image
 
  with TLabel.Create(WizardForm) do begin
    Tag:=AButtonIndex
    Parent:=Panel
    Width:=Panel.Width
    Height:=Panel.Height
    Transparent:=True
    OnClick:=@ButtonLabelClick
    OnDblClick:=@ButtonLabelClick
    OnMouseDown:=@ButtonLabelMouseDown
    OnMouseUp:=@ButtonLabelMouseUp
  end
 
  Labl:=TLabel.Create(WizardForm)
  Labl.Left:=23
  Labl.Top:=5
  Labl.Autosize:=True
  Labl.Alignment:=taCenter
  Labl.Tag:=AButtonIndex
  Labl.Transparent:=True
  Labl.Font.Color:=clWhite
  Labl.Caption:=AButton.Caption
  Labl.OnClick:=@ButtonLabelClick
  Labl.OnDblClick:=@ButtonLabelClick
  Labl.OnMouseDown:=@ButtonLabelMouseDown
  Labl.OnMouseUp:=@ButtonLabelMouseUp
  Labl.Parent:=Panel
  ButtonLabel[AButtonIndex]:=Labl
end;
 
procedure UpdateButton(AButton: TButton;AButtonIndex: integer);
begin
  ButtonLabel[AButtonIndex].Caption:=AButton.Caption
  ButtonPanel[AButtonIndex].Visible:=AButton.Visible
  ButtonLabel[AButtonIndex].Enabled:=Abutton.Enabled
end;
 
procedure LicenceAcceptedRadioOnClick(Sender: TObject);
begin
  ButtonLabel[bidNext].Enabled:=True
end;
 
procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
begin
  ButtonLabel[bidNext].Enabled:=False
end;
 
procedure UpdateButtons(CurPageID: Integer);
begin
  UpdateButton(WizardForm.BackButton,bidBack)
  UpdateButton(WizardForm.NextButton,bidNext)
  UpdateButton(WizardForm.CancelButton,bidCancel)
  ButtonLabel[bidBack].Left := (ButtonPanel[bidBack].Width / 2 - ButtonLabel[bidBack].Width / 2);
  ButtonLabel[bidNext].Left := (ButtonPanel[bidNext].Width / 2 - ButtonLabel[bidNext].Width / 2);
  ButtonLabel[bidCancel].Left := (ButtonPanel[bidCancel].Width / 2 - ButtonLabel[bidCancel].Width / 2);
  ButtonLabel[bidDirBrowse].Left := (ButtonPanel[bidDirBrowse].Width / 2 - ButtonLabel[bidDirBrowse].Width / 2);
  ButtonLabel[bidGroupBrowse].Left := (ButtonPanel[bidGroupBrowse].Width / 2 - ButtonLabel[bidGroupBrowse].Width / 2);
end;
 
procedure ButtonTextures();
begin
  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:=337
  WizardForm.DirBrowseButton.Width:=ButtonWidth
  WizardForm.DirBrowseButton.Height:=ButtonHeight
 
  WizardForm.GroupBrowseButton.Left:=337
  WizardForm.GroupBrowseButton.Width:=ButtonWidth
  WizardForm.GroupBrowseButton.Height:=ButtonHeight
 
  WizardForm.LicenseAcceptedRadio.OnClick:=@LicenceAcceptedRadioOnClick
 
  WizardForm.LicenseNotAcceptedRadio.OnClick:=@LicenceNotAcceptedRadioOnClick
 
  LoadButtonImage(WizardForm.BackButton,bidBack)
  LoadButtonImage(WizardForm.NextButton,bidNext)
  LoadButtonImage(WizardForm.CancelButton,bidCancel)
  LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse)
  LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse)
end;
 
 
procedure InitializeWizard();
begin
 
  RepaintInstall();
  ButtonTextures();
   
   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;
 
Procedure CurPageChanged(CurPageID: Integer);
Begin
  UpdateButtons(CurPageID);
   
   if (CurPageID = wpFinished) and MyError then
   begin
      WizardForm.Caption:= ExpandConstant('{cm:Error}');
      WizardForm.FinishedLabel.Font.Color:= clRed;
      WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
   end;
end;
 
procedure CurStepChanged(CurStep: TSetupStep);
var ChComp, TmpValue:longword;
    n:integer;
begin
   if CurStep = ssInstall then begin  //Если необходимо, можно переделать на ssPostInstall
      WizardForm.ProgressGauge.Hide;
      CallBack:=WrapMyCallback(@ProgressCallback,2);
      Cancel:=0;
      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 ISArcExtract    ( 0, OveralPct, 0, ExpandConstant('{src}\data-a.bin'),  ExpandConstant('{app}'),                false,CallBack, '',    '',    '') then break;
         if not ISArcExtract    ( 0, OveralPct, 0, ExpandConstant('{src}\data-b.bin'),  ExpandConstant('{app}'),                false,CallBack, '',    '',    '') then break;
 
         if not ISArcExtract    ( 0, OveralPct, 0, ExpandConstant('{src}\data-c.bin'),  ExpandConstant('{app}'),                false,CallBack, '',    '',    '') then break;
         if not ISPrecompExtract( 0, OveralPct, 0, ExpandConstant('{app}\data1-c.dat'),  ExpandConstant('{app}\data-c.dat'),      true, CallBack                  ) then break;
         if not IS7ZipExtract   ( 0, OveralPct, 0, ExpandConstant('{app}\data-c.dat'),   ExpandConstant('{app}\Data\'),                true, CallBack, ''              ) then break;
 
         if not ShowChangeDiskWindow('Пожалуйста, вставьте диск 2 и дождитесь его инициализации.', ExpandConstant('{src}'),'data-d.bin') then break;
         if not ISArcExtract    ( 0, OveralPct, 0, ExpandConstant('{src}\data-d.bin'),  ExpandConstant('{app}'),                false,CallBack, '',    '',    '') then break;
         if not ISPrecompExtract( 0, OveralPct, 0, ExpandConstant('{app}\data1-d.dat'),  ExpandConstant('{app}\data-d.dat'),      true, CallBack                  ) then break;
         if not IS7ZipExtract   ( 0, OveralPct, 0, ExpandConstant('{app}\data-d.dat'),   ExpandConstant('{app}\Data\'),                true, CallBack, ''              ) then break;
 
 
         MyError:=false;
      until true;
      StopRecord;
   end;
   if (CurStep=ssPostInstall) and MyError then
      Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n);
end;

Всего записей: 59 | Зарегистр. 09-01-2009 | Отправлено: 18:59 11-09-2010 | Исправлено: MiniMan, 21:12 11-09-2010
   

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Программы » Inno Setup (создание инсталяционных пакетов)
Widok (23-11-2010 10:55): лимит страниц. продолжаем здесь


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru