Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 3]
Добрый день! перерыл кучу информации, но так и не смог найти внятного ответа на свой вопрос: как изменить расположение кнопки "Завершить"?
помогите пожалуйста
Подскажите пожалуйста, как работать с precomp?
Если можно пример скрипта или статью
В инете нашёл только пример в библиотеке и всё(((
potan,
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
[Languages]
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl"
[_Code]
Procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
WizardForm.NextButton.Left:= WizardForm.NextButton.Left -100;
end;
nik1967,
Супер! спасибо большое!
actavir,
Можешь посмотреть тут (http://forum.ru-board.com/topic.cgi?forum=5&topic=30239&start=0).
ksunechkin, serg aka lain, такой вариант еще можно, ток вот картинка остаеться(
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
[Languages]
Name: ru; MessagesFile: compiler:Languages\Russian.isl;
[CustomMessages]
HeaderLabelPage=Выберите тип установки
MyRadioCaption_1=Обычная установка
MyRadioCaption_2=Выборочная установка
PageTextHeader=На этой странице Вы можете выбрать тип установки, который для Вас наиболее удобен.
MyText_1=Установка будет произведена полностью в автоматическом режиме.%n(Подходит для не подготовленных пользователей)
MyText_2=Будет предложен выбор директории установки.%n(Для продвинутых пользователей)
MyText_0=Наведите курсор мыши на тип установки, чтобы прочесть его описание.
[_code]
const
DI_NORMAL = 3;
var
MyNewPage: TWizardPage;
Rect: TRect;
HIcon: LongInt;
AIconFileName: String;
MyRadioBtn_1, MyRadioBtn_2: TNewRadioButton;
Text: TNewStaticText;
NoChecks: TLabel;
function GetModuleHandle(lpModuleName: LongInt): LongInt;
external 'GetModuleHandleA@kernel32.dll stdcall';
function ExtractIcon(hInst: LongInt; lpszExeFileName: AnsiString; nIconIndex: LongInt): LongInt;
external 'ExtractIconA@shell32.dll stdcall';
function DrawIconEx(hdc: LongInt; xLeft, yTop: Integer; hIcon: LongInt; cxWidth,
cyWidth: Integer; istepIfAniCur: LongInt; hbrFlickerFreeDraw, diFlags: LongInt): LongInt;
external 'DrawIconEx@user32.dll stdcall';
function DestroyIcon(hIcon: LongInt): LongInt;
external 'DestroyIcon@user32.dll stdcall';
procedure Check1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
Text.Enabled:=True
Text.Caption:=ExpandConstant('{cm:MyText_1}')
try
AIconFileName := ExpandConstant('{sys}\shell32.dll');
Rect.Left := 0;
Rect.Top := 0;
Rect.Right := 32;
Rect.Bottom := 32;
hIcon := ExtractIcon(GetModuleHandle(0), AIconFileName, 26);
try
with TBitmapImage.Create(WizardForm) do
begin
Left := ScaleX(15);
Top := ScaleY(130);
Width := 32;
Height := 32;
with Bitmap do
begin
Width := 32;
Height := 32;
Canvas.Brush.Color := clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent := MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;
except
end;
end;
procedure Check2MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
Text.Enabled:=True
Text.Caption:=ExpandConstant('{cm:MyText_2}')
try
AIconFileName := ExpandConstant('{sys}\shell32.dll');
Rect.Left := 0;
Rect.Top := 0;
Rect.Right := 32;
Rect.Bottom := 32;
hIcon := ExtractIcon(GetModuleHandle(0), AIconFileName, 19);
try
with TBitmapImage.Create(WizardForm) do
begin
Left := ScaleX(15);
Top := ScaleY(130);
Width := 32;
Height := 32;
with Bitmap do
begin
Width := 32;
Height := 32;
Canvas.Brush.Color := clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent := MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;
except
end;
end;
procedure NoChecksMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
Text.Enabled:=False
Text.Caption:=ExpandConstant('{cm:MyText_0}')
end;
procedure GetInstTypePage();
begin
MyNewPage := CreateCustomPage(wpWelcome,
ExpandConstant('{cm:HeaderLabelPage}'), '');
with TNewStaticText.Create(WizardForm) do
begin
Width := WizardForm.InnerNotebook.Width;
Height := ScaleY(26);
WordWrap := True;
Caption := ExpandConstant('{cm:PageTextHeader}');
Parent := MyNewPage.Surface;
end;
MyRadioBtn_1 := TNewRadioButton.Create(WizardForm);
with MyRadioBtn_1 do
begin
Top := ScaleY(50);
Width := ScaleX(150);
Caption := ExpandConstant('{cm:MyRadioCaption_1}');
Checked := True;
Parent := MyNewPage.Surface;
OnMouseMove:=@Check1MouseMove
end;
MyRadioBtn_2 := TNewRadioButton.Create(WizardForm);
with MyRadioBtn_2 do
begin
Top := ScaleY(70);
Width := ScaleX(150);
Caption := ExpandConstant('{cm:MyRadioCaption_2}');
Parent := MyNewPage.Surface;
OnMouseMove:=@Check2MouseMove
end;
end;
Procedure InitializeWizard();
begin
begin
GetInstTypePage();
end;
begin
Text:=TNewStaticText.Create(WizardForm)
Text.Left := ScaleX(60);
Text.Top := ScaleY(138);
Text.Width := WizardForm.InnerNotebook.Width - ScaleX(60);
Text.Height := ScaleY(26);
Text.WordWrap := True;
Text.Parent := MyNewPage.Surface;
end;
begin
NoChecks:=TLabel.Create(WizardForm)
NoChecks.Width:=WizardForm.Width
NoChecks.Height:=WizardForm.Height
NoChecks.Autosize:=False
NoChecks.Transparent:=True
NoChecks.OnMouseMove:=@NoChecksMouseMove
NoChecks.Parent:=MyNewPage.Surface
end;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID >= wpSelectDir) and (PageID < wpReady) and (MyRadioBtn_1.Checked) then
Result := True;
end;
Подскажите ещё пожалуйста как поставить картинку на фон инсталятора. Смотрел различные скрипты ничё не понял.
Я только начал разбираться в этом.
Заранее благодарен.
actavir, ты на всю страницу хочешь или обычную?
как понять на всю страницу (на весь экран) или на форму инсталятора?
>>на форму инсталятора
actavir, вот отсюда взять можно (http://www.forum.oszone.ru/post-1242285-250.html)
или вот
[Files]
Source: fon.bmp; DestDir: {tmp}; Flags: dontcopy
[_code]
var
WelcomeLabel1, WelcomeLabel2: TLabel;
BmpFile: TBitmapImage;
procedure InitializeWizard();
begin
ExtractTemporaryFile('fon.bmp');
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\fon.bmp'));
BmpFile.SetBounds(0, 0, 497, 320);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.WelcomePage;
with WizardForm do
begin
WelcomeLabel1.Hide;
WelcomeLabel2.hide;
end;
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
WelcomeLabel1.Alignment:=taCenter;
Left:= ScaleX(110);
Top:= ScaleY(50);
Width:= ScaleX(301);
Height:= ScaleY(71);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Name:='Tahoma'
Font.Size:= 14;
Font.Color:=ClGray
Parent:= WizardForm.WelcomePage;
Caption:= WizardForm.WelcomeLabel1.Caption;
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
WelcomeLabel2.Alignment:=taCenter;
Top:= ScaleY(130);
Left:= ScaleX(110);
Width:= ScaleX(280);
Height:= ScaleY(310);
AutoSize:= false;
WordWrap:= true;
Font.Name:='Tahoma'
Font.Size:= 10;
Font.Color:=ClWhite
Transparent:= true;
Parent:= WizardForm.WelcomePage;
Caption:= WizardForm.WelcomeLabel2.Caption;
end;
end;
Imitri7, а какое изображение в том коде становиться фоновым, просто я не нашёл в директории source ни одной ссылки на изображение
actavir, это вроде ток пример, не дописанный код
зы на пред. страницы код выложил, его попробуй
я лично вот этим вариантом пользуюсь
[Setup]
AppName=Mirror's Edge
AppVerName=Mirror's Edge
DefaultDirName={pf}\EA Games\Mirror's Edge
WizardImageFile=WizardImg.bmp
WizardSmallImageFile=WizardSmallImg.bmp
[_code]
var
WLabel1, WLabel2,
FLabel1, FLabel2: TLabel;
PageNameLabel, PageDescriptionLabel: TLabel;
procedure InitializeWizard();
//WizardImageFile
begin
WizardForm.Caption:='Программа установки игры "Mirrors Edge"';
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.WizardBitmapImage.Width := 497;
WizardForm.WizardBitmapImage.Height := 313;
WizardForm.WizardSmallBitmapImage.Left:=0;
WizardForm.WizardSmallBitmapImage.Width:=497;
WizardForm.WizardSmallBitmapImage.Height:=58;
WizardForm.PageDescriptionLabel.Width:=300;
WizardForm.PageNameLabel.Width:=300;
WizardForm.FileNameLabel.Visible:=False;
WizardForm.ProgressGauge.Top:=ScaleY(100);
WizardForm.StatusLabel.Top:=ScaleY(80);
WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(176);
WLabel1.Top := ScaleY(16);
WLabel1.Width := ScaleX(301);
WLabel1.Height := ScaleY(54);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Font.Size := 11;
WLabel1.Font.Style := [fsBold];
WLabel1.Font.Color:= clBlack;
WLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;
WLabel2 :=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(76);
WLabel2.Left := ScaleX(176);
WLabel2.Width := ScaleX(301);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Font.Color:= clBlack;
WLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;
WizardForm.WizardBitmapImage2.Width := 497;
WizardForm.WizardBitmapImage2.Height := 313;
FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(176);
FLabel1.Top := ScaleY(16);
FLabel1.Width := ScaleX(301);
FLabel1.Height := ScaleY(54);
FLabel1.AutoSize := False;
FLabel1.WordWrap := True;
FLabel1.Font.Size := 11;
FLabel1.Font.Style := [fsBold];
FLabel1.Font.Color:= clBlack;
FLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(76);
FLabel2.Left := ScaleX(176);
FLabel2.Width := ScaleX(301);
FLabel2.Height := ScaleY(53);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Font.Color:= clBlack;
FLabel2.Caption := 'Программа установлена на Ваш компьютер.' #13#13
'Нажмите «Завершить», чтобы выйти из программы установки.';
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage;
begin
PageNameLabel := TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left := ScaleX(10);
Top := ScaleY(10);
Width := ScaleX(300);
Height := ScaleY(14);
AutoSize := False;
WordWrap := True;
Font.Color := clBlack;
Font.Style := [fsBold];
Transparent := True;
Parent := WizardForm.MainPanel;
end;
PageDescriptionLabel := TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left := ScaleX(15);
Top := ScaleY(25);
Width := ScaleX(400);
Height := ScaleY(30);
AutoSize := False;
WordWrap := True;
Font.Color := clBlack;
Transparent := True;
Parent := WizardForm.MainPanel;
end;
with WizardForm do
begin
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
with MainPanel do
begin
with WizardSmallBitmapImage do
begin
Left := ScaleX(0);
Top := ScaleY(0);
Width := Mainpanel.Width;
Height := MainPanel.Height;
end;
end;
end;
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
begin
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
end;
end;
Imitri7, слушай я вот тот предыдуший скрипт взял с 29 страницы а как сделать что бы он на другие страницы пошёл?
actavir,
[Files]
Source: fon.bmp; DestDir: {tmp}; Flags: dontcopy
[_code]
var
WelcomeLabel1, WelcomeLabel2,FinishedLabel1,FinishedLabel2: TLabel;
BmpFile1,BmpFile2: TBitmapImage;
procedure InitializeWizard();
begin
ExtractTemporaryFile('fon.bmp');
BmpFile1:= TBitmapImage.Create(WizardForm);
BmpFile1.Bitmap.LoadFromFile(ExpandConstant('{tmp}\fon.bmp'));
BmpFile1.SetBounds(0, 0, 497, 320);
BmpFile1.Stretch:= true
BmpFile1.Parent:= WizardForm.WelcomePage;
with WizardForm do
begin
WelcomeLabel1.Hide;
WelcomeLabel2.hide;
end;
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
WelcomeLabel1.Alignment:=taCenter;
Left:= ScaleX(110);
Top:= ScaleY(50);
Width:= ScaleX(301);
Height:= ScaleY(71);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Name:='Tahoma'
Font.Size:= 14;
Font.Color:=ClGray
Parent:= WizardForm.WelcomePage;
Caption:= WizardForm.WelcomeLabel1.Caption;
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
WelcomeLabel2.Alignment:=taCenter;
Top:= ScaleY(130);
Left:= ScaleX(110);
Width:= ScaleX(280);
Height:= ScaleY(310);
AutoSize:= false;
WordWrap:= true;
Font.Name:='Tahoma'
Font.Size:= 10;
Font.Color:=ClWhite
Transparent:= true;
Parent:= WizardForm.WelcomePage;
Caption:= WizardForm.WelcomeLabel2.Caption;
end;
BmpFile2:= TBitmapImage.Create(WizardForm);
BmpFile2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\fon.bmp'));
BmpFile2.SetBounds(0, 0, 497, 320);
BmpFile2.Stretch:= true
BmpFile2.Parent:= WizardForm.FinishedPage;
with WizardForm do
begin
FinishedHeadingLabel.Hide;
FinishedLabel.hide;
end;
FinishedLabel1:= TLabel.Create(WizardForm);
with FinishedLabel1 do
begin
FinishedLabel1.Alignment:=taCenter;
Left:= ScaleX(110);
Top:= ScaleY(50);
Width:= ScaleX(301);
Height:= ScaleY(71);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Name:='Tahoma'
Font.Size:= 14;
Font.Color:=ClGray
Parent:= WizardForm.FinishedPage;
Caption:= WizardForm.FinishedHeadingLabel.Caption;
end;
FinishedLabel2:=TLabel.Create(WizardForm);
with FinishedLabel2 do
begin
FinishedLabel2.Alignment:=taCenter;
Top:= ScaleY(130);
Left:= ScaleX(110);
Width:= ScaleX(280);
Height:= ScaleY(310);
AutoSize:= false;
WordWrap:= true;
Font.Name:='Tahoma'
Font.Size:= 10;
Font.Color:=ClWhite
Transparent:= true;
Parent:= WizardForm.FinishedPage;
Caption:= WizardForm.FinishedLabel.Caption;
end;
end;
Этот код даёт я так понял только на первую и на последнюю страницы??
А как сделать на все?
Я зделал так чтоб у меня распаковывало RAR архивы в inno setup но там надо выбирать директорию рапаковки а мне етого ненадо так как в инсталяторе от инно ето есть! как мне сделать чтоб RAR архиватор не запрашивал директорию распаковки?
но в XP бегунка нет »
У меня XP SP3, всё прекрасно отображается...
И привязать его к секции Run »
; используем прогрессбар без отображения реального процента,
; удобно при установке доп. программ, когда их время установки заранее не известна
[Setup]
AppName=ProgressBarStyle
AppVerName=ProgressBarStyle v 1.0
DefaultDirName={pf}\ProgressBarStyle
OutputDir=.
Compression=lzma/ultra64
InternalCompressLevel=ultra64
SolidCompression=yes
VersionInfoCopyright=Serega
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[Files]
Source: compiler:Examples\MyProg.exe; DestDir: {app}; Flags: ignoreversion
[Run]
; при первом и последующем запуске доп. программ, используем - BeforeInstall: AnimatePbMsg('Ваше сообщение')
; при последнем запуске, добавляем - AfterInstall: AnimatePbFree - необходимо для освобождения ресурсов и разрушения прогрессбара
Filename: {app}\MyProg.exe; BeforeInstall: AnimatePbMsg('Первый запуск MyProg.exe'); Flags: skipifsilent
Filename: {app}\MyProg.exe; BeforeInstall: AnimatePbMsg('Тестовый запуск MyProg.exe №2'); Flags: skipifsilent
Filename: {app}\MyProg.exe; BeforeInstall: AnimatePbMsg('Финальный запуск MyProg.exe'); AfterInstall: AnimatePbFree; Flags: skipifsilent
[Code]
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall';
const
PBM_SETMARQUEE = $040A;
GWL_STYLE = -16;
PBS_MARQUEE = $08;
var
AnimatePb: TNewProgressBar;
procedure CreateAnimatePb;
begin
AnimatePb := TNewProgressBar.Create(WizardForm);
with AnimatePb do
begin
Parent := WizardForm.InstallingPage;
SetBounds(WizardForm.ProgressGauge.Left, WizardForm.ProgressGauge.Top + WizardForm.ProgressGauge.Height + ScaleY(10),
WizardForm.ProgressGauge.Width, WizardForm.ProgressGauge.Height);
SetWindowLong (AnimatePb.Handle, GWL_STYLE, (GetWindowLong (AnimatePb.Handle, GWL_STYLE) or PBS_MARQUEE));
SendMessage(AnimatePb.Handle, PBM_SETMARQUEE, 1, 20);
end;
end;
procedure AnimatePbMsg(const msg: string);
begin
if AnimatePb = nil then
CreateAnimatePb;
WizardForm.FilenameLabel.Caption := msg;
end;
procedure AnimatePbFree;
begin
if AnimatePb <> nil then
begin
AnimatePb.Free;
AnimatePb := nil;
end;
end;
А как сделать на все? »
по аналогии
:help: :cool: :drug: ХЕЛП МИ !!!!!!
Vamp1re, Вы по русски объясните, что конкретно вам надо? При чём тут архиватор?
Если нужна распаковка самораспаковывающегося rar архива, то смотрите справку по командной строке rar и уже с этими параметрами, запускаете свой архив.
Подскажите, у меня конфликтуют процедуры InitializeWizard, так получилось что их 2 штуки в коде, что делать?
Одна на извлечении фриарка а вторая на фоновом изображении.
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.