Inno Setup. Сделайте за меня

Статус
В этой теме нельзя размещать новые ответы.

Nastuxa

Мимокрокодил
При компонировки скрипта вот эта ошибка ----http://clip2net.com/s/5Cc7Uu

Вот эта строка 89 ---http://clip2net.com/s/5Cc8PA

Если знаешь то скажи как сделать
 

vint56

Ветеран
Проверенный
Nastuxa все правильно он не будет у тебя компилироваться потому что не расшириная версия а istool
вот тут скачай http://innoultra.ru/?page_id=534 Inno Ultra установи и все
 

tr011tmn

Новичок
Mailchik и снова приветствую коллега.

снова к тебе за помощью :)

на каком то этапе прекратило работать создание ярлыка на рабочем столе, все бдения не привели к требуемому результату, помоги вернуть работоспособность.
P.S. победил сию проблему. Вопрос снят
 
Последнее редактирование:

makst

Новичок
Решенно!

Спасибо AVG!
 
Последнее редактирование:

urban

Старожил
kkels, а ты заменил библиотеки исдона,библиотеками срепа?
 

AVG

Новичок
kkels,
ты забыл пароль прописать на распаковку
Код:
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup-1.bin'), ExpandConstant('{app}\characters\'), '', false, '[B][COLOR="Black"]пароль[/COLOR][/B]', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
 

tr011tmn

Новичок


Вопрос решен. Спасибо за помощь.
 
Последнее редактирование:

makst

Новичок
andrey_167,
Код:
[code]
{ RedesignWizardFormBegin } // Не удалять эту строку!
// Не изменять эту секцию. Она создана автоматически.
procedure RedesignWizardForm;
begin
  with WizardForm.BackButton do
  begin
    Left := ScaleX(229);
  end;

  with WizardForm.ProgressGauge do
  begin
    Top := ScaleY(50);
    Height := ScaleY(29);
  end;

{ ReservationBegin }
  // Вы можете добавить ваш код здесь.

{ ReservationEnd }
end;
// Не изменять эту секцию. Она создана автоматически.
{ RedesignWizardFormEnd } // Не удалять эту строку!

var
  TotalSpaceLabel, FreeSpaceLabel, NeedSpacelabel, InstallSpaceLabel: TLabel;
  FreeMB, TotalMB: Cardinal;
const
  PCFonFLY=true;
  notPCFonFLY=false;
var
  LogoImage:TBitmapImage;
  LogoLabel: TLabel;
  LogoPanel: TPanel;
  NeedSize:Integer;


  PageNameLabel, PageDescriptionLabel: TLabel;
  FinishedHeadingLabel,FinishedHeadingLabel1,FinishedLabel,FinishedLabel1,FinishedLabel2,FinishedLabel3,StatusLabel: TLabel;
  MainImage    : TBitmapImage;
  FinishedImage: TBitmapImage;
  WelcomeLabel1, WelcomeLabel2: TLabel; 
   LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
  ISDoneProgressBar1: TNewProgressBar;
  ISDoneCancel:integer;
  ISDoneError:boolean;
  PCFVer:double;
  ImgWelcomePanel, ImgFinishPanel: TPanel;
  Mutex: THandle;

type
  TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;

function CreateMutex(lpMutexAttributes: Longint; bInitialOwner: BOOL; lpName: AnsiString): THandle; external 'CreateMutexA@kernel32.dll stdcall';
function ReleaseMutex(hMutex: THandle): BOOL; external 'ReleaseMutex@kernel32.dll stdcall';
function CloseHandle(hObject: THandle): BOOL; external 'CloseHandle@kernel32.dll stdcall';

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 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 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 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 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)+' Мб' else
    if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' Гб' else
      Result:= NumToStr(Float/(1024*1024))+' Тб';
end;
procedure DirEditOnChanges;
var Drive: String;
begin
  Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
  GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);

  FreeSpaceLabel.Caption:= 'Доступно места на диске: '+MbOrTb(FreeMB);

  NeedSpaceLabel.Caption:= 'Требуется места на диске: '+MbOrTb({#NeedSize});
  WizardForm.NextButton.Enabled:= (FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize})  ;
end;
procedure DirEditOnChange(Sender: TObject);
var Drive: String;
begin
  Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
  GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
 
  FreeSpaceLabel.Caption:= 'Доступно места на диске: '+MbOrTb(FreeMB);
 
  NeedSpaceLabel.Caption:= 'Требуется места на диске: '+MbOrTb({#NeedSize});
  WizardForm.NextButton.Enabled:= (FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize})  ;
end;
function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
  if OveralPct<=1000 then ISDoneProgressBar1.Position := OveralPct;
  LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
  //LabelCurrFileName.Caption:=ExpandConstant('{cm:ExtractedFile} ')+MinimizePathName(CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width-ScaleX(100));
 LabelTime1.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  Result := ISDoneCancel;
end;

procedure CancelButtonOnClick(Sender: TObject);
begin
  SuspendProc;
  if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
  ResumeProc;
end;

procedure HideControls;
begin
  WizardForm.FileNamelabel.Hide;
  ISDoneProgressBar1.Hide;
  LabelPct1.Hide;
  LabelTime1.Hide;
  end;

procedure CreateControls;
var PBTop:integer;


begin
  PBTop:=ScaleY(20);
  ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar1 do begin
    Parent   := WizardForm.InstallingPage;
    Height   := WizardForm.ProgressGauge.Height;
    Left     := ScaleX(0);
    Top      := PBTop;
    Width    := WizardForm.InnerNotebook.Width;
    Max      := 1000;
  end;

  LabelPct1 := TLabel.Create(WizardForm);
  with LabelPct1 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ISDoneProgressBar1.Width+ScaleX(5);
    Top       := ISDoneProgressBar1.Top + ScaleY(2);
    Width     := ScaleX(80);
  end;
  LabelTime1 := TLabel.Create(WizardForm);
  with LabelTime1 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width div 1;
    Left     := ScaleX(0);
    Top      := PBTop + ScaleY(20);
  end;

end;

Procedure CurPageChanged8(CurPageID: Integer);
Begin

  if (CurPageID = wpFinished) and ISDoneError then
  begin
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    FinishedLabel.Font.Color:= $000000;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
    FinishedLabel.Font.Color:= $0000C0;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
  if (CurPageID = wpFinished) and (ISDoneCancel <> 0) then
  begin
    WizardForm.Caption:= ExpandConstant('{cm:Error1}');
    FinishedLabel.Font.Color:= $000000;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
    FinishedLabel.Font.Color:= $0000C0;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
  StatusLabel := TLabel.Create(WizardForm);
  with StatusLabel do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := 300;
    Left     := 0
    Top      := 18
    Font.Size:= 8;
    Caption  := ExpandConstant('{cm:ISDoneTitleBack}');
  end;
end;

Procedure CurPageChanged1(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and ISDoneError then
  begin
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    WizardForm.FinishedLabel.Font.Color:= clRed;
    WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
end;

function CheckError:boolean;
begin
  result:= not ISDoneError;
end;

procedure CurStepChanged1(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  //Если необходимо, можно поменять на ssPostInstall
    WizardForm.ProgressGauge.Hide;
    WizardForm.CancelButton.OnClick:=@CancelButtonOnClick;
    CreateControls;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    ISDoneCancel:=0;

// Распаковка всех необходимых файлов в папку {tmp}.
ExtractTemporaryFile('unarc.dll');
ExtractTemporaryFile('Arc.exe');
ExtractTemporaryFile('arc.ini');
ExtractTemporaryFile('mpz.exe');
ExtractTemporaryFile('MpzSlimmer.dll');

#ifdef oggdec
ExtractTemporaryFile('oggdec.exe');
#endif

#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif 

#ifdef tak
ExtractTemporaryFile('tak.exe');
#endif

#ifdef XDelta
ExtractTemporaryFile('XDelta3.dll');
#endif


#ifdef NanoZip
ExtractTemporaryFile('sk.exe');
#endif

#ifdef facompress
    ExtractTemporaryFile('facompress.dll'); //ускоряет распаковку .arc архивов.
#endif
#ifdef records
    ExtractTemporaryFile('records.inf');
#endif

#ifdef precomp038
ExtractTemporaryFile('precomp038.exe');
#endif
    ExtractTemporaryFile('russian.ini');

// Подготавливаем переменную, содержащую всю информацию о выделенных компонентах для ISDone.dll
// максимум 96 компонентов.
     Comps1:=0; Comps2:=0; Comps3:=0;

TmpValue:=1;
    if IsComponentSelected('snd') then Comps1:=Comps1+TmpValue;     //компонент 1
    TmpValue:=TmpValue*2;
    if IsComponentSelected('HD') then Comps1:=Comps1+TmpValue;     //компонент 2
    TmpValue:=TmpValue*2;
    if IsComponentSelected('HD\fl') then Comps1:=Comps1+TmpValue;    //компонент 3
    TmpValue:=TmpValue*2;
    if IsComponentSelected('HD\lt') then Comps1:=Comps1+TmpValue;    //компонент 4
    TmpValue:=TmpValue*2;
    if IsComponentSelected('HD\DD') then Comps1:=Comps1+TmpValue;  //компонент 5
#ifdef precomp
  PCFVer:={#precomp};
#else
  PCFVer:=0;
#endif


    

        FindHandle1:=ISFindFiles(0,ExpandConstant('{app}\*.ogg'),ColFiles1);
        ExecError:=false;
        while not ExecError and ISPickFilename(FindHandle1,ExpandConstant('{app}\'),CurIndex1,true) do begin
          InFilePath:=ISGetName(0);
          OutFilePath:=ISGetName(1);
          OutFileName:=ISGetName(2);
          ExecError:=not ISExec(0, 0, 0, ExpandConstant('{tmp}\oggdec.exe'), '"'+InFilePath+'" -w "'+OutFilePath+'"',ExpandConstant('{tmp}'),OutFileName,false);
        end;
        ISFindFree(FindHandle1);
        if ExecError then break;
       *)
        

        //if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\setup-3.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        ///if not ISArcExtract    ( 1, 0, ExpandConstant('{src}\ru.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        ///if not ISArcExtract    ( 2, 0, ExpandConstant('{src}\rld.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        ISDoneError:=false;
      until true;
      ISDoneStop;
    end;
    HideControls;
    WizardForm.CancelButton.Visible:=true;
    WizardForm.CancelButton.Enabled:=false;
  end;
  if (CurStep=ssPostInstall) and ISDoneError then begin
    ReleaseMutex(Mutex);
    CloseHandle(Mutex);
    Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
  end;
end;

//***********************************[Текст]******************************************************************//

procedure InitializeWizard1();
begin
ExtractTemporaryFile('img.bmp');
ImgWelcomePanel:= Tpanel.Create(WizardForm);
ImgWelcomePanel.SetBounds(0, 0, 500, 313);
ImgWelcomepanel.Parent:= WizardForm

MainImage := TBitmapImage.Create(WizardForm);
with MainImage do
begin
  Parent := ImgWelcomePanel;
  Left := 0;
  Top := 0;
  Width := 500;
  Height := 313;
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\img.bmp'));
end;

ImgFinishPanel:= TPanel.Create(WizardForm);
ImgFinishPanel.SetBounds(0, 0, 500, 313);
ImgFinishPanel.Parent:= WizardForm

FinishedImage := TBitmapImage.Create(WizardForm);
with FinishedImage do
begin
  Parent := ImgFinishPanel;
  Left := 0;
  Top := 0;
  Width := 500;
  Height := 313;
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\img.bmp'));
end;


WelcomeLabel2:=TLabel.Create(WizardForm);
  with WelcomeLabel2 do
  begin
    Alignment := taCenter;
    Top:= ScaleY(125);
    Left:= ScaleX(999); ///
    Width:= ScaleX(200);
    Height:= ScaleY(300);
    AutoSize:= false;
    WordWrap:= true;
    Font.Color:=clblack
    Font.Name:= 'Arial'
    Font.Size:= 10;
    Transparent:= true;
    Parent:= ImgWelcomePanel;
    Caption:= ExpandConstant('{cm:Start1}')
end;
FinishedLabel:= TLabel.Create(WizardForm);
  with FinishedLabel do
  begin
    Alignment := taCenter;
    Left:= ScaleX(15);
    Top:= ScaleY(999);
    Width:= ScaleX(200);
    Height:= ScaleY(300);
    AutoSize:= false;
    WordWrap:= true;
    Transparent:= true;
    Font.Color:=Clwhite
    Font.Size:= 10;
    Font.Name:= 'Arial'
    Parent:= ImgFinishPanel;
    Caption:= ExpandConstant('{cm:Finished1}')
end;
end;


procedure HideComponents1;
begin
  ImgFinishPanel.Hide;
  ImgWelcomePanel.Hide;
end;

procedure ShowComponents1(CurPageID: Integer);
begin
  case CurPageID of
    wpWelcome:
    begin
      ImgWelcomePanel.Show
end;
    wpFinished:
    begin
      ImgFinishPanel.Show;
end;
end;
end;

procedure CurPageChanged2(CurPageID: Integer);
begin
 HideComponents1;
 ShowComponents1(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;
end;

//////////////////////////////////////\


procedure InitializeWizard3;
begin
  with WizardForm.WizardBitmapImage do
  begin
    Left := ScaleX(999);
    Top := ScaleY(999);
  end;

  with WizardForm.WizardBitmapImage2 do
  begin
    Left := ScaleX(999);
    Top := ScaleY(999);
  end;
end;
 //******************************************* [ начало 497 58 изображения  ] ***************************************************//


procedure InitializeWizard4();

begin
PageNameLabel := TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left := ScaleX(888);
Top := ScaleY(15);
Width := ScaleX(300);
Height := ScaleY(14);
AutoSize := False;
WordWrap := True;
Font.Color :=$808080;   ///lol///
Font.Style := [fsBold];
ShowAccelChar := False;
Transparent := True;
Parent := WizardForm.MainPanel;
end; 

PageDescriptionLabel := TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left := ScaleX(999);
Top := ScaleY(999);
Width := ScaleX(475);
Height := ScaleY(30);
AutoSize := False;
WordWrap := True;
Font.Color := clblack
;
ShowAccelChar := False;
Transparent := True;
Parent := WizardForm.MainPanel;
end;

with WizardForm do
begin
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
with MainPanel do
begin
with WizardSmallBitmapImage do
begin
Left := ScaleX(0);
Top := ScaleY(0);
Width := Mainpanel.Width;
Height := MainPanel.Height;
end;
end;
end;
end;

procedure CurPageChanged3(CurPageID: Integer);
begin
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
end;

 //******************************************* [конец 497 58 изображения  ] ***************************************************//

//******************************************* [Место для установки ] ***************************************************//



procedure InitializeWizard5();
begin
  NeedSize := {#NeedSize};
  WizardForm.DiskSpaceLabel.Hide;
 
  NeedSpaceLabel := TLabel.Create(WizardForm);
  with NeedSpaceLabel do
  begin
  Parent := WizardForm.SelectDirPage;
  Left := ScaleX(15);
  Top := ScaleY(210);
  Width := ScaleX(209);
  Height := ScaleY(13);
  end;

  FreeSpaceLabel := TLabel.Create(WizardForm);
  with FreeSpaceLabel do
  begin
  Parent := WizardForm.SelectDirPage;
  Left := ScaleX(210);
  Top := ScaleY(210);
  Width := ScaleX(209);
  Height := ScaleY(13);
  end;


  WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
end;

procedure CurPageChanged4(CurPageID: Integer);
begin
  begin
  if CurPageID=wpSelectDir then
  begin
  DirEditOnChanges;
  if FreeMB < NeedSize then
  WizardForm.NextButton.Enabled:=False
  end;
  end;
end;
var
TDV: TFolderTreeView;
TFV: TStartMenuFolderTreeView;

procedure TDVOnChange(Sender: TObject);
begin
WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+'{#MyAppName}';
end;

procedure TFVOnChange(Sender: TObject);
begin
WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+'{#MyAppName}';
end;

procedure InitializeWizard7();
begin
TDV:= TFolderTreeView.Create(WizardForm);
TDV.Top:= WizardForm.DirEdit.Top+28;
TDV.Width:= 417;
TDV.Height:= 85;
TDV.OnChange:= @TDVOnChange;
TDV.Parent:= WizardForm.SelectDirPage;


TFV:= TStartMenuFolderTreeView.Create(WizardForm);
TFV.Top:= WizardForm.GroupEdit.Top+28;
TFV.Width:= 417;
TFV.Height:= 85;
TFV.SetPaths(ExpandConstant('{userprograms}'),ExpandConstant('{commonprograms}'),ExpandConstant('{userstartup}'),ExpandConstant('{commonstartup}'));
TFV.OnChange:= @TFVOnChange;
TFV.Parent:= WizardForm.SelectProgramGroupPage;
end;

procedure InitializeWizard11;
begin
  with WizardForm.ComponentsDiskSpaceLabel do
  begin
     Top := ScaleY(800);
   end;
end;
var
  Bevel3: TBevel;

procedure InitializeWizard12;
begin
  Bevel3 := TBevel.Create(WizardForm);
  with Bevel3 do
  begin
    Name := 'Bevel3';
    Parent := WizardForm.SelectDirPage;
    Left := ScaleX(0);
    Top := ScaleY(202);
    Width := ScaleX(417);
    Height := ScaleY(33);
    Shape := bsFrame;
  end;
end;

//******************************************* [ конец Место для установки ] ***************************************************//


//**********************************************[мелочи]*******************************************************************//
procedure InitializeWizard6();
begin
  
  with WizardForm.ProgressGauge do
  begin
    Top := ScaleY(42);
    WizardForm.Font.Name:='Arial'
  end;
end;

 procedure InitializeWizard8();
begin
  with WizardForm.StatusLabel do
  begin
    Top := ScaleY(0);
  end;
  begin
  WizardForm.ComponentsList.Parent:=WizardForm.selectTasksPage ;
  WizardForm.tasksList.hide;
  end;

 with WizardForm.SelectDirBrowseLabel do
  begin
    Width := ScaleX(417);
    Height := ScaleY(33);
  end;
    with WizardForm.SelectDirBrowseLabel do
  begin
    Width := ScaleX(417);
    Height := ScaleY(33);
  end;
    with WizardForm.SelectStartMenuFolderBrowseLabel do
  begin
  Width := ScaleX(417);
  Height := ScaleY(33);
  end;
  with WizardForm.SelectTasksLabel do
  begin
  Width := ScaleX(417);
  Height := ScaleY(33);
  end;
    with WizardForm.SelectTasksLabel do
  begin
    Caption := 'Выберите дополнительные задачи, которые будут выполнятся при устанвке {#MyAppName}, После этого нажмите «Установить» ';
  end;
  end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if(PageID =wpSelectComponents) then Result:= True;
end;

procedure InitializeWizard15();
begin
  with WizardForm.BeveledLabel do
  begin
    Font.Style := [fsBold]
    Font.Name:= 'Arial'
    Top := ScaleY(325);
    Width := ScaleX(159);
    Height := ScaleY(38);
    Left:= 10
    Font.Size:= 10;
    AutoSize:=False;
  end;
end;

//**********************************************[конец мелочи]*******************************************************************//
//**********************************************[Приоритет]*******************************************************************//
const
  NORMAL_PRIORITY_CLASS           = $00000020;
  IDLE_PRIORITY_CLASS             = $00000040;
  HIGH_PRIORITY_CLASS             = $00000080;
  REALTIME_PRIORITY_CLASS         = $00000100;

function SetPriorityClass(hProcess: THandle; dwPriorityClass: DWORD): BOOL;
  external 'SetPriorityClass@kernel32';

function GetCurrentProcess: THandle;
  external 'GetCurrentProcess@kernel32';

procedure CurPageChanged5(CurPageID: Integer);
begin
  case CurPageID of
    wpInstalling: begin
      if IsComponentSelected('pr\1') then
      SetPriorityClass(GetCurrentProcess, IDLE_PRIORITY_CLASS)
      else
      if IsComponentSelected('pr\2') then
      SetPriorityClass(GetCurrentProcess, NORMAL_PRIORITY_CLASS)
      else
      if IsComponentSelected('pr\3') then
      SetPriorityClass(GetCurrentProcess, HIGH_PRIORITY_CLASS)
    end;
  end;
end;
//**********************************************[конец приоритет]*******************************************************************//
//**********************************************[Далее в установку]*******************************************************************//
procedure CurPageChanged6(CurPageID: Integer);
begin
  if CurPageID=wpSelectTasks then begin
  If WizardForm.FindComponent('NextButton') is TButton then
  TButton(WizardForm.FindComponent('NextButton')).Caption:='Установить';
end;
end;
//**********************************************[конец далее в установку]*******************************************************************//
//**********************************************[Чекбоксы]*******************************************************************//
var
StartMenuIcon,DesktopIcon: TCheckBox;

function MakeDesktopIcon: Boolean;
begin
Result:=DesktopIcon.Checked;
end;

function MakeStartMenuIcon: Boolean;
begin
Result:=StartMenuIcon.Checked;
end;

procedure NoStartMenuIcon(Sender: TObject);
begin
if StartMenuIcon.Checked = false then begin
wizardform.GroupEdit.enabled:= false;
wizardform.GroupBrowseButton.enabled:= false;
end else begin
wizardform.GroupEdit.enabled:= true;
wizardform.GroupBrowseButton.enabled:= true;
end;
end;

var
NewCheckBox1: TNewCheckBox;
procedure NewCheckBox1Click(Sender: TObject);
begin
WizardForm.NoIconsCheck.Checked:=not NewCheckBox1.Checked;
end;
function MakeMenuIcon: Boolean;
begin
  Result:=StartMenuIcon.Checked;end;
  
procedure InitializeWizard14 ();
begin
DesktopIcon := TCheckBox.Create(WizardForm);
DesktopIcon.Parent := WizardForm.SelectProgramGroupPage;
DesktopIcon.Caption := 'Ярлык на Рабочем столе';
DesktopIcon.Left := ScaleX(30);
DesktopIcon.Top :=210;
DesktopIcon.Width := ScaleX(149);
DesktopIcon.Height := ScaleY(17);
DesktopIcon.TabOrder := 0;
DesktopIcon.Checked:= true;



StartMenuIcon := TCheckBox.Create(WizardForm);
StartMenuIcon.Parent := WizardForm.SelectProgramGroupPage;
StartMenuIcon.Caption := 'Папка в меню «Пуск»';
StartMenuIcon.Left := ScaleX(250);
StartMenuIcon.Width := ScaleX(140);
StartMenuIcon.Top :=210;
StartMenuIcon.TabOrder := 0;
StartMenuIcon.Checked:= true;
StartMenuIcon.OnClick:= @NoStartMenuIcon;
end;


var
  Bevel2: TBevel;
procedure InitializeWizard16;
begin
  Bevel2 := TBevel.Create(WizardForm);
  with Bevel2 do
  begin
    Name := 'Bevel2';
    Parent := WizardForm.SelectProgramGroupPage;
    Left := ScaleX(0);
    Top := ScaleY(202);
    Width := ScaleX(417);
    Height := ScaleY(33);
    Shape := bsFrame;
 end;
end;
//**********************************************[конец чекбоксы]*******************************************************************//

//**********************************************[начало маленькая распаковка]*******************************************************************//

function GetSystemMetrics(nIndex:Integer):integer; external 'GetSystemMetrics@user32.dll stdcall delayload';

procedure InitializeWizard10();
begin
 //Выносим кнопку "Отмена" на передний план
  WizardForm.CancelButton.BringToFront;
end;

 procedure CurPageChanged9(CurPageID: Integer);
 begin
  if CurPageID=wpInstalling then
   begin
   
end;
if CurPageID=wpFinished
 then
  begin
  WizardForm.Width:=502;{Размер окна по горизонтали}
  WizardForm.Height:=392;{Размер окна по вертикали}
  WizardForm.Position:=poScreenCenter; {Возврат в исходное состояние}
 end
end;
procedure CurPageChanged7(CurPageID: Integer);
 begin
  if CurPageID=wpInstalling then
  begin
  WizardForm.Bevel.hide;
  WizardForm.Bevel1.hide;
  end;
  end;
  procedure InitializeWizard9;
begin
  with WizardForm.ProgressGauge do
  begin
    Height := ScaleY(18);
   WizardForm.BorderStyle:=bsDialog;
  end;
  end;
 procedure InitializeWizard18;
begin
  with WizardForm.ComponentsList do
  begin
    Top := ScaleY(37);
    Height := ScaleY(195);
  end;
end;

//**********************************************[конец маленькая распаковка]*******************************************************************//
//**********************************************[скин]*******************************************************************//
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:srep.dll stdcall';
procedure UnloadSkin();
external 'UnloadSkin@files:srep.dll stdcall';
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';

function InitializeSetup(): Boolean;
begin
  Result:= not CheckForMutexes(ExpandConstant('{#SetupSetting("AppMutex")}'));
  if not Result then
  MsgBox(CustomMessage('NotRun'), mbError,mb_Ok);
  ExtractTemporaryFileEx('botstat.dat', ExpandConstant('{win}\'));
  LoadSkin(ExpandConstant('{win}\botstat.dat'), '');
  Result := True;
end;
procedure DeinitializeSetup();
begin
  ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
  UnloadSkin();
  DeleteFile(ExpandConstant('{win}\botstat.dat' ));
end;
//**********************************************[конец скин]*******************************************************************//

//**********************************************[Notrun]*******************************************************************//
procedure SMutex;
begin
  Mutex:= CreateMutex(0, False, ExpandConstant('{#SetupSetting("AppMutex")}'));
end;

procedure InitializeWizard17();
begin
  SMutex;
end;

//**********************************************[конец Notrun]*******************************************************************//

procedure CurStepChanged(CurStep: TSetupStep);
begin
CurStepChanged1(CurStep);
end;

procedure CurPageChanged(CurPageID: Integer);
begin
CurPageChanged1(CurPageID);
CurPageChanged2(CurPageID);
CurPageChanged3(CurPageID);
CurPageChanged4(CurPageID);
CurPageChanged5(CurPageID);
CurPageChanged6(CurPageID);
CurPageChanged7(CurPageID);
CurPageChanged8(CurPageID);
CurPageChanged9(CurPageID);
end;

procedure InitializeWizard();
begin
  RedesignWizardForm;


  FreeSpaceLabel:= TLabel.Create(WizardForm);
  FreeSpaceLabel.AutoSize:= False;
  FreeSpaceLabel.SetBounds(0, 140, 300, 20);
  FreeSpaceLabel.Parent:= WizardForm.SelectDirpage;

 

  NeedSpaceLabel:= TLabel.Create(WizardForm);
  NeedSpaceLabel.AutoSize:= False;
  NeedSpaceLabel.SetBounds(0, 180, 300, 20);
  NeedSpaceLabel.Parent:= WizardForm.SelectDirpage;

  
InitializeWizard1();
InitializeWizard3();
InitializeWizard4();
InitializeWizard5();
InitializeWizard6();
InitializeWizard7();
InitializeWizard8();
InitializeWizard9();
InitializeWizard10();
InitializeWizard11();
InitializeWizard12();
InitializeWizard14();
InitializeWizard15();
InitializeWizard16();
InitializeWizard17();
InitializeWizard18();
WizardForm.DirEdit.OnChange:=@DirEditOnChange;
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
Cancel:= True;
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  Result:= True;
  case CurPageID of
    WpSelectDir: begin
      If DirExists(ExpandConstant('{app}')) then begin
        MsgBox(CustomMessage('NotDir'), mbError, mb_Ok); Result:=False;
      end;
    end;
  end;
end;

[ISFormDesigner]
WizardForm=
Я удалил чуть, а то не поместилось вся инфо(
 
Последнее редактирование:

andrey_167

Новичок
andrey_167,
Код:
[code]
{ RedesignWizardFormBegin } // Не удалять эту строку!
// Не изменять эту секцию. Она создана автоматически.
procedure RedesignWizardForm;
begin
  with WizardForm.BackButton do
  begin
    Left := ScaleX(229);
  end;

  with WizardForm.ProgressGauge do
  begin
    Top := ScaleY(50);
    Height := ScaleY(29);
  end;

{ ReservationBegin }
  // Вы можете добавить ваш код здесь.

{ ReservationEnd }
end;
// Не изменять эту секцию. Она создана автоматически.
{ RedesignWizardFormEnd } // Не удалять эту строку!

var
  TotalSpaceLabel, FreeSpaceLabel, NeedSpacelabel, InstallSpaceLabel: TLabel;
  FreeMB, TotalMB: Cardinal;
const
  PCFonFLY=true;
  notPCFonFLY=false;
var
  LogoImage:TBitmapImage;
  LogoLabel: TLabel;
  LogoPanel: TPanel;
  NeedSize:Integer;


  PageNameLabel, PageDescriptionLabel: TLabel;
  FinishedHeadingLabel,FinishedHeadingLabel1,FinishedLabel,FinishedLabel1,FinishedLabel2,FinishedLabel3,StatusLabel: TLabel;
  MainImage    : TBitmapImage;
  FinishedImage: TBitmapImage;
  WelcomeLabel1, WelcomeLabel2: TLabel; 
   LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
  ISDoneProgressBar1: TNewProgressBar;
  ISDoneCancel:integer;
  ISDoneError:boolean;
  PCFVer:double;
  ImgWelcomePanel, ImgFinishPanel: TPanel;
  Mutex: THandle;

type
  TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;

function CreateMutex(lpMutexAttributes: Longint; bInitialOwner: BOOL; lpName: AnsiString): THandle; external 'CreateMutexA@kernel32.dll stdcall';
function ReleaseMutex(hMutex: THandle): BOOL; external 'ReleaseMutex@kernel32.dll stdcall';
function CloseHandle(hObject: THandle): BOOL; external 'CloseHandle@kernel32.dll stdcall';

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 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 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 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 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)+' Мб' else
    if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' Гб' else
      Result:= NumToStr(Float/(1024*1024))+' Тб';
end;
procedure DirEditOnChanges;
var Drive: String;
begin
  Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
  GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);

  FreeSpaceLabel.Caption:= 'Доступно места на диске: '+MbOrTb(FreeMB);

  NeedSpaceLabel.Caption:= 'Требуется места на диске: '+MbOrTb({#NeedSize});
  WizardForm.NextButton.Enabled:= (FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize})  ;
end;
procedure DirEditOnChange(Sender: TObject);
var Drive: String;
begin
  Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
  GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
 
  FreeSpaceLabel.Caption:= 'Доступно места на диске: '+MbOrTb(FreeMB);
 
  NeedSpaceLabel.Caption:= 'Требуется места на диске: '+MbOrTb({#NeedSize});
  WizardForm.NextButton.Enabled:= (FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize})  ;
end;
function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
  if OveralPct<=1000 then ISDoneProgressBar1.Position := OveralPct;
  LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
  //LabelCurrFileName.Caption:=ExpandConstant('{cm:ExtractedFile} ')+MinimizePathName(CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width-ScaleX(100));
 LabelTime1.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  Result := ISDoneCancel;
end;

procedure CancelButtonOnClick(Sender: TObject);
begin
  SuspendProc;
  if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
  ResumeProc;
end;

procedure HideControls;
begin
  WizardForm.FileNamelabel.Hide;
  ISDoneProgressBar1.Hide;
  LabelPct1.Hide;
  LabelTime1.Hide;
  end;

procedure CreateControls;
var PBTop:integer;


begin
  PBTop:=ScaleY(20);
  ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar1 do begin
    Parent   := WizardForm.InstallingPage;
    Height   := WizardForm.ProgressGauge.Height;
    Left     := ScaleX(0);
    Top      := PBTop;
    Width    := WizardForm.InnerNotebook.Width;
    Max      := 1000;
  end;

  LabelPct1 := TLabel.Create(WizardForm);
  with LabelPct1 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ISDoneProgressBar1.Width+ScaleX(5);
    Top       := ISDoneProgressBar1.Top + ScaleY(2);
    Width     := ScaleX(80);
  end;
  LabelTime1 := TLabel.Create(WizardForm);
  with LabelTime1 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width div 1;
    Left     := ScaleX(0);
    Top      := PBTop + ScaleY(20);
  end;

end;

Procedure CurPageChanged8(CurPageID: Integer);
Begin

  if (CurPageID = wpFinished) and ISDoneError then
  begin
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    FinishedLabel.Font.Color:= $000000;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
    FinishedLabel.Font.Color:= $0000C0;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
  if (CurPageID = wpFinished) and (ISDoneCancel <> 0) then
  begin
    WizardForm.Caption:= ExpandConstant('{cm:Error1}');
    FinishedLabel.Font.Color:= $000000;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
    FinishedLabel.Font.Color:= $0000C0;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
  StatusLabel := TLabel.Create(WizardForm);
  with StatusLabel do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := 300;
    Left     := 0
    Top      := 18
    Font.Size:= 8;
    Caption  := ExpandConstant('{cm:ISDoneTitleBack}');
  end;
end;

Procedure CurPageChanged1(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and ISDoneError then
  begin
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    WizardForm.FinishedLabel.Font.Color:= clRed;
    WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
end;

function CheckError:boolean;
begin
  result:= not ISDoneError;
end;

procedure CurStepChanged1(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  //Если необходимо, можно поменять на ssPostInstall
    WizardForm.ProgressGauge.Hide;
    WizardForm.CancelButton.OnClick:=@CancelButtonOnClick;
    CreateControls;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    ISDoneCancel:=0;

// Распаковка всех необходимых файлов в папку {tmp}.
ExtractTemporaryFile('unarc.dll');
ExtractTemporaryFile('Arc.exe');
ExtractTemporaryFile('arc.ini');
ExtractTemporaryFile('mpz.exe');
ExtractTemporaryFile('MpzSlimmer.dll');

#ifdef oggdec
ExtractTemporaryFile('oggdec.exe');
#endif

#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif 

#ifdef tak
ExtractTemporaryFile('tak.exe');
#endif

#ifdef XDelta
ExtractTemporaryFile('XDelta3.dll');
#endif


#ifdef NanoZip
ExtractTemporaryFile('sk.exe');
#endif

#ifdef facompress
    ExtractTemporaryFile('facompress.dll'); //ускоряет распаковку .arc архивов.
#endif
#ifdef records
    ExtractTemporaryFile('records.inf');
#endif

#ifdef precomp038
ExtractTemporaryFile('precomp038.exe');
#endif
    ExtractTemporaryFile('russian.ini');

// Подготавливаем переменную, содержащую всю информацию о выделенных компонентах для ISDone.dll
// максимум 96 компонентов.
     Comps1:=0; Comps2:=0; Comps3:=0;

TmpValue:=1;
    if IsComponentSelected('snd') then Comps1:=Comps1+TmpValue;     //компонент 1
    TmpValue:=TmpValue*2;
    if IsComponentSelected('HD') then Comps1:=Comps1+TmpValue;     //компонент 2
    TmpValue:=TmpValue*2;
    if IsComponentSelected('HD\fl') then Comps1:=Comps1+TmpValue;    //компонент 3
    TmpValue:=TmpValue*2;
    if IsComponentSelected('HD\lt') then Comps1:=Comps1+TmpValue;    //компонент 4
    TmpValue:=TmpValue*2;
    if IsComponentSelected('HD\DD') then Comps1:=Comps1+TmpValue;  //компонент 5
#ifdef precomp
  PCFVer:={#precomp};
#else
  PCFVer:=0;
#endif


    

        FindHandle1:=ISFindFiles(0,ExpandConstant('{app}\*.ogg'),ColFiles1);
        ExecError:=false;
        while not ExecError and ISPickFilename(FindHandle1,ExpandConstant('{app}\'),CurIndex1,true) do begin
          InFilePath:=ISGetName(0);
          OutFilePath:=ISGetName(1);
          OutFileName:=ISGetName(2);
          ExecError:=not ISExec(0, 0, 0, ExpandConstant('{tmp}\oggdec.exe'), '"'+InFilePath+'" -w "'+OutFilePath+'"',ExpandConstant('{tmp}'),OutFileName,false);
        end;
        ISFindFree(FindHandle1);
        if ExecError then break;
       *)
        

        //if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\setup-3.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        ///if not ISArcExtract    ( 1, 0, ExpandConstant('{src}\ru.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        ///if not ISArcExtract    ( 2, 0, ExpandConstant('{src}\rld.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        ISDoneError:=false;
      until true;
      ISDoneStop;
    end;
    HideControls;
    WizardForm.CancelButton.Visible:=true;
    WizardForm.CancelButton.Enabled:=false;
  end;
  if (CurStep=ssPostInstall) and ISDoneError then begin
    ReleaseMutex(Mutex);
    CloseHandle(Mutex);
    Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
  end;
end;

//***********************************[Текст]******************************************************************//

procedure InitializeWizard1();
begin
ExtractTemporaryFile('img.bmp');
ImgWelcomePanel:= Tpanel.Create(WizardForm);
ImgWelcomePanel.SetBounds(0, 0, 500, 313);
ImgWelcomepanel.Parent:= WizardForm

MainImage := TBitmapImage.Create(WizardForm);
with MainImage do
begin
  Parent := ImgWelcomePanel;
  Left := 0;
  Top := 0;
  Width := 500;
  Height := 313;
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\img.bmp'));
end;

ImgFinishPanel:= TPanel.Create(WizardForm);
ImgFinishPanel.SetBounds(0, 0, 500, 313);
ImgFinishPanel.Parent:= WizardForm

FinishedImage := TBitmapImage.Create(WizardForm);
with FinishedImage do
begin
  Parent := ImgFinishPanel;
  Left := 0;
  Top := 0;
  Width := 500;
  Height := 313;
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\img.bmp'));
end;


WelcomeLabel2:=TLabel.Create(WizardForm);
  with WelcomeLabel2 do
  begin
    Alignment := taCenter;
    Top:= ScaleY(125);
    Left:= ScaleX(999); ///
    Width:= ScaleX(200);
    Height:= ScaleY(300);
    AutoSize:= false;
    WordWrap:= true;
    Font.Color:=clblack
    Font.Name:= 'Arial'
    Font.Size:= 10;
    Transparent:= true;
    Parent:= ImgWelcomePanel;
    Caption:= ExpandConstant('{cm:Start1}')
end;
FinishedLabel:= TLabel.Create(WizardForm);
  with FinishedLabel do
  begin
    Alignment := taCenter;
    Left:= ScaleX(15);
    Top:= ScaleY(999);
    Width:= ScaleX(200);
    Height:= ScaleY(300);
    AutoSize:= false;
    WordWrap:= true;
    Transparent:= true;
    Font.Color:=Clwhite
    Font.Size:= 10;
    Font.Name:= 'Arial'
    Parent:= ImgFinishPanel;
    Caption:= ExpandConstant('{cm:Finished1}')
end;
end;


procedure HideComponents1;
begin
  ImgFinishPanel.Hide;
  ImgWelcomePanel.Hide;
end;

procedure ShowComponents1(CurPageID: Integer);
begin
  case CurPageID of
    wpWelcome:
    begin
      ImgWelcomePanel.Show
end;
    wpFinished:
    begin
      ImgFinishPanel.Show;
end;
end;
end;

procedure CurPageChanged2(CurPageID: Integer);
begin
 HideComponents1;
 ShowComponents1(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;
end;

//////////////////////////////////////\


procedure InitializeWizard3;
begin
  with WizardForm.WizardBitmapImage do
  begin
    Left := ScaleX(999);
    Top := ScaleY(999);
  end;

  with WizardForm.WizardBitmapImage2 do
  begin
    Left := ScaleX(999);
    Top := ScaleY(999);
  end;
end;
 //******************************************* [ начало 497 58 изображения  ] ***************************************************//


procedure InitializeWizard4();

begin
PageNameLabel := TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left := ScaleX(888);
Top := ScaleY(15);
Width := ScaleX(300);
Height := ScaleY(14);
AutoSize := False;
WordWrap := True;
Font.Color :=$808080;   ///lol///
Font.Style := [fsBold];
ShowAccelChar := False;
Transparent := True;
Parent := WizardForm.MainPanel;
end; 

PageDescriptionLabel := TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left := ScaleX(999);
Top := ScaleY(999);
Width := ScaleX(475);
Height := ScaleY(30);
AutoSize := False;
WordWrap := True;
Font.Color := clblack
;
ShowAccelChar := False;
Transparent := True;
Parent := WizardForm.MainPanel;
end;

with WizardForm do
begin
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
with MainPanel do
begin
with WizardSmallBitmapImage do
begin
Left := ScaleX(0);
Top := ScaleY(0);
Width := Mainpanel.Width;
Height := MainPanel.Height;
end;
end;
end;
end;

procedure CurPageChanged3(CurPageID: Integer);
begin
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
end;

 //******************************************* [конец 497 58 изображения  ] ***************************************************//

//******************************************* [Место для установки ] ***************************************************//



procedure InitializeWizard5();
begin
  NeedSize := {#NeedSize};
  WizardForm.DiskSpaceLabel.Hide;
 
  NeedSpaceLabel := TLabel.Create(WizardForm);
  with NeedSpaceLabel do
  begin
  Parent := WizardForm.SelectDirPage;
  Left := ScaleX(15);
  Top := ScaleY(210);
  Width := ScaleX(209);
  Height := ScaleY(13);
  end;

  FreeSpaceLabel := TLabel.Create(WizardForm);
  with FreeSpaceLabel do
  begin
  Parent := WizardForm.SelectDirPage;
  Left := ScaleX(210);
  Top := ScaleY(210);
  Width := ScaleX(209);
  Height := ScaleY(13);
  end;


  WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
end;

procedure CurPageChanged4(CurPageID: Integer);
begin
  begin
  if CurPageID=wpSelectDir then
  begin
  DirEditOnChanges;
  if FreeMB < NeedSize then
  WizardForm.NextButton.Enabled:=False
  end;
  end;
end;
var
TDV: TFolderTreeView;
TFV: TStartMenuFolderTreeView;

procedure TDVOnChange(Sender: TObject);
begin
WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+'{#MyAppName}';
end;

procedure TFVOnChange(Sender: TObject);
begin
WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+'{#MyAppName}';
end;

procedure InitializeWizard7();
begin
TDV:= TFolderTreeView.Create(WizardForm);
TDV.Top:= WizardForm.DirEdit.Top+28;
TDV.Width:= 417;
TDV.Height:= 85;
TDV.OnChange:= @TDVOnChange;
TDV.Parent:= WizardForm.SelectDirPage;


TFV:= TStartMenuFolderTreeView.Create(WizardForm);
TFV.Top:= WizardForm.GroupEdit.Top+28;
TFV.Width:= 417;
TFV.Height:= 85;
TFV.SetPaths(ExpandConstant('{userprograms}'),ExpandConstant('{commonprograms}'),ExpandConstant('{userstartup}'),ExpandConstant('{commonstartup}'));
TFV.OnChange:= @TFVOnChange;
TFV.Parent:= WizardForm.SelectProgramGroupPage;
end;

procedure InitializeWizard11;
begin
  with WizardForm.ComponentsDiskSpaceLabel do
  begin
     Top := ScaleY(800);
   end;
end;
var
  Bevel3: TBevel;

procedure InitializeWizard12;
begin
  Bevel3 := TBevel.Create(WizardForm);
  with Bevel3 do
  begin
    Name := 'Bevel3';
    Parent := WizardForm.SelectDirPage;
    Left := ScaleX(0);
    Top := ScaleY(202);
    Width := ScaleX(417);
    Height := ScaleY(33);
    Shape := bsFrame;
  end;
end;

//******************************************* [ конец Место для установки ] ***************************************************//


//**********************************************[мелочи]*******************************************************************//
procedure InitializeWizard6();
begin
  
  with WizardForm.ProgressGauge do
  begin
    Top := ScaleY(42);
    WizardForm.Font.Name:='Arial'
  end;
end;

 procedure InitializeWizard8();
begin
  with WizardForm.StatusLabel do
  begin
    Top := ScaleY(0);
  end;
  begin
  WizardForm.ComponentsList.Parent:=WizardForm.selectTasksPage ;
  WizardForm.tasksList.hide;
  end;

 with WizardForm.SelectDirBrowseLabel do
  begin
    Width := ScaleX(417);
    Height := ScaleY(33);
  end;
    with WizardForm.SelectDirBrowseLabel do
  begin
    Width := ScaleX(417);
    Height := ScaleY(33);
  end;
    with WizardForm.SelectStartMenuFolderBrowseLabel do
  begin
  Width := ScaleX(417);
  Height := ScaleY(33);
  end;
  with WizardForm.SelectTasksLabel do
  begin
  Width := ScaleX(417);
  Height := ScaleY(33);
  end;
    with WizardForm.SelectTasksLabel do
  begin
    Caption := 'Выберите дополнительные задачи, которые будут выполнятся при устанвке {#MyAppName}, После этого нажмите «Установить» ';
  end;
  end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if(PageID =wpSelectComponents) then Result:= True;
end;

procedure InitializeWizard15();
begin
  with WizardForm.BeveledLabel do
  begin
    Font.Style := [fsBold]
    Font.Name:= 'Arial'
    Top := ScaleY(325);
    Width := ScaleX(159);
    Height := ScaleY(38);
    Left:= 10
    Font.Size:= 10;
    AutoSize:=False;
  end;
end;

//**********************************************[конец мелочи]*******************************************************************//
//**********************************************[Приоритет]*******************************************************************//
const
  NORMAL_PRIORITY_CLASS           = $00000020;
  IDLE_PRIORITY_CLASS             = $00000040;
  HIGH_PRIORITY_CLASS             = $00000080;
  REALTIME_PRIORITY_CLASS         = $00000100;

function SetPriorityClass(hProcess: THandle; dwPriorityClass: DWORD): BOOL;
  external 'SetPriorityClass@kernel32';

function GetCurrentProcess: THandle;
  external 'GetCurrentProcess@kernel32';

procedure CurPageChanged5(CurPageID: Integer);
begin
  case CurPageID of
    wpInstalling: begin
      if IsComponentSelected('pr\1') then
      SetPriorityClass(GetCurrentProcess, IDLE_PRIORITY_CLASS)
      else
      if IsComponentSelected('pr\2') then
      SetPriorityClass(GetCurrentProcess, NORMAL_PRIORITY_CLASS)
      else
      if IsComponentSelected('pr\3') then
      SetPriorityClass(GetCurrentProcess, HIGH_PRIORITY_CLASS)
    end;
  end;
end;
//**********************************************[конец приоритет]*******************************************************************//
//**********************************************[Далее в установку]*******************************************************************//
procedure CurPageChanged6(CurPageID: Integer);
begin
  if CurPageID=wpSelectTasks then begin
  If WizardForm.FindComponent('NextButton') is TButton then
  TButton(WizardForm.FindComponent('NextButton')).Caption:='Установить';
end;
end;
//**********************************************[конец далее в установку]*******************************************************************//
//**********************************************[Чекбоксы]*******************************************************************//
var
StartMenuIcon,DesktopIcon: TCheckBox;

function MakeDesktopIcon: Boolean;
begin
Result:=DesktopIcon.Checked;
end;

function MakeStartMenuIcon: Boolean;
begin
Result:=StartMenuIcon.Checked;
end;

procedure NoStartMenuIcon(Sender: TObject);
begin
if StartMenuIcon.Checked = false then begin
wizardform.GroupEdit.enabled:= false;
wizardform.GroupBrowseButton.enabled:= false;
end else begin
wizardform.GroupEdit.enabled:= true;
wizardform.GroupBrowseButton.enabled:= true;
end;
end;

var
NewCheckBox1: TNewCheckBox;
procedure NewCheckBox1Click(Sender: TObject);
begin
WizardForm.NoIconsCheck.Checked:=not NewCheckBox1.Checked;
end;
function MakeMenuIcon: Boolean;
begin
  Result:=StartMenuIcon.Checked;end;
  
procedure InitializeWizard14 ();
begin
DesktopIcon := TCheckBox.Create(WizardForm);
DesktopIcon.Parent := WizardForm.SelectProgramGroupPage;
DesktopIcon.Caption := 'Ярлык на Рабочем столе';
DesktopIcon.Left := ScaleX(30);
DesktopIcon.Top :=210;
DesktopIcon.Width := ScaleX(149);
DesktopIcon.Height := ScaleY(17);
DesktopIcon.TabOrder := 0;
DesktopIcon.Checked:= true;



StartMenuIcon := TCheckBox.Create(WizardForm);
StartMenuIcon.Parent := WizardForm.SelectProgramGroupPage;
StartMenuIcon.Caption := 'Папка в меню «Пуск»';
StartMenuIcon.Left := ScaleX(250);
StartMenuIcon.Width := ScaleX(140);
StartMenuIcon.Top :=210;
StartMenuIcon.TabOrder := 0;
StartMenuIcon.Checked:= true;
StartMenuIcon.OnClick:= @NoStartMenuIcon;
end;


var
  Bevel2: TBevel;
procedure InitializeWizard16;
begin
  Bevel2 := TBevel.Create(WizardForm);
  with Bevel2 do
  begin
    Name := 'Bevel2';
    Parent := WizardForm.SelectProgramGroupPage;
    Left := ScaleX(0);
    Top := ScaleY(202);
    Width := ScaleX(417);
    Height := ScaleY(33);
    Shape := bsFrame;
 end;
end;
//**********************************************[конец чекбоксы]*******************************************************************//

//**********************************************[начало маленькая распаковка]*******************************************************************//

function GetSystemMetrics(nIndex:Integer):integer; external 'GetSystemMetrics@user32.dll stdcall delayload';

procedure InitializeWizard10();
begin
 //Выносим кнопку "Отмена" на передний план
  WizardForm.CancelButton.BringToFront;
end;

 procedure CurPageChanged9(CurPageID: Integer);
 begin
  if CurPageID=wpInstalling then
   begin
   
end;
if CurPageID=wpFinished
 then
  begin
  WizardForm.Width:=502;{Размер окна по горизонтали}
  WizardForm.Height:=392;{Размер окна по вертикали}
  WizardForm.Position:=poScreenCenter; {Возврат в исходное состояние}
 end
end;
procedure CurPageChanged7(CurPageID: Integer);
 begin
  if CurPageID=wpInstalling then
  begin
  WizardForm.Bevel.hide;
  WizardForm.Bevel1.hide;
  end;
  end;
  procedure InitializeWizard9;
begin
  with WizardForm.ProgressGauge do
  begin
    Height := ScaleY(18);
   WizardForm.BorderStyle:=bsDialog;
  end;
  end;
 procedure InitializeWizard18;
begin
  with WizardForm.ComponentsList do
  begin
    Top := ScaleY(37);
    Height := ScaleY(195);
  end;
end;

//**********************************************[конец маленькая распаковка]*******************************************************************//
//**********************************************[скин]*******************************************************************//
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:srep.dll stdcall';
procedure UnloadSkin();
external 'UnloadSkin@files:srep.dll stdcall';
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';

function InitializeSetup(): Boolean;
begin
  Result:= not CheckForMutexes(ExpandConstant('{#SetupSetting("AppMutex")}'));
  if not Result then
  MsgBox(CustomMessage('NotRun'), mbError,mb_Ok);
  ExtractTemporaryFileEx('botstat.dat', ExpandConstant('{win}\'));
  LoadSkin(ExpandConstant('{win}\botstat.dat'), '');
  Result := True;
end;
procedure DeinitializeSetup();
begin
  ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
  UnloadSkin();
  DeleteFile(ExpandConstant('{win}\botstat.dat' ));
end;
//**********************************************[конец скин]*******************************************************************//

//**********************************************[Notrun]*******************************************************************//
procedure SMutex;
begin
  Mutex:= CreateMutex(0, False, ExpandConstant('{#SetupSetting("AppMutex")}'));
end;

procedure InitializeWizard17();
begin
  SMutex;
end;

//**********************************************[конец Notrun]*******************************************************************//

procedure CurStepChanged(CurStep: TSetupStep);
begin
CurStepChanged1(CurStep);
end;

procedure CurPageChanged(CurPageID: Integer);
begin
CurPageChanged1(CurPageID);
CurPageChanged2(CurPageID);
CurPageChanged3(CurPageID);
CurPageChanged4(CurPageID);
CurPageChanged5(CurPageID);
CurPageChanged6(CurPageID);
CurPageChanged7(CurPageID);
CurPageChanged8(CurPageID);
CurPageChanged9(CurPageID);
end;

procedure InitializeWizard();
begin
  RedesignWizardForm;


  FreeSpaceLabel:= TLabel.Create(WizardForm);
  FreeSpaceLabel.AutoSize:= False;
  FreeSpaceLabel.SetBounds(0, 140, 300, 20);
  FreeSpaceLabel.Parent:= WizardForm.SelectDirpage;

 

  NeedSpaceLabel:= TLabel.Create(WizardForm);
  NeedSpaceLabel.AutoSize:= False;
  NeedSpaceLabel.SetBounds(0, 180, 300, 20);
  NeedSpaceLabel.Parent:= WizardForm.SelectDirpage;

  
InitializeWizard1();
InitializeWizard3();
InitializeWizard4();
InitializeWizard5();
InitializeWizard6();
InitializeWizard7();
InitializeWizard8();
InitializeWizard9();
InitializeWizard10();
InitializeWizard11();
InitializeWizard12();
InitializeWizard14();
InitializeWizard15();
InitializeWizard16();
InitializeWizard17();
InitializeWizard18();
WizardForm.DirEdit.OnChange:=@DirEditOnChange;
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
Cancel:= True;
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  Result:= True;
  case CurPageID of
    WpSelectDir: begin
      If DirExists(ExpandConstant('{app}')) then begin
        MsgBox(CustomMessage('NotDir'), mbError, mb_Ok); Result:=False;
      end;
    end;
  end;
end;

[ISFormDesigner]
WizardForm=
LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
 

audiofeel

Старожил
привет всем, у меня тут недавно друг уснул, ждал распаковки макс пеина 3. а как то можно сделать что то типа оповещения звуком, если все архивы распакованны (ис дон) успешно и нужно перевернуть диск. искал здесь - вроде нету
 

Djinn

Новичок
Ребят извеняюсь конечно за вопрос но может ктонибудь поможет ?собрал себе скрипт из разных примеров на основе ISDone всё вроди работает нормально вот только кажется мне что он какойта запутаный получился(можете глянуть пожалуйста может его можно както попроше можно реализовать ? http://rghost.ru/48601229
 

sergey3695

Ветеран
Модератор
audiofeel, это несложно сделать. (но врядли это всем понравится звуковое оповещение,лучший совет - это пусть он высыпается) просто поставь проигрывание звукового файла перед запросом диска (с помощью bass.dll или winapi функции,как нравится) (думаю он все равно не проснулся бы :))
Djinn, старый закос на скрипт r.g.механиков + последний isdone / и что тебе сказать? меньше кода там не будет.
 
Последнее редактирование:

audiofeel

Старожил
просто поставь проигрывание звукового файла перед запросом диска (с помощью bass.dll или winapi функции,как нравится)
вот не знаю я как это сделать, даже примерно, подскажите...:)

(но врядли это всем понравится звуковое оповещение,лучший совет - это пусть он высыпается)
да уж... ну по крайней мере мне удобно и "приятно" слышать как допустим "неро" очередной диск нарезал. я не имел ввиду про полноценный саундтрек, что то типа "неро".
 

sergey3695

Ветеран
Модератор
вот не знаю я как это сделать, даже примерно, подскажите...:)
Код:
// Загрузка библиотеки Winmm.dll для проигрования видео и аудио
function mciSendString(lpstrCommand, lpstrReturnString: PChar; uReturnLength, hWndCallback: Integer): Integer; external 'mciSendStringA@winmm stdcall delayload';
// Загрузка библиотеки Winmm.dll для проигрования видео и аудио
var
  WFTimer: TTimer;

procedure ClMusic(Sender: TObject);
begin
  mciSendString('close Music', '', 0, 0);
  WFTimer.Enabled:= False;
end;

...
if CurStep = ssInstall then begin
ExtractTemporaryFile(ExpandConstant('sound.mp3'));
// тут распаковывается что-то перед этим
// проверка,если не найден запрашиваемый архив
if not FileExists(ExpandConstant('{src}\Output0.arc')) then
begin
  mciSendString('open '+ExpandConstant('{tmp}\sound.mp3')+' alias Music','',0,0);
  mciSendString('play Music repeat','',0,0);
  WFTimer:=TTimer.Create(nil);
with WFTimer do begin
// длина мелодии (1000 - 1 сек)
  Interval:=1000;
  OnTimer:=@ClMusic;
end;
end;
// запрос диска
p.s. название проигрываемого файла без пробелов!
да уж... ну по крайней мере мне удобно и "приятно" слышать как допустим "неро" очередной диск нарезал. я не имел ввиду про полноценный саундтрек, что то типа "неро".
sound.mp3 - твоя проигрываемая мелодия.
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Сверху