Inno Setup (создание инсталяционных пакетов)

  • Автор темы Автор темы Shegorat
  • Дата начала Дата начала
Статус
В этой теме нельзя размещать новые ответы.
Shift85,
type
Pchar = Pansichar;
эти строки убери, с версии 5.3.0 это уже есть в сорцах инно
 
Shift85, скорее всего тебе вот это нужно
Код:
[color=none][[/color]Code]
var
  ISCustomPage1: TWizardPage;
  Panel1: TPanel;
  Bevel2: TBevel;
  Panel2: TPanel;

procedure InitializeWizard();
begin
  ISCustomPage1 := CreateCustomPage(wpUserInfo, 'Custom', 'Description');

  Panel1 := TPanel.Create(WizardForm);
  with Panel1 do
  begin
    Parent := ISCustomPage1.Surface;
    Left := ScaleX(8);
    Top := ScaleY(8);
    Width := ScaleX(393);
    Height := ScaleY(217);
  end;

  Bevel2 := TBevel.Create(WizardForm);
  with Bevel2 do
  begin
    Parent := Panel1;
    Left := ScaleX(8);
    Top := ScaleY(8);
    Width := ScaleX(377);
    Height := ScaleY(201);
  end;

  Panel2 := TPanel.Create(WizardForm);
  with Panel2 do
  begin
    Parent := Panel1;
    Left := ScaleX(16);
    Top := ScaleY(16);
    Width := ScaleX(361);
    Height := ScaleY(185);
    Caption := 'Привет';
  end;
end;
 
Как сделать двойной прогресс бар как тут

Помогите пожалуйста как этот код

ISCustomPage1 := CreateCustomPage(wpUserInfo, 'Custom', 'Description');

прикрутить ко всем страницам кроме первой и последней.

vint56, Не могу прикрутить вот сюда StatusLabel6


Код

var
BmpFile: TBitmapImage;
ISCustomPage1: TWizardPage;
Panel1,Panel2: TPanel;
StatusLabel1,StatusLabel2,StatusLabel3,StatusLabel4,StatusLabel5,StatusLabel6: TLabel;
Bevel2: TBevel;
DirBevel,GroupBevel,DriveBevel: TBevel;
TotalSpaceLabel, FreeSpaceLabel, NeedSpacelabel, InstallSpaceLabel: TLabel;
FreeMB, TotalMB: Cardinal;

function NumToStr(Float: Extended): String;
begin
Result:= format('%.2n', [Float]); StringChange(Result, ',', '.');
while (Result[Length(Result)] = '0')or((Result[Length(Result)] = '.')and(Pos('.', Result) > 0)) do
SetLength(Result, Length(Result)-1);
end;

function MbOrTb(Float: Extended): String;
begin
if Float < 1024 then Result:= NumToStr(Float)+' Ìá' else
if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' Ãá' else
Result:= NumToStr(Float/(1024*1024))+' Òá';
end;

procedure DirEditOnChange(Sender: TObject);
var Drive: String;
begin
Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
TotalSpaceLabel.Caption := ExpandConstant('{cm:TotalSpaceLabel} ')+MbOrTb(TotalMB);
FreeSpaceLabel.Caption := ExpandConstant('{cm:FreeSpaceLabel} ')+MbOrTb(FreeMB)+' ('+IntToStr(round(FreeMB*100/TotalMB))+'%)';
InstallSpacelabel.Caption := ExpandConstant('{cm:InstallSpacelabel} ')+MbOrTb({#NeedInstallSize});
NeedSpaceLabel.Caption := ExpandConstant('{cm:NeedSpaceLabel} ')+MbOrTb({#NeedSize});
WizardForm.NextButton.Enabled:= (FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize}) ;
end;

procedure InitializeWizard();
begin
WizardForm.Width:=ScaleX(586);
WizardForm.Height:=ScaleY(438);
WizardForm.Position:=poScreenCenter;
WizardForm.CancelButton.SetBounds(ScaleX(460), ScaleY(372), ScaleX(110), ScaleY(30));
WizardForm.NextButton.SetBounds(ScaleX(460), ScaleY(372), ScaleX(110), ScaleY(30));
WizardForm.BackButton.SetBounds(ScaleX(343), ScaleY(372), ScaleX(110), ScaleY(30));
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.Color:=clMenu;

ExtractTemporaryFile('Welcome.bmp')
ExtractTemporaryFile('Finished.bmp')

BmpFile:= TBitmapImage.Create(WizardForm)
BmpFile.Stretch:= True;
BmpFile.SetBounds(ScaleX(1),ScaleY(49), ScaleX(578), ScaleY(311))
BmpFile.Parent:= WizardForm;

(*with WizardForm.DirBrowseButton do
begin
SetBounds(ScaleX(300), ScaleY(150), ScaleX(110), ScaleY(30));
Parent:=Panel1;
end;

with WizardForm.DirEdit do
begin
Width := ScaleX(252);
Left := ScaleX(15);
Parent:=Panel1;
Top := ScaleY(30);
end;

with WizardForm.GroupBrowseButton do
begin
SetBounds(ScaleX(460), ScaleY(372), ScaleX(110), ScaleY(30));
Parent:=Panel1;
end;

with WizardForm.GroupEdit do
begin
Width := ScaleX(252);
Left := ScaleX(15);
Parent:=Panel1;
Top := ScaleY(30);
end;*)

// Panel
Panel1 := TPanel.Create(WizardForm);
with Panel1 do
begin
Parent := WizardForm;
Left := ScaleX(20);
Top := ScaleY(69);
Width := ScaleX(541);
Height := ScaleY(261);
end;

Panel2 := TPanel.Create(WizardForm);
with Panel2 do
begin
Parent := Panel1;
Left := ScaleX(21);
Top := ScaleY(21);
Width := ScaleX(498);
Height := ScaleY(219);
end;

// Bevel
with WizardForm.Bevel1 do
begin
Left := ScaleX(1);
Top := ScaleY(47);
Width := ScaleX(578);
Height := ScaleY(2);
Parent:=WizardForm;
end;

Bevel2 := TBevel.Create(WizardForm);
with Bevel2 do
begin
Parent := Panel1;
Left := ScaleX(10);
Top := ScaleY(11);
Width := ScaleX(520);
Height := ScaleY(240);
end;

with WizardForm.Bevel do
begin
Left := ScaleX(1);
Top := ScaleY(361);
Width := ScaleX(578);
Height := ScaleY(2);
Parent:=WizardForm;
end;

DirBevel := TBevel.Create(WizardForm);
with DirBevel do
begin
Parent := Panel1;
Left := ScaleX(22);
Top := ScaleY(25);
Width := ScaleX(496);
Height := ScaleY(62);
Style := bsRaised;
end;

GroupBevel := TBevel.Create(WizardForm);
with GroupBevel do
begin
Parent := Panel1;
Left := ScaleX(22);
Top := ScaleY(100);
Width := ScaleX(496);
Height := ScaleY(62);
Style := bsRaised;
end;

DriveBevel := TBevel.Create(WizardForm);
with DriveBevel do
begin
Parent := Panel1;
Left := ScaleX(22);
Top := ScaleY(177);
Width := ScaleX(496);
Height := ScaleY(62);
Style := bsRaised;
end;

with WizardForm.DirBrowseButton do
begin
SetBounds(ScaleX(395), ScaleY(37), ScaleX(110), ScaleY(30));
Parent:=Panel1;
end;

with WizardForm.DirEdit do
begin
Left := ScaleX(43);
Top := ScaleY(42);
Width := ScaleX(330);
Height := ScaleY(25);
Parent:=Panel1;
end;

with WizardForm.GroupBrowseButton do
begin
SetBounds(ScaleX(395), ScaleY(115), ScaleX(110), ScaleY(30));
Parent:=Panel1;
end;

with WizardForm.GroupEdit do
begin
Left := ScaleX(43);
Top := ScaleY(120);
Width := ScaleX(330);
Height := ScaleY(25);
Parent:=Panel1;
end;

// Label
TotalSpaceLabel:= TLabel.Create(WizardForm);
TotalSpaceLabel.AutoSize:= False;
TotalSpaceLabel.SetBounds(40, 195, 200, 20);
TotalSpaceLabel.Parent:= Panel1;

FreeSpaceLabel:= TLabel.Create(WizardForm);
FreeSpaceLabel.AutoSize:= False;
FreeSpaceLabel.SetBounds(40, 215, 200, 20);
FreeSpaceLabel.Parent:= Panel1;

InstallSpacelabel:= TLabel.Create(WizardForm);
InstallSpacelabel.AutoSize:= False;
InstallSpacelabel.SetBounds(270, 195, 200, 20);
InstallSpacelabel.Parent:= Panel1;

NeedSpaceLabel:= TLabel.Create(WizardForm);
NeedSpaceLabel.AutoSize:= False;
NeedSpaceLabel.SetBounds(270, 215, 200, 20);
NeedSpaceLabel.Parent:= Panel1;

WizardForm.DirEdit.OnChange:=@DirEditOnChange;

StatusLabel1:= TLabel.Create(WizardForm);
with StatusLabel1 do
begin
AutoSize:=False;
SetBounds(ScaleX(20), ScaleY(5), ScaleX(578), ScaleY(20));
WordWrap:=True;
Transparent:=True;
Font.Name:='Tahoma';
Font.Size:= 10;
Font.Style:=[fsBold];
Parent:=WizardForm;
end;

StatusLabel2:= TLabel.Create(WizardForm);
with StatusLabel2 do
begin
AutoSize:=False;
SetBounds(ScaleX(32), ScaleY(25), ScaleX(578), ScaleY(20));
WordWrap:=True;
Transparent:=True;
Font.Name:='Tahoma';
Font.Size:= 8;
Parent:=WizardForm;
end;

StatusLabel3:= TLabel.Create(WizardForm);
with StatusLabel3 do
begin
//AutoSize:=False;
SetBounds(ScaleX(43), ScaleY(18), ScaleX(496), ScaleY(20));
//WordWrap:=True;
//Transparent:=True;
Font.Name:='Tahoma';
Font.Size:= 10;
//Font.Style:=[fsBold];
Parent:=Panel1;
end;

StatusLabel4:= TLabel.Create(WizardForm);
with StatusLabel4 do
begin
//AutoSize:=False;
SetBounds(ScaleX(43), ScaleY(92), ScaleX(496), ScaleY(20));
//WordWrap:=True;
//Transparent:=True;
Font.Name:='Tahoma';
Font.Size:= 10;
Parent:=Panel1;
end;

StatusLabel5:= TLabel.Create(WizardForm);
with StatusLabel5 do
begin
//AutoSize:=False;
SetBounds(ScaleX(43), ScaleY(170), ScaleX(496), ScaleY(20));
//WordWrap:=True;
//Transparent:=True;
Font.Name:='Tahoma';
Font.Size:= 10;
//Font.Style:=[fsBold];
Parent:=Panel1;
end;

StatusLabel6:= TLabel.Create(WizardForm);
with StatusLabel6 do
begin
//AutoSize:=False;
SetBounds(ScaleX(32), ScaleY(280), ScaleX(578), ScaleY(20));
//WordWrap:=True;
//Transparent:=True;
//Font.Name:='Tahoma';
//Font.Size:= 8;
Parent:=Panel1;
end;
end;

procedure ShowComponents(CurPageID: Integer);
begin
Panel1.Show;
Panel2.Show;
BmpFile.Hide;
StatusLabel3.Hide;
StatusLabel4.Hide;
StatusLabel5.Hide;
StatusLabel6.Hide;
Case CurPageID of
wpWelcome:
begin
StatusLabel1.Caption:= ExpandConstant('{cm:Welcome1}')
StatusLabel2.Caption:= ExpandConstant('{cm:Welcome2}')
WizardForm.NextButton.Caption := 'Äàëåå »';
Panel1.Hide;
BmpFile.Show;
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Welcome.bmp'))
end;
wpSelectDir:
begin
DirEditOnChange(nil)
Panel2.Hide;
StatusLabel3.Show;
StatusLabel4.Show;
StatusLabel5.Show;
StatusLabel6.Show;
StatusLabel1.Caption:= ExpandConstant('{cm:Select1}')
StatusLabel2.Caption:= ExpandConstant('{cm:Select2}')
StatusLabel3.Caption:= ExpandConstant('{cm:Select3}')
StatusLabel4.Caption:= ExpandConstant('{cm:Select4}')
StatusLabel5.Caption:= ExpandConstant('{cm:Select5}')
StatusLabel6.Caption:= ExpandConstant('{cm:Select6}')
WizardForm.NextButton.Caption := 'Äàëåå »';
WizardForm.BackButton.Caption := '« Íàçàä';
end;
wpSelectComponents:
begin
WizardForm.NextButton.Caption := 'Äàëåå »';
WizardForm.BackButton.Caption := '« Íàçàä';
end;
wpSelectProgramGroup:
begin
WizardForm.NextButton.Caption := 'Äàëåå »';
WizardForm.BackButton.Caption := '« Íàçàä';
end;
wpSelectTasks:
begin
WizardForm.NextButton.Caption := 'Äàëåå »';
WizardForm.BackButton.Caption := '« Íàçàä';
end;
wpReady:
begin
WizardForm.NextButton.Caption:= 'Óñòàíîâèòü';
WizardForm.BackButton.Caption := '« Íàçàä';
end;
wpInstalling:
begin

end;
wpFinished:
begin
Panel1.Hide;
BmpFile.Show;
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Finished.bmp'))
end;
end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
ShowComponents(CurPageID);
end;
 
Последнее редактирование модератором:
Shift85, а вот что за прикол косить под наш инсталлятор?
 
Человек хочет делать репуки и выкладывать под вашей группой :))
 
vint56, Правильно или нет проверь пожалуйста у меня тут скрытие и показ компонентов...

procedure ShowComponents(CurPageID: Integer);
begin
Panel1.Show;
Panel2.Show;
BmpFile.Hide;
StatusLabel3.Hide;
StatusLabel4.Hide;
StatusLabel5.Hide;
StatusLabel6.Hide;
WizardForm.DirBrowseButton.Hide;
WizardForm.DirEdit.Hide;
WizardForm.GroupBrowseButton.Hide;
WizardForm.GroupEdit.Hide;
TotalSpaceLabel.Hide;
FreeSpaceLabel.Hide;
InstallSpacelabel.Hide;
NeedSpaceLabel.Hide;
WizardForm.ProgressGauge.Hide;
Case CurPageID of
wpWelcome:
begin
StatusLabel1.Caption:= ExpandConstant('{cm:Welcome1}')
StatusLabel2.Caption:= ExpandConstant('{cm:Welcome2}')
WizardForm.NextButton.Caption := 'Äàëåå »';
Panel1.Hide;
BmpFile.Show;
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Welcome.bmp'))
end;
wpSelectDir:
begin
DirEditOnChange(nil)
Panel2.Hide;
StatusLabel3.Show;
StatusLabel4.Show;
StatusLabel5.Show;
StatusLabel6.Show;
WizardForm.DirBrowseButton.Show;
WizardForm.DirEdit.Show;
WizardForm.GroupBrowseButton.Show;
WizardForm.GroupEdit.Show;
TotalSpaceLabel.Show;
FreeSpaceLabel.Show;
InstallSpacelabel.Show;
NeedSpaceLabel.Show;
WizardForm.ComponentsList.Hide;
WizardForm.ReadyMemo.Hide;
StatusLabel1.Caption:= ExpandConstant('{cm:Select1}')
StatusLabel2.Caption:= ExpandConstant('{cm:Select2}')
StatusLabel3.Caption:= ExpandConstant('{cm:Select3}')
StatusLabel4.Caption:= ExpandConstant('{cm:Select4}')
StatusLabel5.Caption:= ExpandConstant('{cm:Select5}')
StatusLabel6.Caption:= ExpandConstant('{cm:Select6}')
WizardForm.NextButton.Caption := 'Äàëåå »';
WizardForm.BackButton.Caption := '« Íàçàä';
end;
wpSelectComponents:
begin
WizardForm.ComponentsList.Show;
WizardForm.ReadyMemo.Hide;
StatusLabel6.Show;
StatusLabel1.Caption:= ExpandConstant('{cm:Select7}')
StatusLabel2.Caption:= ExpandConstant('{cm:Select8}')
StatusLabel6.Caption:= ExpandConstant('{cm:Select9}')
WizardForm.NextButton.Caption := 'Äàëåå »';
WizardForm.BackButton.Caption := '« Íàçàä';
end;
wpReady:
begin
WizardForm.ComponentsList.Hide;
WizardForm.ReadyMemo.Show;
StatusLabel6.Show;
StatusLabel1.Caption:= ExpandConstant('{cm:Select10}')
StatusLabel2.Caption:= ExpandConstant('{cm:Select11}')
StatusLabel6.Caption:= ExpandConstant('{cm:Select12}')
WizardForm.NextButton.Caption:= 'Óñòàíîâèòü';
WizardForm.BackButton.Caption := '« Íàçàä';
end;
wpInstalling:
begin
WizardForm.TasksList.Hide;
WizardForm.ReadyMemo.Hide;
StatusLabel6.Hide;
StatusLabel1.Caption:= ExpandConstant('{cm:Select13}')
StatusLabel2.Caption:= ExpandConstant('{cm:Select14}')
WizardForm.ProgressGauge.Show;
end;
wpFinished:
begin
Panel1.Hide;
BmpFile.Show;
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Finished.bmp'))
StatusLabel1.Caption:= ExpandConstant('{cm:Select15}')
StatusLabel2.Caption:= ExpandConstant('{cm:Select16}')
end;
end;
end;
 
Shift85 так вроде правильно сам посмотри чтобы элементы не поазывались там где не должно
 
Как сменить язык кнопкой если нетрудно покажите пожалуйста пример
 
Shift85, всё таки планомерно и невзирая ни на что делаешь закос на наш инсталл? Ну-ну.
[SOURCE="inno"][setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}
ShowLanguageDialog=auto

[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
Name: eng; MessagesFile: compiler:Default.isl

[CustomMessages]
; Русский
rusButtonBack=< &Назад
rusButtonNext=&Далее >
rusButtonCancel=Отмена
rusSetupWindowTitle=Установка — %1
rusWelcomeLabel1=Вас приветствует Мастер установки %1
rusWelcomeLabel2=Программа установит %1, версия %2 на Ваш компьютер.%n%nРекомендуется закрыть все прочие приложения перед тем, как продолжить.%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки.

; English
engButtonBack=< &Back
engButtonNext=&Next >
engButtonCancel=Cancel
engSetupWindowTitle=Setup — %1
engWelcomeLabel1=Welcome to the %1 Setup Wizard
engWelcomeLabel2=This will install %1 version %2 on your computer.%n%nIt is recommended that you close all other applications before continuing.%n%nClick Next to continue, or Cancel to exit Setup.

[ Code]
var
lang: String;
langBtn: TButton;

procedure ChangeLang();
begin
WizardForm.BackButton.Caption:= CustomMessage(lang+'ButtonBack');
WizardForm.NextButton.Caption:= CustomMessage(lang+'ButtonNext');
WizardForm.CancelButton.Caption:= CustomMessage(lang+'ButtonCancel');
WizardForm.Caption:= FmtMessage(CustomMessage(lang+'SetupWindowTitle'), ['{#SetupSetting('AppName')}']);
WizardForm.WelcomeLabel1.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel1'), ['{#SetupSetting('AppName')}']);
WizardForm.WelcomeLabel2.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel2'), ['{#SetupSetting('AppName')}', '{#SetupSetting('AppVersion')}']);
end;

procedure LangBtnClick(Sender: TObject);
begin
if lang='rus' then begin
lang:= 'eng';
langBtn.Caption:= 'рус';
end else begin
lang:= 'rus';
langBtn.Caption:= 'eng';
end;
ChangeLang();
end;

procedure InitializeWizard;
begin
langBtn:= TButton.Create(WizardForm);
with langBtn do begin
SetBounds(10,WizardForm.CancelButton.Top,30,WizardForm.CancelButton.Height)
OnClick:= @LangBtnClick;
Parent:= WizardForm;
end;

if ActiveLanguage='rus' then begin
lang:= 'rus';
langBtn.Caption:= 'eng';
end else begin
lang:= 'eng';
langBtn.Caption:= 'рус';
end;
end;[/SOURCE]
Переключение языка так, как реализовано у нас - не для паблика. Если что, то к автору - [USER]Shegorat[/USER]'у.
 
Пожалуйста покажите пример наложения кнопок с функциями через ботву в примерах непонял что к чему заранее благодарю.
 
Лёха, помню это можно исправить поставив то ли анси версию инно,то ли юникод,попробуй,так же можно кодом каким-то это поправить,но проще переставить инно на другую версию
 
vint56, Подкинь если имеется пожалуйста примерчик наложения кнопок через bmp с двумя состояниями.
Зарание спасибо.

Добавлено через 5 минут
Лёха, помню это можно исправить поставив то ли анси версию инно,то ли юникод,попробуй,так же можно кодом каким-то это поправить,но проще переставить инно на другую версию

Юникод это точно...
 
Здравствуйте
Помниться ктото кидал пример с Pause Button для is done
Если у кого осталось прошу выложите
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху