Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Аватара для Drongo

Будем жить, Маэстро...


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

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


Цитата Serega_:
там единственное идёт показ по времени »
Это нормально, так как установка около 3.66 ГБ, будет сжата по максимуму, так что нормально, но если будет время поискать по процентам, не откажусь опробовать и такой вариант.
В принципе всё получилось и инсталятор рабочий! Только три нюанса портят всю красоту...

Три нюанса

1. Диалог установки



2. Картинка вверху, во время выбора куда устанавливать, нужны ли ярлыки



3. Финиш установки


Подскажите, что и где нужно подправить? Я бы хотел вместо этих стандартных, втулить свои, пользовательские картинки. Какой нужен размер?

Скрипт предложенный Serega_, на нём я остановился.
Скрипт
Код: Выделить весь код
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "My Program"
#define MyAppVerName "My Program 1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "StyleBuilder.exe"
#define TIME_FOR_VIEW 1

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{337AE44F-3DF6-4C55-AFCA-AAA9A6436F0E}
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=E:\
OutputBaseFilename=setup
Compression=none
SolidCompression=yes

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: compiler:Libraries\InnoCallback.dll; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_2.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_3.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_4.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_5.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_6.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_7.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_8.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_9.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_10.bmp; Flags: dontcopy

;Source: "D:\Контроль\TGTSoft\StyleBuilder\StyleBuilder.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Programms\Я_Автоустановка\BartPE\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Сode]
//--------------
type
  TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);

var
  WelcomeLabel1,WelcomeLabel2,FinishedHeadingLabel,RunLabel,
  FinishedLabel,PageNameLabel,PageDescriptionLabel:TLabel;
  RunMyProg: TCheckBox;
  TimerID: LongWord;
  currTime: Integer;
  SplashImage: TBitmapImage;

function WrapTimerProc(callback:TProc; paramcount:integer):longword;
  external 'wrapcallback@files:InnoCallback.dll stdcall';

function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord;
  external 'SetTimer@user32.dll stdcall';

function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord;
  external 'KillTimer@user32.dll stdcall';

procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
   currTime := currTime + 1;
   case currTime of
  {#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_2.bmp')) end;
   2*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_3.bmp')) end;
   3*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_4.bmp')) end;
   4*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_5.bmp')) end;
   5*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_6.bmp')) end;
   6*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_7.bmp')) end;
   7*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_8.bmp')) end;
   8*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_9.bmp')) end;
   9*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_10.bmp'))end;
   end;
   if CurrTime = 9*{#TIME_FOR_VIEW} then CurrTime := -1;
end;

procedure RLabelOnClick(Sender: TObject);
begin
  if RunMyProg.Checked=false then
  begin
    RunMyProg.Checked := true;
  end else
    RunMyProg.Checked := false;
end;

// функция для запуска программы если отмечен чебокс
procedure CurStepChanged(CurStep: TSetupStep);
var
  ErrorCode: Integer;
begin
if CurStep = ssDone then
  begin
    if RunMyProg.Checked then
    Exec(ExpandConstant('{app}\MyProg.exe'), '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
  end;
end;

procedure InitializeWizard();
begin
  ExtractTemporaryFile('Image_2.bmp')
  ExtractTemporaryFile('Image_3.bmp')
  ExtractTemporaryFile('Image_4.bmp')
  ExtractTemporaryFile('Image_5.bmp')
  ExtractTemporaryFile('Image_6.bmp')
  ExtractTemporaryFile('Image_7.bmp')
  ExtractTemporaryFile('Image_8.bmp')
  ExtractTemporaryFile('Image_9.bmp')
  ExtractTemporaryFile('Image_10.bmp')

  currTime := 0;

      WizardForm.WelcomeLabel1.Hide;
      WizardForm.WelcomeLabel2.Hide;
      WizardForm.PageNameLabel.Hide;
      WizardForm.PageDescriptionLabel.Hide;
      WizardForm.FinishedHeadingLabel.Hide;
      WizardForm.FinishedLabel.Hide;
    // низнаю почему, но Hide не действует. Поэтому просто уменьшил размер
      WizardForm.RunList.Height := 0;
      WizardForm.RunList.Width := 0;
      WizardForm.FilenameLabel.Hide;

  WizardForm.StatusLabel.Parent := WizardForm;
  WizardForm.StatusLabel.Top := ScaleY(315);
  WizardForm.StatusLabel.Left := ScaleX(10);
  WizardForm.StatusLabel.Width := ScaleX(200);
  WizardForm.StatusLabel.Hide;

      WizardForm.ProgressGauge.Parent := WizardForm;
      WizardForm.ProgressGauge.Top := ScaleY(330);
      WizardForm.ProgressGauge.Left := ScaleX(10);
      WizardForm.ProgressGauge.Width := ScaleX(380);
      WizardForm.ProgressGauge.Height := ScaleX(18);
      WizardForm.ProgressGauge.Hide;

  SplashImage := TBitmapImage.Create(WizardForm);
  SplashImage.Top := 0;
  SplashImage.Left := 0;
  SplashImage.Width := WizardForm.MainPanel.Width;
  SplashImage.Height := WizardForm.Bevel.Top;
  SplashImage.Parent := WizardForm.InnerPage;
  SplashImage.Stretch := True;
//  SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_7.bmp'));
  SplashImage.Hide;

      WizardForm.WizardBitmapImage.Align:=true;
      WizardForm.WizardBitmapImage2.Align:=true;
      WizardForm.WizardSmallBitmapImage.Align:=true;

  WelcomeLabel1:=TLabel.Create(WizardForm);
  WelcomeLabel1.Left:=ScaleX(150);
  WelcomeLabel1.Top := ScaleY(15);
  WelcomeLabel1.Width := ScaleX(320);
  WelcomeLabel1.Height := ScaleY(75);
  WelcomeLabel1.AutoSize := False;
  WelcomeLabel1.WordWrap := True;
  WelcomeLabel1.Font.Color := clBlack;
// здесь можно поиграть шрифтом
//  WelcomeLabel1.Font.Style := [fsBold];
//  WelcomeLabel1.Font.Name:='MS Sans Serif';
  WelcomeLabel1.Font.Size := 14;
  WelcomeLabel1.Transparent := True;
  WelcomeLabel1.Parent := WizardForm.WelcomePage;

      WelcomeLabel2:=TLabel.Create(WizardForm);
      WelcomeLabel2.Left := ScaleX(150);
      WelcomeLabel2.Top := ScaleY(90);
      WelcomeLabel2.Width := ScaleX(320);
      WelcomeLabel2.Height := ScaleY(200);
      WelcomeLabel2.AutoSize := False;
      WelcomeLabel2.WordWrap := True;
      WelcomeLabel2.Font.Color := clBlack;
      WelcomeLabel2.Font.Size := 8;
      WelcomeLabel2.Transparent := True;
      WelcomeLabel2.Parent := WizardForm.WelcomePage;

  PageNameLabel := TLabel.Create(WizardForm);
  PageNameLabel.Left := ScaleX(25);
  PageNameLabel.Top := ScaleY(10);
  PageNameLabel.Width := ScaleX(300);
  PageNameLabel.Height := ScaleY(14);
  PageNameLabel.AutoSize := False;
  PageNameLabel.WordWrap := True;
  PageNameLabel.Font.Color := clBlack;
  PageNameLabel.Font.Style := [fsBold];
  PageNameLabel.Transparent := True;
  PageNameLabel.Parent := WizardForm.MainPanel;

      PageDescriptionLabel := TLabel.Create(WizardForm);
      PageDescriptionLabel.Left := ScaleX(40);
      PageDescriptionLabel.Top := ScaleY(25);
      PageDescriptionLabel.Width := ScaleX(475);
      PageDescriptionLabel.Height := ScaleY(30);
      PageDescriptionLabel.AutoSize := False;
      PageDescriptionLabel.WordWrap := True;
      PageDescriptionLabel.Font.Color := clBlack;
      PageDescriptionLabel.Transparent := True;
      PageDescriptionLabel.Parent := WizardForm.MainPanel;

  FinishedHeadingLabel:=TLabel.Create(WizardForm);
  FinishedHeadingLabel.Left := ScaleX(150);
  FinishedHeadingLabel.Top := ScaleY(15);
  FinishedHeadingLabel.Width := ScaleX(320);
  FinishedHeadingLabel.Height := ScaleY(75);
  FinishedHeadingLabel.AutoSize := False;
  FinishedHeadingLabel.WordWrap := True;
  FinishedHeadingLabel.Font.Color := clBlack;
// здесь тоже можно поиграть шрифтом
//  FinishedHeadingLabel.Font.Style := [fsBold];
//  FinishedHeadingLabel.Font.Name:='MS Sans Serif';
  FinishedHeadingLabel.Font.Size := 14;
  FinishedHeadingLabel.Transparent := True;
  FinishedHeadingLabel.Parent := WizardForm.FinishedPage;

      FinishedLabel:=TLabel.Create(WizardForm);
      FinishedLabel.Left := ScaleX(150);
      FinishedLabel.Top := ScaleY(90);
      FinishedLabel.Width := ScaleX(320);
      FinishedLabel.Height := ScaleY(200);
      FinishedLabel.AutoSize := False;
      FinishedLabel.WordWrap := True;
      FinishedLabel.Font.Color := clBlack;
      FinishedLabel.Font.Size := 8;
      FinishedLabel.Transparent := True;
      FinishedLabel.Parent := WizardForm.FinishedPage;

  RunMyProg := TCheckBox.Create(WizardForm);
  RunMyProg.Parent := WizardForm.FinishedPage;
  RunMyProg.Left := ScaleX(150);
  RunMyProg.Top := ScaleY(152);
  RunMyProg.Width := ScaleX(14);
  RunMyProg.Height := ScaleX(14);
//  RunMyProg.Checked := true; // чтоб чебокс был отмечен, раскоментируй строку

      RunLabel:=TLabel.Create(WizardForm);
      RunLabel.Left := ScaleX(170);
      RunLabel.Top := ScaleY(150);
      RunLabel.Width := ScaleX(200);
      RunLabel.Height := ScaleY(20);
      RunLabel.AutoSize := False;
      RunLabel.WordWrap := True;
      RunLabel.Font.Color := clBlack;
      RunLabel.Font.Size := 10;
      RunLabel.OnClick := @RLabelOnClick;
      RunLabel.Transparent := True;
      RunLabel.Parent := WizardForm.FinishedPage;
end;

procedure CurPageChanged(CurPageID: Integer);
var
  pfunc: LongWord;

begin
  WelcomeLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
  WelcomeLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
  PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
  PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
  FinishedHeadingLabel.Caption := WizardForm.FinishedHeadingLabel.Caption;
  FinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
// здесь придётся вручную вводить требуемый текст
  RunLabel.Caption := 'Запустить программу';

  if (CurPageID = wpInstalling) then
    begin
      pfunc := WrapTimerProc(@OnTimer, 4);
      TimerID := SetTimer(0, 0, 1000, pfunc);

      WizardForm.InnerNotebook.Hide;
      WizardForm.Bevel1.Hide;
      WizardForm.MainPanel.Hide;
      WizardForm.PageNameLabel.Hide;
      WizardForm.PageDescriptionLabel.Hide;

      WizardForm.ProgressGauge.Show;
      WizardForm.StatusLabel.Show;
      SplashImage.Show;
    end
  else
    begin
      WizardForm.ProgressGauge.Hide;
      WizardForm.StatusLabel.Hide;
      SplashImage.Hide;

    if (CurPageID > wpInstalling) and (CurPageID < wpFinished) then
    begin
      WizardForm.InnerNotebook.Show;
      WizardForm.Bevel1.Show;
      WizardForm.MainPanel.Show;
      WizardForm.PageNameLabel.Show;
      WizardForm.PageDescriptionLabel.Show;
    end;
  end;
end;

procedure DeinitializeSetup();
begin
  KillTimer(0, TimerID);
end;
//--------------
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

;[Run]
;Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent
И ещё некритичный вопрос. Можно ли и сюда запихнуть какую-нибудь картинку? Или хотя бы сменить цвет в окне установки с серого, на тёмно-коричневый, как заголовок окна.

-------
Правильная постановка вопроса свидетельствует о некотором знакомстве с делом.
3нание бывает двух видов. Мы сами знаем предмет — или же знаем, где найти о нём сведения.
[Quick Killer 3.0 Final [OSZone.net]] | [Quick Killer 3.0 Final [SafeZone.cc]] | [Парсер логов Gmer] | [Парсер логов AVZ]

http://tools.oszone.net/Drongo/Userbar/SafeZone_cc.gif


Последний раз редактировалось Drongo, 15-04-2009 в 19:27. Причина: Соответственно требованиям раздела


Отправлено: 12:24, 15-04-2009 | #618