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

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

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

articlebot (13-10-2013 23:33): продолжение темы - №15
 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

ShadowHawk



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

[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={code:MyConst}\My Program
OutputDir=.
 
[Types]
#define FileNameINI "tmp.ini"
#define FileHandle
#define FileLine
#define CountSection 0
#dim org[100]
#define i
 
#sub ProcessFileLine
//  #pragma message str(Pos('[',FileLine))+" "+ str(Pos(']',FileLine))+" "+ str(len(FileLine))
  #if (Pos("[", FileLine) == 1) && (Pos(']', FileLine) ==  Len(FileLine) )
     #expr org[CountSection] = FileLine
     #expr CountSection = CountSection + 1
     
  #endif
#endsub
 
#for {FileHandle = FileOpen(FileNameINI); \
  FileHandle && !FileEof(FileHandle); FileLine = FileRead(FileHandle)} \
  ProcessFileLine
  #if FileHandle
  #expr FileClose(FileHandle)
#endif
 
#pragma message 'countSection = '+str(countSection)
 
#sub AddTypes
  #pragma message org[i]
  Name: org[i]; Description: org[i]
#endsub
 
#for {i = 0; i < countSection; i++} AddTypes
 
 
[code]
function MyConst(Param: String): String;
begin
  Log('MyConst(''' + Param + ''') called');
  Result := ExpandConstant('{pf}');
end;
 
function GCS: String;
var
  S: TArrayOfString;
  F: String;
  i,n: Integer;
  FileNameINI: string;
begin
  FileNameINI := 'tmp.ini';
  n := 0
  Result := '';
  if FileExists(FileNameINI) then
  begin
    LoadStringsFromFile(FileNameINI, S);
    for i := 0 to GetArrayLength(S)-1 do
    begin
      if (Pos('[', S[i]) = 1) and (Pos(']', S[i]) =  Length(S[i]) )  then
      begin
        n := n + 1;
      end;
    end;
  end;
  Result := IntToStr(n);
 
end;
 
 
procedure MyButtonOnClick(Sender: TObject);
begin
  MsgBox( GCS, mbInformation, MB_OK);
end;
 
procedure PanelButtons();
var
  MyButton: TButton;
  MyPanel: TPanel;
Begin
  MyPanel := TPanel.Create( WizardForm );
  with MyPanel do
  begin
    Parent          := WizardForm;
    Left            := WizardForm.WelcomePage.Left;
    Top             := WizardForm.WelcomePage.Height + ScaleX(1);
    Width           := WizardForm.WelcomePage.Width- 200;
    Height          := WizardForm.ClientHeight - WizardForm.WelcomePage.Height - 2;
    Align           := alBottom;
  End;
 
  WizardForm.NextButton.Parent   := MyPanel;
  WizardForm.CancelButton.Parent := MyPanel;
  WizardForm.BackButton.Parent   := MyPanel;
  WizardForm.NextButton.Top      := WizardForm.NextButton.Top   - (WizardForm.WelcomePage.Height + ScaleX(1));
  WizardForm.CancelButton.Top    := WizardForm.CancelButton.Top - (WizardForm.WelcomePage.Height + ScaleX(1));
  WizardForm.BackButton.Top      := WizardForm.BackButton.Top   - (WizardForm.WelcomePage.Height + ScaleX(1));
 
  MyButton:=TButton.Create( WizardForm );
  with MyButton do
  begin
    Parent:=MyPanel;
    Top:=WizardForm.BackButton.Top;
    Left:=WizardForm.BackButton.Left - WizardForm.BackButton.Width - 30;
    Width:=WizardForm.BackButton.Width + 30;
    Height:=WizardForm.BackButton.Height;
    Caption:='Сколько секций';
    OnClick:=@MyButtonOnClick;
    Font.Name:= 'arial';
    Font.Size:= 9;
    Font.Style:= [fsBold, fsItalic];
  end;
end;
 
 
 
procedure InitializeWizard();  
begin  
  MsgBox ( '{#countSection}', mbInformation, MB_OK);
  PanelButtons();
end;

Всего записей: 28 | Зарегистр. 18-08-2011 | Отправлено: 19:10 13-09-2011 | Исправлено: ShadowHawk, 19:18 13-09-2011
   

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

Компьютерный форум Ru.Board » Компьютеры » Программы » Inno Setup (создание инсталяционных пакетов)
articlebot (13-10-2013 23:33): продолжение темы - №15


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

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

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru