Имя пользователя:
Пароль:
 | Правила  

Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » Скрипты Inno Setup. Помощь и советы [часть 7]

Закрытая тема
Настройки темы
Скрипты Inno Setup. Помощь и советы [часть 7]

Аватара для El Sanchez

Ветеран


Contributor


Сообщения: 1274
Благодарности: 1030


Конфигурация

Профиль | Отправить PM | Цитировать


Изменения
Автор: El Sanchez
Дата: 16-02-2015
Внимание! Данная тема предназначена только для обсуждения написания скриптов !
Остальные вопросы, а также последние версии компилятора в теме
Inno Setup. Прочие вопросы.


Показать/скрыть: Справка, руководство, примеры:

Показать/скрыть: Ссылки на примеры скриптов:

Показать/скрыть: Дополнительные программы для Inno Setup:
  • ISTool - неплохой редактор скриптов Inno Setup.
    Последняя версия: 5.3.0.1 [29.09.2009] - Скачать | зеркало;

  • Inno Script Generator - генератор скриптов Inno Setup. Обладает некоторыми полезными функциями, которых нет ни у самого Inno Setup, ни у ISTool.
    Последняя версия: 1.0.3.1 [23.03.2008] - Скачать | зеркало на русифицированную программу;
    Примечание: Родной сайт www.hisoft2000.de более недоступен, поэтому здесь расположены сторонние ссылки.

  • Inno Setup Form Designer - редактор страниц Inno Setup, можно создавать свои страницы.
    Последняя версия: 2.0.8 [12.11.2006] - Скачать;
    Примечание: Родной сайт http://isfd.kaju74.de/index.php?isfd более недоступен, поэтому здесь расположены сторонние ссылки.

  • Inno Setup GameScript Generator - программа генерирует скрипты для Inno Setup . С помощью GameScript Generator и Inno Setup вы сможете быстро создать простенький инсталляционный пакет для любой игры. В инсталлятор можно встроить музыку, слайдшоу и фоновый рисунок. Для специалистов созданный скрипт, возможно, будет неплохой заготовкой для дальнейшей модернизации;

  • ISSkin - Программа для создания и добавления в инсталлятор скинов. Инструкция.
    Последняя версия: 3.0.0.0 [19.01.2010] - Скачать;

  • ISSJoiner - Программа для объединения нескольких скриптов InnoSetup в один.
    Последняя версия: 3.0 [23.07.2009]

  • Converter - Программа конвертирует reg-файлы в формат *.iss (формат скриптов Inno Setup).
    Последняя версия: 0.1.4 [13.03.2010] - Скачать;

  • RegExporter - Фриварная утилита для экспорта реестра и конвертации файлов *.reg и *.ini в инсталляционные скрипты Inno Setup и NSIS.
    Последняя версия: 1.2.0 [23.09.2014] - Скачать;



Предыдущие ветки обсуждения по ссылкам ниже и в прикреплённых архивах:

Скрипты Inno Setup. Помощь и советы [часть 6]

Отправлено: 11:48, 10-03-2014

 

Аватара для Dodakaedr

Ветеран


Сообщения: 863
Благодарности: 262

Профиль | Отправить PM | Цитировать


Цитата sergey3695:
хочешь сказать что так не удалит »
Да, не удаляет...

Цитата sergey3695:
если {app} путь включая папку установки и там лежат файлы. »
Код: Выделить весь код
Source: "InstallFiles\ISTaskU.dll"; DestDir: {app}; Flags: ignoreversion
Цитата sergey3695:
поверял то хоть? »
А чего я бы спрашивал, если б не проверял....

-------
Inno Setup 5 Ultra Unicode


Отправлено: 23:16, 27-05-2014 | #821



Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети.

Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля.


Аватара для habib2302

Ветеран


Сообщения: 862
Благодарности: 102

Профиль | Отправить PM | Цитировать


sergey3695,

-------
Помог? От "Полезное сообщение" не откажусь!!!


Отправлено: 23:18, 27-05-2014 | #822


Новый участник


Сообщения: 43
Благодарности: 3

Профиль | Отправить PM | Цитировать


Dodakaedr, Этот лишний мусор не выйдет удалить сразу вместе с программой,по крайне мере когда я интересовался этим вопросом мне ответили так.Так что проще будет как я написал до этого.

Отправлено: 23:59, 27-05-2014 | #823


Пользователь


Сообщения: 148
Благодарности: 49

Профиль | Отправить PM | Цитировать


Dodakaedr, был бы скрипт с файлами, я б посмотрел. А то так гадать.
Так по-любому все удалится в папке, чтобы там не было.
Код: Выделить весь код
// Удаление каталога с содержимым
procedure DelDir(dir : string);
var
  r: Integer;
begin
  Exec('cmd.exe', ' /c rd /S /Q  ' + '"'+dir+'"',ExpandConstant('{sys}'), SW_Hide,ewWaitUntilTerminated,r);
end;
//
if CurUninstallStep=usPostUninstall then  
if DirExists(ExpandConstant('{app}')) then
  DelDir(ExpandConstant('{app}'));
end;
habib2302, а остальной код? я думал ты функцией не умеешь пользоваться.
читать дальше »
Код: Выделить весь код
#define NeedSize "5000000000"

#define NeedMem 512

#define SecondPB

#ifdef SecondPB
  #define PbLblCount 1
#else
  #define PbLblCount 0
#endif

;#define Components

;#define records

;#define facompress

;#define PrecompInside
;#define SrepInside
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
;#define PackZIP

[Setup]
AppName=ISDone
AppVerName=ISDone
DefaultDirName={pf}\ISDone
DefaultGroupName=ISDone Example
OutputDir=.
OutputBaseFilename=Setup
VersionInfoCopyright=ProFrager
SolidCompression=yes
#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

[Registry]
Root: HKLM; Subkey: Software\ProFrager; ValueName: path; ValueType: String; ValueData: {app}; Flags: uninsdeletekey; Check: CheckError
Root: HKLM; Subkey: Software\ProFrager; ValueName: name; ValueType: String; ValueData: Data; Flags: uninsdeletekey; Check: CheckError

[Icons]
Name: {group}\Удалить пример ISDone; Filename: {app}\unins000.exe; WorkingDir: {app}; Check: CheckError
Name: {commondesktop}\Удалить пример ISDone; Filename: {app}\unins000.exe; WorkingDir: {app}; Check: CheckError

[Tasks]
Name: VCCheck; Description: Установить Microsoft Visual C++ 2005 Redist
Name: PhysXCheck; Description: Установить Nvidia PhysX

[Run]
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; StatusMsg: Устанавливаем Microsoft Visual C++ 2005 Redist...; Flags: skipifdoesntexist; Tasks: VCCheck; Check: CheckError
Filename: {src}\Redist\PhysX.exe; Parameters: /qn; StatusMsg: Устанавливаем Nvidia PhysX...; Flags: skipifdoesntexist; Tasks: PhysXCheck; Check: CheckError

[Files]
Source: Include\English.ini; DestDir: {tmp}; Flags: dontcopy
Source: Include\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy

#ifdef records
  Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef PrecompInside
  Source: Include\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
  Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
  Source: Include\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
  Source: Include\precomp.exe; DestDir: {tmp}; Flags: dontcopy
  Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef SrepInside
  Source: Include\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef MSCInside
  Source: Include\CLS-MSC.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef facompress
  Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef precomp
  #if precomp == "0.38"
    Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
  #else
    #if precomp == "0.4"
      Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
    #else
      #if precomp == "0.41"
        Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
      #else
        #if precomp == "0.42"
          Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
        #else
          Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
          Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
          Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
          Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
        #endif
      #endif
    #endif
  #endif
#endif

#ifdef unrar
  Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef XDelta
  Source: Include\XDelta3.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef PackZIP
  Source: Include\7z.dll; DestDir: {tmp}; Flags: dontcopy
  Source: Include\packZIP.exe; DestDir: {tmp}; Flags: dontcopy
#endif

[CustomMessages]
russian.ExtractedFile=Извлекается файл:
russian.Extracted=Распаковка архивов...
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:
russian.AllElapsedTime=Время установки:

[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

[UninstallDelete]
Type: filesandordirs; Name: {app}

[ Code]
const
  PCFonFLY    = true;
  notPCFonFLY = false;
  PbLblCount  = {#PbLblCount};
var
  LblTime      :   array [0..2]             of TLabel;
  LblPct       :   array [0..{#PbLblCount}] of TLabel;
  ISDonePB     :   array [0..{#PbLblCount}] of TNewProgressBar;
  ISDoneCancel :   integer;
  ISDoneError  :   boolean;
  ISDoneStopUP :   boolean;
  PCFVer       :   double;

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

function WrapCallback(callback:TCallback; paramcount:integer):longword;
  external 'wrapcallback@files:ISDone.dll stdcall delayload';

function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean;
  external 'ISArcExtract@files:ISDone.dll stdcall delayload';
function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean;
  external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean;
  external 'ISRarExtract@files:ISDone.dll stdcall delayload';
function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean;
  external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean;
  external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean;
  external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean;
  external 'ISPackZIP@files:ISDone.dll stdcall delayload';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean;
  external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';

function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean;
  external 'Exec2@files:ISDone.dll stdcall delayload';
function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer;
  external 'ISFindFiles@files:ISDone.dll stdcall delayload';
function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean;
  external 'ISPickFilename@files:ISDone.dll stdcall delayload';
function ISGetName(TypeStr:integer):PAnsichar;
  external 'ISGetName@files:ISDone.dll stdcall delayload';
function ISFindFree(FindHandle:integer):boolean;
  external 'ISFindFree@files:ISDone.dll stdcall delayload';
function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean;
  external 'ISExec@files:ISDone.dll stdcall delayload';

function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean;
  external 'SrepInit@files:ISDone.dll stdcall delayload';
function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean;
  external 'PrecompInit@files:ISDone.dll stdcall delayload';
function FileSearchInit(RecursiveSubDir:boolean):boolean;
  external 'FileSearchInit@files:ISDone.dll stdcall delayload';
function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean;
  external 'ISDoneInit@files:ISDone.dll stdcall';
function ISDoneStop:boolean;
  external 'ISDoneStop@files:ISDone.dll stdcall';
function ChangeLanguage(Language:AnsiString):boolean;
  external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
function SuspendProc:boolean;
  external 'SuspendProc@files:ISDone.dll stdcall';
function ResumeProc:boolean;
  external 'ResumeProc@files:ISDone.dll stdcall';

function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
    if OveralPct<=1000  then ISDonePB[0].Position := OveralPct;
    LblPct[0].Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
  #ifdef SecondPB
    if CurrentPct<=1000 then ISDonePB[1].Position := CurrentPct;
    LblPct[1].Caption := IntToStr(CurrentPct div 10)+'.'+chr(48 + CurrentPct mod 10)+'%';
  #endif
  WizardForm.FileNamelabel.Caption:=ExpandConstant('{cm:ExtractedFile} ')+MinimizePathName(CurrentFile, WizardForm.FileNamelabel.Font, WizardForm.FileNamelabel.Width-ScaleX(100));
  LblTime[0].Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
  LblTime[1].Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  LblTime[2].Caption:=ExpandConstant('{cm:AllElapsedTime}')+TimeStr3;
  Result := ISDoneCancel;
end;

procedure WizardFormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  case ISDoneStopUP of
    True:
    begin
      SuspendProc;
      if ExitSetupMsgBox then ISDoneCancel:=1;
      ResumeProc;
    end;
    False : CanClose := True;
  end;
end;

function InitializeSetup(): Boolean;
begin
  ISDoneStopUP := False;
  Result := True;
end;

procedure HideControls;
var
  i :integer;
begin
    for i := 0 to PbLblCount do
    begin
      ISDonePB[i].Hide;
      LblPct[i].Hide;
    end;
  for i := 0 to 1 do LblTime[i].Hide;
end;

procedure CreateControls;
var
  i :integer;
begin
  WizardForm.FileNamelabel.SetBounds(ScaleX(0), ScaleY(30), ScaleX(395), ScaleY(14));
  for i := 0 to PbLblCount do
  begin
    ISDonePB[i] := TNewProgressBar.Create(WizardForm);
    with ISDonePB[i] do
    begin
      Parent   := WizardForm.InstallingPage;
      SetBounds(ScaleX(0), ScaleY(50+i*57), ScaleX(365), ScaleY(21));
      Max      := 1000;
    end;

    LblPct[i] := TLabel.Create(WizardForm);
    with LblPct[i] do
    begin
      Parent    := WizardForm.InstallingPage;
      AutoSize  := False;
      SetBounds(ScaleX(370), ScaleY(52+i*57), ScaleX(80), ScaleY(14));
    end;
  end;

  for i := 0 to 2 do
  begin
    LblTime[i] := TLabel.Create(WizardForm);
    with LblTime[i] do
    begin
      AutoSize := False;
      Alignment := taCenter;
        case i of
        0, 1 :
        begin
          Parent := WizardForm.InstallingPage;
          SetBounds(ScaleX(0), ScaleY(75+i*17), ScaleX(395), ScaleY(14));
        end;
        2 :
        begin
          Parent := WizardForm.FinishedPage;
          SetBounds(ScaleX(180), ScaleY(200), ScaleX(300), ScaleY(14));
        end;
      end;
    end;
  end;
  WizardForm.OnCloseQuery := @WizardFormCloseQuery;
  WizardForm.CancelButton.Enabled := True;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and ISDoneError then
  begin
    LblTime[2].Hide;
    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 CurStepChanged(CurStep: TSetupStep);
var
  Comps1, Comps2, Comps3, TmpValue       : cardinal;
  FindHandle1, ColFiles1, CurIndex1, tmp : integer;
  ExecError                              : boolean;
  InFilePath, OutFilePath, OutFileName   : PAnsiChar;
begin
  if CurStep = ssPostInstall then //Если необходимо, можно поменять на ssInstall
  begin  
    WizardForm.ProgressGauge.Hide;
    CreateControls;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    ISDoneCancel:=0;

  // Распаковка всех необходимых файлов в папку {tmp}.

    ExtractTemporaryFile('unarc.dll');

    #ifdef PrecompInside
      ExtractTemporaryFile('CLS-precomp.dll');
      ExtractTemporaryFile('packjpg_dll.dll');
      ExtractTemporaryFile('packjpg_dll1.dll');
      ExtractTemporaryFile('precomp.exe');
      ExtractTemporaryFile('zlib1.dll');
    #endif

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

    #ifdef MSCInside
      ExtractTemporaryFile('CLS-MSC.dll');
    #endif

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

    #ifdef precomp
      #if precomp == "0.38"
        ExtractTemporaryFile('precomp038.exe');
      #else
        #if precomp == "0.4"
          ExtractTemporaryFile('precomp040.exe');
        #else
          #if precomp == "0.41"
            ExtractTemporaryFile('precomp041.exe');
          #else
            #if precomp == "0.42"
              ExtractTemporaryFile('precomp042.exe');
            #else
              ExtractTemporaryFile('precomp038.exe');
              ExtractTemporaryFile('precomp040.exe');
              ExtractTemporaryFile('precomp041.exe');
              ExtractTemporaryFile('precomp042.exe');
            #endif
          #endif
        #endif
      #endif
    #endif

    #ifdef unrar
      ExtractTemporaryFile('Unrar.dll');
    #endif

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

    #ifdef PackZIP
      ExtractTemporaryFile('7z.dll');
      ExtractTemporaryFile('PackZIP.exe');
    #endif

    ExtractTemporaryFile('English.ini');

// Подготавливаем переменную, содержащую всю информацию о выделенных компонентах для ISDone.dll
// максимум 96 компонентов.
  Comps1:=0; Comps2:=0; Comps3:=0;
  #ifdef Components
    TmpValue:=1;
    if IsComponentSelected('text\rus') then Comps1 := Comps1+TmpValue;     //компонент 1
    TmpValue:=TmpValue*2;
    if IsComponentSelected('text\eng') then Comps1 := Comps1+TmpValue;     //компонент 2
    TmpValue:=TmpValue*2;
    if IsComponentSelected('voice\rus') then Comps1 := Comps1+TmpValue;    //компонент 3
    TmpValue:=TmpValue*2;
    if IsComponentSelected('voice\eng') then Comps1 := Comps1+TmpValue;    //компонент 4
//    .....
// см. справку
  #endif

  #ifdef precomp
    PCFVer:={#precomp};
  #else
    PCFVer:=0;
  #endif
    ISDoneError:=true;
    if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1, Comps2, Comps3, MainForm.Handle, {#NeedMem}, @ProgressCallback) then
    begin
      repeat
//        ChangeLanguage('English');
        if not SrepInit('',512,0) then break;
        if not PrecompInit('',128,PCFVer) then break;
        if not FileSearchInit(true) then break;

        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\GameWAV.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\test1.arc'), ExpandConstant('{app}'), '', false, '123', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;

//    далее находятся закомментированые примеры различных функций распаковки (чтобы каждый раз не лазить в справку за примерами)
(*
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\arc.arc'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        if not IS7ZipExtract   ( 0, 0, ExpandConstant('{src}\CODMW2.7z'), ExpandConstant('{app}\data1'), false, '') then break;
        if not ISRarExtract    ( 0, 0, ExpandConstant('{src}\data_*.rar'), ExpandConstant('{app}'), false, '') then break;
        if not ISSRepExtract   ( 0, 0, ExpandConstant('{app}\data1024_1024.srep'),ExpandConstant('{app}\data1024.arc'), true) then break;
        if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data.pcf'),    ExpandConstant('{app}\data.7z'), true) then break;
        if not ISxDeltaExtract ( 0, 0, 0, 640, ExpandConstant('{app}\in.pcf'), ExpandConstant('{app}\*.diff'),   ExpandConstant('{app}\out.dat'), false, false) then break;
        if not ISPackZIP       ( 0, 0, ExpandConstant('{app}\1a1\*'), ExpandConstant('{app}\1a1.pak'), 2, false ) then break;
        if not ISExec          ( 0, 0, 0, ExpandConstant('{tmp}\Arc.exe'), ExpandConstant('x -o+ "{src}\001.arc" "{app}\"'), ExpandConstant('{tmp}'), '...',false) then break;
        if not ShowChangeDiskWindow ('Пожалуйста, вставьте второй диск и дождитесь его инициализации.', ExpandConstant('{src}'),'CODMW_2.arc') then break;

//    распаковка группы файлов посредством внешнего приложения

        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;
*)
        ISDoneError:=false;
      until true;
      ISDoneStop;
    end;
    HideControls;
  end;
  if {(CurStep=ssPostInstall) and} ISDoneError then
  begin
    Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
  end;
end;

Это пример использования IsDone.dll (файлы не нужны же). Функция описана выше в сообщениях.
Это сообщение посчитали полезным следующие участники:

Отправлено: 08:03, 28-05-2014 | #824


Аватара для Dodakaedr

Ветеран


Сообщения: 863
Благодарности: 262

Профиль | Отправить PM | Цитировать


Цитата sergey3695:
Так по-любому все удалится в папке, чтобы там не было. »
Сработало! А такой код на удаления файла(ов) можно сделать? И можно ли как-то скрыть Msg в конце удаления в котором пишется что часть элементов не удалось удалить, вы можете их удалить самостоятельно, но при этом чтобы деинсталятор спрашивал об уверенности пользователя удалить программу. Потому что получается что деинсталятор врет пользователю, так как уже удаляется все.

-------
Inno Setup 5 Ultra Unicode


Последний раз редактировалось Dodakaedr, 28-05-2014 в 09:35.


Отправлено: 09:28, 28-05-2014 | #825


Пользователь


Сообщения: 148
Благодарности: 49

Профиль | Отправить PM | Цитировать


Dodakaedr, кинь лучше скрипт с файлами в лс. Я гляну че-как и сделаю. А то я половину не понял что ты написал.
Если я правильно понял, то есть такой код. (После деинсталяции удалить оставшиеся файлы)
читать дальше »
Код: Выделить весь код
[Setup]
AppName=My Program
AppVerName=My Program v.1.2
DefaultDirName={pf}\My Program

[Files]
//Source: Files\*; DestDir:  {app}

[Code ]
const
bidDelAll = 1;
bidSkipAll = 2;
var
Form: TSetupForm;
CheckListBox: TNewCheckListBox;
AllButton, UnAllButton: TButton;
CancelButton, DelButton: TButton;

MsgForm: TSetupForm;
MsgAllButton, MsgSkipAllButton: TButton;
MsgCancelButton, MsgDelButton: TButton;

DelAllReadOnly: Boolean;
SkipAllReadOnly: Boolean;

function Size64(Hi, Lo: integer): Extended;
var
i: integer;
begin
Result:= Lo;
if Lo < 0 then
Result:= Result + 2147483647 + 2147483647 + 2;
i:= Hi;
while i > 0 do
begin
Result:= Result + 2147483647 + 2147483647 + 2;
i:= i - 1;
end;
end;

procedure FillListBox(const fromDir, fileMask: string; Level: Byte);
var
FSR, DSR: TFindRec;
FindResult: Boolean;
APath: string;
i: integer;
begin
APath := AddBackslash(fromDir);
FindResult := FindFirst(APath + fileMask, FSR);
try
while FindResult do
begin
if FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then
begin
{files} i:= CheckListBox.AddCheckBox(FSR.Name,
FloatToStr(Size64(FSR.SizeHigh, FSR.SizeLow)) + '  byte',
Level, True, True, False, True, TStringList.Create);
TStrings(CheckListBox.ItemObject[i]).Text:= APath + FSR.Name;
end;
FindResult := FindNext(FSR);
end;
FindResult := FindFirst(APath + '*.*', DSR);
while FindResult do
begin
if ((DSR.Attributes and FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY) and
not ((DSR.Name = '.') or (DSR.Name = '..')) then
begin
{dir} i:= CheckListBox.AddCheckBox(DSR.Name,'DIR', Level,
True, True, False, True, TStringList.Create);
TStrings(CheckListBox.ItemObject[i]).Text:= APath + DSR.Name;
{Recursion} FillListBox(APath + DSR.Name, fileMask, Level+1);
end;
FindResult := FindNext(DSR);
end;
finally
FindClose(FSR);
FindClose(DSR);
end;
end;

procedure ButtonOnClick(Sender: TObject);
begin
CheckListBox.Checked[0]:= TButton(Sender).Tag = 0;
end;

procedure MsgButtonOnClick(Sender: TObject);
begin
Case TButton(Sender).Tag of
bidDelAll : DelAllReadOnly:= True;
bidSkipAll: SkipAllReadOnly:= True;
end;
MsgForm.Close;
end;

function DelMsgBox(FileName: string): Boolean;
var
MsgLabel: TLabel;
begin
MsgForm:= CreateCustomForm;
MsgForm.ClientWidth := ScaleX(400);
MsgForm.ClientHeight := ScaleY(120);
MsgForm.Caption := 'Удаляемые  файлы';
MsgForm.Center;

MsgLabel := TLabel.Create(MsgForm);
MsgLabel.Left := ScaleX(20);
MsgLabel.Top := ScaleY(20);
MsgLabel.Caption:= FileName + ' является  защищенным файлом или папкой !' + #10#10#13 +
'Вы  хотите удалить файлы с атрибутами только для чтения  ?';
MsgLabel.Parent := MsgForm;

MsgAllButton := TButton.Create(MsgForm);
MsgAllButton.Parent := MsgForm;
MsgAllButton.Width := ScaleX(85);
MsgAllButton.Height := ScaleY(23);
MsgAllButton.Left := ScaleX(20);
MsgAllButton.Top := MsgForm.ClientHeight - ScaleY(23 + 10);
MsgAllButton.Caption := 'Удалить  все';
MsgAllButton.Tag:= bidDelAll;
MsgAllButton.OnClick := @MsgButtonOnClick;

MsgSkipAllButton := TButton.Create(MsgForm);
MsgSkipAllButton.Parent := MsgForm;
MsgSkipAllButton.Width := ScaleX(85);
MsgSkipAllButton.Height := ScaleY(23);
MsgSkipAllButton.Left := MsgAllButton.Left + MsgAllButton.Width + ScaleX(10);
MsgSkipAllButton.Top := MsgForm.ClientHeight - ScaleY(23 + 10);
MsgSkipAllButton.Caption := 'Пропустить  все';
MsgSkipAllButton.Tag:= bidSkipAll;
MsgSkipAllButton.OnClick := @MsgButtonOnClick;

MsgCancelButton := TButton.Create(MsgForm);
MsgCancelButton.Parent := MsgForm;
MsgCancelButton.Width := ScaleX(75);
MsgCancelButton.Height := ScaleY(23);
MsgCancelButton.Left := MsgForm.ClientWidth - MsgCancelButton.Width - ScaleX(20);
MsgCancelButton.Top := MsgForm.ClientHeight - ScaleY(23 + 10);
MsgCancelButton.Caption := 'Пропустить';
MsgCancelButton.ModalResult := mrCancel;

MsgDelButton := TButton.Create(MsgForm);
MsgDelButton.Parent := MsgForm;
MsgDelButton.Width := ScaleX(75);
MsgDelButton.Height := ScaleY(23);
MsgDelButton.Left := MsgCancelButton.Left - MsgDelButton.Width - ScaleX(10);
MsgDelButton.Top := MsgForm.ClientHeight - ScaleY(23 + 10);
MsgDelButton.Caption := 'Удалить';
MsgDelButton.ModalResult := mrOk;

MsgForm.ActiveControl:= MsgCancelButton;

if MsgForm.ShowModal() = mrOk then
Result:= True
else
Result:= False;
end;

procedure DeleteFiles();
var
SR: TFindRec;
i: integer;
str: string;
ResultCode: Integer;
begin
DelAllReadOnly:= False;
SkipAllReadOnly:= False;
for i:= CheckListBox.Items.Count - 1 downto 0 do
begin
if CheckListBox.State[i] = cbChecked then
begin
str:= Trim(TStrings(CheckListBox.ItemObject[i]).Text);
FindFirst(str, SR);
if ((SR.Attributes and FILE_ATTRIBUTE_READONLY) = FILE_ATTRIBUTE_READONLY) then
if Not (DelAllReadOnly or SkipAllReadOnly) then
if DelMsgBox(SR.Name) then
Exec('attrib', ' -h -s -r  ' + '"' + str + '"',
'', SW_HIDE, ewWaitUntilTerminated, ResultCode);
if DelAllReadOnly then
Exec('attrib', ' -h -s -r  ' + '"' + str + '"',
'', SW_HIDE, ewWaitUntilTerminated, ResultCode);

FindClose(SR);
DeleteFile(str);
RemoveDir(str);
end;
end;
end;

procedure BrowseRemainedFiles();
begin
Form:= CreateCustomForm;
Form.ClientWidth := ScaleX(400);
Form.ClientHeight := ScaleY(400);
Form.Caption := 'Удаляемые  файлы';
Form.Center;

CheckListBox := TNewCheckListBox.Create(Form);
CheckListBox.Left:= ScaleX(20);
CheckListBox.Top:= ScaleY(20);
CheckListBox.Width:= Form.ClientWidth - ScaleX(20*2);
CheckListBox.Height:= Form.ClientHeight - ScaleY(23*2 + 20);
CheckListBox.Parent:= Form;

AllButton := TButton.Create(Form);
AllButton.Parent := Form;
AllButton.Width := ScaleX(85);
AllButton.Height := ScaleY(23);
AllButton.Left := ScaleX(20);
AllButton.Top := Form.ClientHeight - ScaleY(23 + 10);
AllButton.Caption := 'Выбрать  все';
AllButton.Tag:= 0;
AllButton.OnClick := @ButtonOnClick;

UnAllButton := TButton.Create(Form);
UnAllButton.Parent := Form;
UnAllButton.Width := ScaleX(85);
UnAllButton.Height := ScaleY(23);
UnAllButton.Left := AllButton.Left + AllButton.Width + ScaleX(10);
UnAllButton.Top := Form.ClientHeight - ScaleY(23 + 10);
UnAllButton.Caption := 'Отменить  все';
UnAllButton.Tag:= 1;
UnAllButton.OnClick := @ButtonOnClick;

CancelButton := TButton.Create(Form);
CancelButton.Parent := Form;
CancelButton.Width := ScaleX(75);
CancelButton.Height := ScaleY(23);
CancelButton.Left := Form.ClientWidth - CancelButton.Width - ScaleX(20);
CancelButton.Top := Form.ClientHeight - ScaleY(23 + 10);
CancelButton.Caption := 'Отменить';
CancelButton.ModalResult := mrCancel;
CancelButton.Cancel := True;

DelButton := TButton.Create(Form);
DelButton.Parent := Form;
DelButton.Width := ScaleX(75);
DelButton.Height := ScaleY(23);
DelButton.Left := CancelButton.Left - DelButton.Width - ScaleX(10);
DelButton.Top := Form.ClientHeight - ScaleY(23 + 10);
DelButton.Caption := 'Удалить';
DelButton.ModalResult := mrOk;

Form.ActiveControl:= CancelButton;

CheckListBox.AddCheckBox(ExpandConstant('{app}'), '', 0, True, True, False, True, TStringList.Create);
TStrings(CheckListBox.ItemObject[0]).Text:= ExpandConstant('{app}');
FillListBox(ExpandConstant('{app}'), '*', 1);

if Form.ShowModal() = mrOk then DeleteFiles();
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if DirExists(ExpandConstant('{app}')) and (CurUninstallStep = usPostUninstall) then
BrowseRemainedFiles();
end;

Последний раз редактировалось sergey3695, 28-05-2014 в 11:47.


Отправлено: 10:52, 28-05-2014 | #826


Аватара для habib2302

Ветеран


Сообщения: 862
Благодарности: 102

Профиль | Отправить PM | Цитировать


sergey3695, очередная ошибка

читать дальше »
Код: Выделить весь код
#define NeedSize "5000000000"

#define NeedMem 512

#define SecondPB

#ifdef SecondPB
  #define PbLblCount 1
#else
  #define PbLblCount 0
#endif

;#define Components

;#define records

;#define facompress

;#define PrecompInside
;#define SrepInside
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
;#define PackZIP

[Setup]
AppName=ISDone
AppVerName=ISDone
DefaultDirName={pf}\ISDone
DefaultGroupName=ISDone Example
OutputDir=.
OutputBaseFilename=Setup
VersionInfoCopyright=ProFrager
SolidCompression=yes
#ifdef NeedSize
  ExtraDiskSpaceRequired={#NeedSize}
#endif

[Files]
Source: Include\English.ini; DestDir: {tmp}; Flags: dontcopy
Source: Include\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy

#ifdef records
  Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef PrecompInside
  Source: Include\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
  Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
  Source: Include\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
  Source: Include\precomp.exe; DestDir: {tmp}; Flags: dontcopy
  Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef SrepInside
  Source: Include\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef MSCInside
  Source: Include\CLS-MSC.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef facompress
  Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef precomp
  #if precomp == "0.38"
    Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
  #else
    #if precomp == "0.4"
      Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
    #else
      #if precomp == "0.41"
        Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
      #else
        #if precomp == "0.42"
          Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
        #else
          Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
          Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
          Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
          Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
        #endif
      #endif
    #endif
  #endif
#endif

#ifdef unrar
  Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef XDelta
  Source: Include\XDelta3.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef PackZIP
  Source: Include\7z.dll; DestDir: {tmp}; Flags: dontcopy
  Source: Include\packZIP.exe; DestDir: {tmp}; Flags: dontcopy
#endif

[CustomMessages]
russian.ExtractedFile=Извлекается файл:
russian.Extracted=Распаковка архивов...
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:
russian.AllElapsedTime=Время установки:

[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

[UninstallDelete]
Type: filesandordirs; Name: {app}

[ Code]
const
  PCFonFLY    = true;
  notPCFonFLY = false;
  PbLblCount  = {#PbLblCount};
var
  LblTime      :   array [0..2]             of TLabel;
  LblPct       :   array [0..{#PbLblCount}] of TLabel;
  ISDonePB     :   array [0..{#PbLblCount}] of TNewProgressBar;
  ISDoneCancel :   integer;
  ISDoneError  :   boolean;
  ISDoneStopUP :   boolean;
  PCFVer       :   double;

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

function WrapCallback(callback:TCallback; paramcount:integer):longword;
  external 'wrapcallback@files:ISDone.dll stdcall delayload';

function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean;
  external 'ISArcExtract@files:ISDone.dll stdcall delayload';
function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean;
  external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean;
  external 'ISRarExtract@files:ISDone.dll stdcall delayload';
function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean;
  external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean;
  external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean;
  external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean;
  external 'ISPackZIP@files:ISDone.dll stdcall delayload';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean;
  external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';

function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean;
  external 'Exec2@files:ISDone.dll stdcall delayload';
function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer;
  external 'ISFindFiles@files:ISDone.dll stdcall delayload';
function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean;
  external 'ISPickFilename@files:ISDone.dll stdcall delayload';
function ISGetName(TypeStr:integer):PAnsichar;
  external 'ISGetName@files:ISDone.dll stdcall delayload';
function ISFindFree(FindHandle:integer):boolean;
  external 'ISFindFree@files:ISDone.dll stdcall delayload';
function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean;
  external 'ISExec@files:ISDone.dll stdcall delayload';

function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean;
  external 'SrepInit@files:ISDone.dll stdcall delayload';
function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean;
  external 'PrecompInit@files:ISDone.dll stdcall delayload';
function FileSearchInit(RecursiveSubDir:boolean):boolean;
  external 'FileSearchInit@files:ISDone.dll stdcall delayload';
function ISDoneInit(RecordFileName:AnsiString; TimeType:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean;
  external 'ISDoneInit@files:ISDone.dll stdcall';
function ISDoneStop:boolean;
  external 'ISDoneStop@files:ISDone.dll stdcall';
function ChangeLanguage(Language:AnsiString):boolean;
  external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
function SuspendProc:boolean;
  external 'SuspendProc@files:ISDone.dll stdcall';
function ResumeProc:boolean;
  external 'ResumeProc@files:ISDone.dll stdcall';

function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
    if OveralPct<=1000  then ISDonePB[0].Position := OveralPct;
    LblPct[0].Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
  #ifdef SecondPB
    if CurrentPct<=1000 then ISDonePB[1].Position := CurrentPct;
    LblPct[1].Caption := IntToStr(CurrentPct div 10)+'.'+chr(48 + CurrentPct mod 10)+'%';
  #endif
  WizardForm.FileNamelabel.Caption:=ExpandConstant('{cm:ExtractedFile} ')+MinimizePathName(CurrentFile, WizardForm.FileNamelabel.Font, WizardForm.FileNamelabel.Width-ScaleX(100));
  LblTime[0].Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
  LblTime[1].Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  LblTime[2].Caption:=ExpandConstant('{cm:AllElapsedTime}')+TimeStr3;
  Result := ISDoneCancel;
end;

procedure WizardFormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  case ISDoneStopUP of
    True:
    begin
      SuspendProc;
      if ExitSetupMsgBox then ISDoneCancel:=1;
      ResumeProc;
    end;
    False : CanClose := True;
  end;
end;

function InitializeSetup(): Boolean;
begin
  ISDoneStopUP := False;
  Result := True;
end;

procedure HideControls;
var
  i :integer;
begin
    for i := 0 to PbLblCount do
    begin
      ISDonePB[i].Hide;
      LblPct[i].Hide;
    end;
  for i := 0 to 1 do LblTime[i].Hide;
end;

procedure CreateControls;
var
  i :integer;
begin
  WizardForm.FileNamelabel.SetBounds(ScaleX(0), ScaleY(30), ScaleX(395), ScaleY(14));
  for i := 0 to PbLblCount do
  begin
    ISDonePB[i] := TNewProgressBar.Create(WizardForm);
    with ISDonePB[i] do
    begin
      Parent   := WizardForm.InstallingPage;
      SetBounds(ScaleX(0), ScaleY(50+i*57), ScaleX(365), ScaleY(21));
      Max      := 1000;
    end;

    LblPct[i] := TLabel.Create(WizardForm);
    with LblPct[i] do
    begin
      Parent    := WizardForm.InstallingPage;
      AutoSize  := False;
      SetBounds(ScaleX(370), ScaleY(52+i*57), ScaleX(80), ScaleY(14));
    end;
  end;

  for i := 0 to 2 do
  begin
    LblTime[i] := TLabel.Create(WizardForm);
    with LblTime[i] do
    begin
      AutoSize := False;
      Alignment := taCenter;
        case i of
        0, 1 :
        begin
          Parent := WizardForm.InstallingPage;
          SetBounds(ScaleX(0), ScaleY(75+i*17), ScaleX(395), ScaleY(14));
        end;
        2 :
        begin
          Parent := WizardForm.FinishedPage;
          SetBounds(ScaleX(180), ScaleY(200), ScaleX(300), ScaleY(14));
        end;
      end;
    end;
  end;
  WizardForm.OnCloseQuery := @WizardFormCloseQuery;
  WizardForm.CancelButton.Enabled := True;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and ISDoneError then
  begin
    LblTime[2].Hide;
    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 CurStepChanged(CurStep: TSetupStep);
var
  TmpValue       : cardinal;
  FindHandle1, ColFiles1, CurIndex1, tmp : integer;
  ExecError                              : boolean;
  InFilePath, OutFilePath, OutFileName   : PAnsiChar;
begin
  if CurStep = ssPostInstall then //Если необходимо, можно поменять на ssInstall
  begin
    WizardForm.ProgressGauge.Hide;
    CreateControls;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    ISDoneCancel:=0;

  // Распаковка всех необходимых файлов в папку {tmp}.

    ExtractTemporaryFile('unarc.dll');

    #ifdef PrecompInside
      ExtractTemporaryFile('CLS-precomp.dll');
      ExtractTemporaryFile('packjpg_dll.dll');
      ExtractTemporaryFile('packjpg_dll1.dll');
      ExtractTemporaryFile('precomp.exe');
      ExtractTemporaryFile('zlib1.dll');
    #endif

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

    #ifdef MSCInside
      ExtractTemporaryFile('CLS-MSC.dll');
    #endif

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

    #ifdef precomp
      #if precomp == "0.38"
        ExtractTemporaryFile('precomp038.exe');
      #else
        #if precomp == "0.4"
          ExtractTemporaryFile('precomp040.exe');
        #else
          #if precomp == "0.41"
            ExtractTemporaryFile('precomp041.exe');
          #else
            #if precomp == "0.42"
              ExtractTemporaryFile('precomp042.exe');
            #else
              ExtractTemporaryFile('precomp038.exe');
              ExtractTemporaryFile('precomp040.exe');
              ExtractTemporaryFile('precomp041.exe');
              ExtractTemporaryFile('precomp042.exe');
            #endif
          #endif
        #endif
      #endif
    #endif

    #ifdef unrar
      ExtractTemporaryFile('Unrar.dll');
    #endif

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

    #ifdef PackZIP
      ExtractTemporaryFile('7z.dll');
      ExtractTemporaryFile('PackZIP.exe');
    #endif

    ExtractTemporaryFile('English.ini');

  #ifdef precomp
    PCFVer:={#precomp};
  #else
    PCFVer:=0;
  #endif
    ISDoneError:=true;
    if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, MainForm.Handle, {#NeedMem}, @ProgressCallback) then
    begin
      repeat
//        ChangeLanguage('English');
        if not SrepInit('',512,0) then break;
        if not PrecompInit('',128,PCFVer) then break;
        if not FileSearchInit(true) then break;

        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\Zuma_Deluxe.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;

        ISDoneError:=false;
      until true;
      ISDoneStop;
    end;
    HideControls;
  end;
  if {(CurStep=ssPostInstall) and} ISDoneError then
  begin
    Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
  end;
end;

только я компоненты удалили т.к они мне не нужны

-------
Помог? От "Полезное сообщение" не откажусь!!!


Отправлено: 12:41, 28-05-2014 | #827


Пользователь


Сообщения: 148
Благодарности: 49

Профиль | Отправить PM | Цитировать


habib2302, omg. ISDone 0.6 final

Отправлено: 13:48, 28-05-2014 | #828


Аватара для Bond01

Ветеран


Автор проектов


Сообщения: 1064
Благодарности: 181

Профиль | Отправить PM | Цитировать


Всем доброго дня!
У кого сейчас есть немного времени и желание, может заинтересует вот эта программа - Ashampoo Burning Studio Free 1.14.5 [Multi Ru]
Разобрать ее, убрать все лишнее, готов помогать.
https://www.ashampoo.com/ru/usd/pin/...ng-Studio-FREE

Отправлено: 22:33, 29-05-2014 | #829


Пользователь


Сообщения: 119
Благодарности: 0

Профиль | Отправить PM | Цитировать


Всем привет.
Как в установщике заменить кнопки? Существует ли на это скрипт?
У меня сейчас такие:

Как сделать такие:


Заранее спасибо за помощь.

Отправлено: 14:37, 30-05-2014 | #830



Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » Скрипты Inno Setup. Помощь и советы [часть 7]

Участник сейчас на форуме Участник сейчас на форуме Участник вне форума Участник вне форума Автор темы Автор темы Шапка темы Сообщение прикреплено

Похожие темы
Название темы Автор Информация о форуме Ответов Последнее сообщение
Скрипты Inno Setup. Помощь и советы [часть 6] El Sanchez Автоматическая установка приложений 2494 10-03-2014 11:51
Скрипты Inno Setup. Помощь и советы [часть 5] El Sanchez Автоматическая установка приложений 1999 28-03-2013 19:09
Скрипты Inno Setup. Помощь и советы [часть 4] El Sanchez Автоматическая установка приложений 2099 22-05-2012 23:16
Скрипты Inno Setup. Помощь и советы [часть 3] Serega Автоматическая установка приложений 3755 26-10-2011 17:58
[архив] Скрипты Inno Setup. Помощь и советы [часть 2] Serega Автоматическая установка приложений 2651 08-11-2010 18:34




 
Переход