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

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

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

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

   

Raf_SE



Advanced Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
[Code]
    function ShouldSkipPage(CurPage: Integer): Boolean;
    begin
      if Pos('/SP-', UpperCase(GetCmdTail)) > 0 then
        case CurPage of
          wpLicense, wpPassword, wpInfoBefore, wpUserInfo,
          wpSelectDir, wpSelectProgramGroup, wpInfoAfter:
            Result := True;
        end;
    end;
 
    const
      WM_LBUTTONDOWN = 513;
      WM_LBUTTONUP = 514;
 
 
type  TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);
 
var   Form : TSetupForm;
      BackImage, SlideImage: TBitmapImage;
      TimerID: LongWord;
      S : String;
      Width, Height:Integer;
 
 
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';
 
function GetSystemMetrics(nIndex:Integer):Integer;
external 'GetSystemMetrics@user32.dll stdcall';
 
 
function PercentProgress(): Integer;
begin
 with WizardForm.ProgressGauge do
 begin
  Result:=(Position-Min)/((Max - Min)/100)
 end
end;
 
 
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
 
var  Percent: Integer;
 
begin
 Percent:= PercentProgress;
 with SlideImage do
 begin
  if ((percent>0) and (percent<4) and (Tag<>1)) then begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd1.bmp')
  Tag:=1
 end
 else
 if ((percent>5) and (percent<8) and (Tag<>2)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd2.bmp')
  Tag:=2
 end
 else
 if ((percent>9) and (percent<13) and (Tag<>3)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd3.bmp')
  Tag:=3
 end
 else
 if ((percent>14) and (percent<18) and (Tag<>4)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd4.bmp')
  Tag:=4
 end
 else
 if ((percent>19) and (percent<23) and (Tag<>5)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd5.bmp')
  Tag:=5
 end
 else
 if ((percent>24) and (percent<28) and (Tag<>6)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd6.bmp')
  Tag:=6
 end
 else
 if ((percent>32) and (percent<36) and (Tag<>7)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd7.bmp')
  Tag:=7
 end
 else
 if ((percent>37) and (percent<41) and (Tag<>8)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd8.bmp')
  Tag:=8
 end
 else
 if ((percent>42) and (percent<46) and (Tag<>9)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd9.bmp')
  Tag:=9
 end
 else
 if ((percent>47) and (percent<51) and (Tag<>10)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd10.bmp')
  Tag:=10
 end
 else
 if ((percent>52) and (percent<56) and (Tag<>11)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd11.bmp')
  Tag:=11
 end
 else
 if ((percent>57) and (percent<61) and (Tag<>12)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd12.bmp')
  Tag:=12
 end
 else
 if ((percent>62) and (percent<66) and (Tag<>13)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd13.bmp')
  Tag:=13
 end
 else
 if ((percent>67) and (percent<71) and (Tag<>14)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd14.bmp')
  Tag:=14
 end
 else
 if ((percent>72) and (percent<76) and (Tag<>15)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd15.bmp')
  Tag:=15
 end
 else
 if ((percent>77) and (percent<81) and (Tag<>16)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd16.bmp')
  Tag:=16
 end
 else
 if ((percent>82) and (percent<86) and (Tag<>17)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd17.bmp')
  Tag:=17
 end
 else
 if ((percent>87) and (percent<91) and (Tag<>18)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd18.bmp')
  Tag:=18
 end
 else
 if ((percent>92) and (percent<96) and (Tag<>19)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd19.bmp')
  Tag:=19
 end
 else
 if ((percent>97) and (percent<100) and (Tag<>20)) then
 begin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\bbrd20.bmp')
  Tag:=20
 end
end
end;
 
 
function sndPlaySound(lpszSoundName: string; uFlags: cardinal):integer;
external 'sndPlaySoundA@winmm.dll stdcall';
 
procedure InitializeWizard();
begin
if (Pos('/SP-', UpperCase(GetCmdTail)) > 0) then
begin
PostMessage(WizardForm.NextButton.Handle,WM_LBUTTONDOWN,0,0);
PostMessage(WizardForm.NextButton.Handle,WM_LBUTTONUP,0,0);
end
else
begin
ExtractTemporaryFile(ExpandConstant('splash.wav'));
sndPlaySound(ExpandConstant('{tmp}\splash.wav'), $0001 or $0008);
 
WizardForm.Position:= poScreenCenter;
Width:= GetSystemMetrics(0);
Height:= GetSystemMetrics(1);
MainForm.BorderStyle:= bsNone;
MainForm.Left:= 0;
MainForm.Top:= 0;
MainForm.Width:= Width;
MainForm.Height:= Height;
 
ExtractTemporaryFile('1.bmp');
S:= ExpandConstant('{tmp}')+'\1.bmp';
 
BackImage:=TBitmapImage.Create(MainForm);
BackImage.Bitmap.LoadFromFile(S);
BackImage.Align:= alClient;
BackImage.Parent:= MainForm;
BackImage.Stretch:= True;
MainForm.Visible:= True;
 
ExtractTemporaryFile('1.bmp');
ExtractTemporaryFile('bbrd1.bmp');
ExtractTemporaryFile('bbrd2.bmp');
ExtractTemporaryFile('bbrd3.bmp');
ExtractTemporaryFile('bbrd4.bmp');
ExtractTemporaryFile('bbrd5.bmp');
ExtractTemporaryFile('bbrd6.bmp');
ExtractTemporaryFile('bbrd7.bmp');
ExtractTemporaryFile('bbrd8.bmp');
ExtractTemporaryFile('bbrd9.bmp');
ExtractTemporaryFile('bbrd10.bmp');
ExtractTemporaryFile('bbrd11.bmp');
ExtractTemporaryFile('bbrd12.bmp');
ExtractTemporaryFile('bbrd13.bmp');
ExtractTemporaryFile('bbrd14.bmp');
ExtractTemporaryFile('bbrd15.bmp');
ExtractTemporaryFile('bbrd16.bmp');
ExtractTemporaryFile('bbrd17.bmp');
ExtractTemporaryFile('bbrd18.bmp');
ExtractTemporaryFile('bbrd19.bmp');
ExtractTemporaryFile('bbrd20.bmp');
end;
end;
 
 procedure CurPageChanged(CurPageID: Integer);
var Pfunc : LongWord;
begin
 If CurPageID = wpInstalling then
 begin
  Form := CreateCustomForm();
 
  Form.Width:= MainForm.Width;
  Form.Height:= MainForm.Height;
  Form.BorderStyle := bsNone;
  Form.Color:=clBlack;
  Form.Parent:=MainForm;
  Form.Position:=poScreenCenter;
 
  Form.Show();
 
  pfunc:=WrapTimerProc(@OnTimer, 4)
  TimerID:=SetTimer(0, 0, 500, pfunc)
 
  S:= (ExpandConstant('{tmp}') + '\bbrd1.bmp');
 
  SlideImage:= TBitmapImage.Create(Form);
  with SlideImage do
  begin
   Align:= alClient;
   Stretch:= True;
   Bitmap.LoadFromFile(S);
   Parent:= Form;
   Tag:= 1;
  end
 
  with WizardForm do
  begin
   MainPanel.Hide;
   Bevel1.Hide;
   Width:= ScaleX(395);
   Height:= ScaleY(142);
   Left:= ScaleX(0);
   Top:= ScaleY(0);
   Left:= ScaleX(MainForm.Width-420);
   Top:= ScaleY(MainForm.Height-170);
   InnerNotebook.Left:= ScaleX(10);
   InnerNotebook.Top:= ScaleY(10);
   InnerNotebook.Width:= ScaleX(370);
   StatusLabel.Left:= ScaleX(0);
   StatusLabel.Top:= ScaleY(0);
   StatusLabel.Width:= WizardForm.InnerNotebook.Width;
   FileNameLabel.Left:= ScaleX(0);
   FileNameLabel.Top:= ScaleY(20);
   FileNameLabel.Width:=WizardForm.InnerNotebook.Width;
   ProgressGauge.Top:= ScaleY(40);
   ProgressGauge.Width:= WizardForm.InnerNotebook.Width;
   CancelButton.BringToFront;
   CancelButton.Left:= ScaleX(154);
   CancelButton.Top:= ScaleY(80);
  end
 end
 
  if CurPageID = wpFinished then
  begin
   Form.Free;
   KillTimer(0, TimerID);
   WizardForm.Width:=502;
   WizardForm.Height:=392;
   WizardForm.Position:=poScreenCenter;
  end
 
  if (Pos('/SP-', UpperCase(GetCmdTail)) > 0) and
    (CurPageID = wpSelectComponents) then
      WizardForm.BackButton.Visible := False;
end;
 
 
procedure DeinitializeSetup();
begin
 KillTimer(0, TimerID);
end;
 
 
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
  Res: Integer;
begin
 case CurUninstallStep of
 usPostUninstall:
  begin
   if DirExists(ExpandConstant('{app}')) then
   if ExpandConstant('{language}') = 'ua' then
   case MsgBox('Папка "' + ExpandConstant('{app}') + '" не порожня.'#13#13 +
               '"Так" – повне видалення всіх файлів у папці, включаючи саму папку.' #13#13 +
               '"Ні" – відкрити папку в провіднику, щоб вручну видалити файли.'#13#13 +
               '"Скасувати" – нічого не робити, видалити папку пізніше самостійно.', mbInformation, MB_YESNOCANCEL) of
 
        IDYES:
         if not DelTree(ExpandConstant('{app}'), True, True, True) then
                MsgBox('Папка не видалена.' #13#13 'Папка або один з файлів у ній задіяні іншою програмою.', mbError, MB_OK);
 
        IDNO:
         if not ShellExec('open', ExpandConstant('{app}'), '', '', SW_SHOWMAXIMIZED, ewNoWait, Res) then
                MsgBox('Помилка відкриття.' #13#13 'Папка не знайдена.', mbError, MB_OK);
 
        IDCANCEL: Form.Close;
   end
   else
   if ExpandConstant('{language}') = 'ru' then
    case MsgBox('Папка "' + ExpandConstant('{app}') + '" не пуста.'#13#13 +
               '"Да" – полное удаление всех файлов в папке, включая саму папку.' #13#13 +
               '"Нет" – открыть папку в проводнике, чтобы вручную удалить файлы.'#13#13 +
               '"Отмена" – ничего не делать, удалить папку позже самостоятельно.', mbInformation, MB_YESNOCANCEL) of
 
        IDYES:
         if not DelTree(ExpandConstant('{app}'), True, True, True) then
                MsgBox('Папка не удалена.' #13#13 'Папка или один из файлов в ней задействованы другим приложением.', mbError, MB_OK);
 
        IDNO:
         if not ShellExec('open', ExpandConstant('{app}'), '', '', SW_SHOWMAXIMIZED, ewNoWait, Res) then
                MsgBox('Ошибка открытия.' #13#13 'Папка не найдена.', mbError, MB_OK);
 
        IDCANCEL: Form.Close;
   end
   else
    case MsgBox('Directory "' + ExpandConstant('{app}') + '" is not empty.'#13#13 +
               '"Yes" to delete all of the files in the directory, including the directory itself.' #13#13 +
               '"No" to open the directory with explorer to delete the files manually.'#13#13 +
               '"Cancel" to do nothing and delete the directory later manually. ', mbInformation, MB_YESNOCANCEL) of
 
        IDYES:
         if not DelTree(ExpandConstant('{app}'), True, True, True) then
                MsgBox('Directory is not deleted.' #13#13 'Directory or one of the files are used by the other application.', mbError, MB_OK);
 
        IDNO:
         if not ShellExec('open', ExpandConstant('{app}'), '', '', SW_SHOWMAXIMIZED, ewNoWait, Res) then
                MsgBox('Error opening the directory.' #13#13 'Directory is not found.', mbError, MB_OK);
 
        IDCANCEL: Form.Close;
    end
  end
 end
end;
 
function NextButtonClick(CurPage: Integer): Boolean;
begin
 Result := True;
 if CurPage = wpSelectDir then
  if DirExists( ExpandConstant('{app}') ) then
  begin
   MsgBox(ExpandConstant('{cm:InstallationIsNotEnabled}'), mbError, mb_Ok);
   Result := False;
  end
end;

Всего записей: 1143 | Зарегистр. 06-08-2006 | Отправлено: 20:05 06-06-2008 | Исправлено: Raf_SE, 20:06 06-06-2008
   

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

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


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

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

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru