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

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

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

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

   

Genri

Advanced Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору

Код:
 
[Setup]  
AppName=My Program  
AppVerName=My Program version 1.5  
DefaultDirName={pf}\My Program  
DisableProgramGroupPage=yes  
WindowVisible=no
 
[Files]  
Source: Files\*.*; DestDir: {app}; Flags: ignoreversion
Source: WizModernSmallImage.bmp; Flags: dontcopy
Source: splash.bmp; Flags: dontcopy
 
[Code]
function GetSystemMetrics(nIndex:Integer):Integer;
external 'GetSystemMetrics@user32.dll stdcall';
 
function InitializeSetup(): Boolean;
var
  Form, Splash: TSetupForm;
  ProgressBar: TNewProgressBar;
  CancelButton: TButton;
  StaticText: TNewStaticText;
  BitmapImage, BitmapImage1: TBitmapImage;
  BitmapFileName: String;
  i: Integer;
begin
  Form := CreateCustomForm();
  try
    with Form do
      begin
        ClientWidth := ScaleX(380);
        ClientHeight := ScaleY(120);
        BorderStyle:= bsDialog;
        Left:= GetSystemMetrics(16) - ClientWidth  -  ScaleX(12);
        Top:=  GetSystemMetrics(17) - ClientHeight  - ScaleY(12);
      end;
 
    BitmapFileName := ExpandConstant('{tmp}\WizModernSmallImage.bmp');
    ExtractTemporaryFile(ExtractFileName(BitmapFileName));
    BitmapImage := TBitmapImage.Create(Form);
    BitmapImage.Left := ScaleX(8);
    BitmapImage.Top := ScaleY(8);
    BitmapImage.AutoSize := True;
    BitmapImage.Bitmap.LoadFromFile(BitmapFileName);
    BitmapImage.Parent := Form;
 
    StaticText := TNewStaticText.Create(Form);
    StaticText.Top := BitmapImage.Top;
    StaticText.Left := BitmapImage.Left + BitmapImage.Width + ScaleX(8)
    StaticText.Caption := 'Inno Setup is a free installer for Windows programs.' +
                     + #10#13 + 'Support for all versions of Windows in use today';
    StaticText.AutoSize := True;
    StaticText.Parent := Form;
   
    CancelButton := TButton.Create(Form);
    CancelButton.Parent := Form;
    CancelButton.Width := ScaleX(75);
    CancelButton.Height := ScaleY(23);
    CancelButton.Left := Form.ClientWidth - ScaleX(75 + 10);
    CancelButton.Top := Form.ClientHeight - ScaleY(23 + 10);
    CancelButton.Caption := 'Cancel';
    CancelButton.ModalResult := mrCancel;
    CancelButton.Cancel := True;
 
    ProgressBar := TNewProgressBar.Create(Form);
    with ProgressBar do
      begin
        Height := CancelButton.Height - ScaleY(8);
        Width := Form.Width - ScaleX(128);
        Top := CancelButton.Top;
        Left := BitmapImage.Left;
        Parent := Form;
        Min:= 0;
        Max:= 30;
        Position := 0;
      end;
 
    Form.ActiveControl := CancelButton;
    Form.Show();
 
Splash := CreateCustomForm;
  Splash.BorderStyle := bsNone;
  BitmapImage1 := TBitmapImage.Create(Splash);
  with BitmapImage1 do begin
    AutoSize := True;
    Align := alClient;
    Left := 0;
    Top := 0;
    Stretch := True;
    Parent := Splash;
  end;
  ExtractTemporaryFile('Splash.bmp');
  BitmapImage1.Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\Splash.bmp');
  Splash.Width := BitmapImage1.Width;
  Splash.Height := BitmapImage1.Height;
  Splash.Center;
  Splash.Show;
  BitmapImage1.Refresh;
 
    for i:= 0 to 30 do
      begin
        ProgressBar.Position:= i;
        Form.Repaint;
        Sleep(500);
        i:= i + 1;
      end;
  finally
    Form.Free();
    Splash.Free();
  end;
  Result:= True;
end;  

Всего записей: 872 | Зарегистр. 06-09-2003 | Отправлено: 18:47 14-01-2007
   

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

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


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

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

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru