Войти

Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 3]


Страниц : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 [42] 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188

actavir
21-02-2011, 16:56
nik1967, спасибо огромное разобрался наконец то)))
А ещё вопрос почему при отмене, не происходит деинсталляция??? Как исправить?

nik1967
21-02-2011, 17:05
Vista-w,
На сколько я знаю (может и не прав), дефолтный SelectDirPage: TNewNotebookPage не изменить, не передвинуть нельзя. Только если скрыть, и нарисовать новый.

Vista-w
21-02-2011, 17:08
my-94,
Вот бери http://rghost.ru/4473090

nik1967,
Вот это попа(((

my-94
21-02-2011, 19:54
Vista-w


Спасибо

Vista-w
21-02-2011, 20:40
my-94,
н.з)

serg aka lain
21-02-2011, 20:46
решить проблему? »


[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
OutputDir=userdocs:InnoSetupTest.

[Code]
procedure InitializeWizard();
begin
with WizardForm do
begin
ClientWidth := ClientWidth + ScaleX(100);
OuterNotebook.Width := ClientWidth;
InnerNotebook.Left := ClientWidth div 2 - InnerNotebook.Width div 2;
end;
end;

Gnom_aka_Lexander
21-02-2011, 21:12
nik1967,
Ты прав, но есть выход :)
Vista-w,
procedure InitializeWizard();
begin
with WizardForm.InnerPage do
begin
Enabled := False;
end;
end;
Проверено, помогает :)
serg aka lain, Там как раз этим InnerPage перекрывает, а нотебуки уже увеличины до нужных размеров.

Gnom_aka_Lexander
21-02-2011, 21:53
Enabled := False; »
Оказалось слишком круто :) достаточно
Visible := False; На полном отключении перестают работать обзоры и чекбоксы :sorry:

nik1967
21-02-2011, 22:53
Vista-w,
Руководствуясь данными serg aka lain, получилось что то типа
[Setup]
AppName=Name
AppVerName=Name
DefaultDirName={pf}\Name

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

[_Code]
procedure InitializeWizard();
var
L: Integer;
begin
with WizardForm do begin
L:=ScaleX(50); // На сколько надо увеличить длину инсталла
ClientWidth := ClientWidth + L;
OuterNotebook.Width := ClientWidth;
InnerNotebook.Left := ClientWidth div 2 - InnerNotebook.Width div 2;
Bevel.Width:= ClientWidth;
Bevel1.Width:= ClientWidth;
MainPanel.Width:= ClientWidth;
with WelcomeLabel1 do
Left:= WelcomeLabel1.Left + L;
with WelcomeLabel2 do
Left:= WelcomeLabel2.Left + L;
with FinishedLabel do
Left:= FinishedLabel.Left + L;
with FinishedHeadingLabel do
Left:= FinishedHeadingLabel.Left + L;
with WizardSmallBitmapImage do
Left:= WizardSmallBitmapImage.Left + L;
end;
end;

procedure InitializeUninstallProgressForm;
var
L: Integer;
begin
with UninstallProgressForm do begin
L:=ScaleX(50); // На сколько надо увеличить длину инсталла
ClientWidth := ClientWidth + L;
OuterNotebook.Width := ClientWidth;
InnerNotebook.Left := ClientWidth div 2 - InnerNotebook.Width div 2;
Bevel.Width:= ClientWidth;
Bevel1.Width:= ClientWidth;
MainPanel.Width:= ClientWidth;
with WizardSmallBitmapImage do
Left:= WizardSmallBitmapImage.Left + L;
end;
end;

Gnom_aka_Lexander
21-02-2011, 23:29
nik1967, С этим разобрались :) код скрытия иннерпейджа отлично помог, сейчас другая заморочка, может поможеш, а то у меня мозг кипит? Сейчас сам объяснит, чего у нас не получается.
Вот, может пригодится, увеличение окна инсталлятора, без дополнительных модулей и перерисовки компонентов страницы, заодно объединил пару страниц :)
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
;// отключение ненужных страниц
DisableProgramGroupPage=true
[_Code]
procedure InitializeWizard();
begin
with WizardForm do
begin
AutoScroll := False;
ClientHeight := ScaleY(380);
ClientWidth := ScaleX(600);
end;

with WizardForm.Bevel do
begin
Left := ScaleX(1);
Top := ScaleY(334);
Width := ScaleX(600);
end;

with WizardForm.CancelButton do
begin
Left := ScaleX(508);
Top := ScaleY(343);
end;

with WizardForm.NextButton do
begin
Left := ScaleX(423);
Top := ScaleY(343);
end;

with WizardForm.BackButton do
begin
Left := ScaleX(348);
Top := ScaleY(343);
end;

with WizardForm.OuterNotebook do
begin
Width := ScaleX(601);
Height := ScaleY(336);
end;

with WizardForm.WizardBitmapImage do
begin
Width := ScaleX(200);
Height := ScaleY(340);
end;

with WizardForm.WelcomeLabel2 do
begin
Left := ScaleX(256);
end;

with WizardForm.WelcomeLabel1 do
begin
Left := ScaleX(256);
end;

with WizardForm.Bevel1 do
begin
Width := ScaleX(603);
Height := ScaleY(0);
end;

with WizardForm.InnerNotebook do
begin
Top := ScaleY(70);
Width := ScaleX(520);
Height := ScaleY(260);
end;

with WizardForm.LicenseNotAcceptedRadio do
begin
Left := ScaleX(16);
Top := ScaleY(240);
end;

with WizardForm.LicenseAcceptedRadio do
begin
Left := ScaleX(16);
Top := ScaleY(220);
end;

with WizardForm.LicenseMemo do
begin
Width := ScaleX(521);
Height := ScaleY(180);
end;

with WizardForm.PasswordEdit do
begin
Left := ScaleX(56);
end;

with WizardForm.PasswordEditLabel do
begin
Left := ScaleX(56);
end;

with WizardForm.PasswordLabel do
begin
Left := ScaleX(56);
end;

with WizardForm.InfoBeforeMemo do
begin
Width := ScaleX(521);
Height := ScaleY(221);
end;

with WizardForm.UserInfoSerialEdit do
begin
Left := ScaleX(56);
Top := ScaleY(224);
Parent := WizardForm.PasswordPage;
end;

with WizardForm.UserInfoSerialLabel do
begin
Parent := WizardForm.PasswordPage;
Left := ScaleX(56);
Top := ScaleY(208);
end;

with WizardForm.UserInfoOrgEdit do
begin
Left := ScaleX(56);
Top := ScaleY(172);
Parent := WizardForm.PasswordPage;
end;

with WizardForm.UserInfoOrgLabel do
begin
Parent := WizardForm.PasswordPage;
Left := ScaleX(56);
Top := ScaleY(156);
end;

with WizardForm.UserInfoNameEdit do
begin
Left := ScaleX(56);
Top := ScaleY(120);
Parent := WizardForm.PasswordPage;
end;

with WizardForm.UserInfoNameLabel do
begin
Parent := WizardForm.PasswordPage;
Left := ScaleX(56);
Top := ScaleY(104);
end;

WizardForm.UserInfoSerialEdit.TabOrder := 0;
WizardForm.UserInfoSerialLabel.TabOrder := 1;
WizardForm.UserInfoOrgEdit.TabOrder := 2;
WizardForm.UserInfoOrgLabel.TabOrder := 3;
WizardForm.UserInfoNameEdit.TabOrder := 4;
WizardForm.UserInfoNameLabel.TabOrder := 5;

with WizardForm.SelectDirBitmapImage do
begin
Left := ScaleX(48);
end;

with WizardForm.DiskSpaceLabel do
begin
Left := ScaleX(48);
Top := ScaleY(112);
end;

with WizardForm.DirBrowseButton do
begin
Left := ScaleX(390);
Top := ScaleY(76);
end;

with WizardForm.DirEdit do
begin
Left := ScaleX(48);
Top := ScaleY(76);
end;

with WizardForm.SelectDirBrowseLabel do
begin
Left := ScaleX(48);
end;

with WizardForm.SelectDirLabel do
begin
Left := ScaleX(92);
end;

with WizardForm.ComponentsDiskSpaceLabel do
begin
Left := ScaleX(8);
Top := ScaleY(232);
end;

with WizardForm.ComponentsList do
begin
Width := ScaleX(521);
Height := ScaleY(168);
end;

with WizardForm.TypesCombo do
begin
Left := ScaleX(48);
end;

with WizardForm.SelectComponentsLabel do
begin
Left := ScaleX(48);
end;

with WizardForm.SelectGroupBitmapImage do
begin
Left := ScaleX(48);
Top := ScaleY(135);
Parent := WizardForm.SelectDirPage;
end;

with WizardForm.NoIconsCheck do
begin
Left := ScaleX(48);
Top := ScaleY(231);
Parent := WizardForm.SelectDirPage;
end;

with WizardForm.GroupBrowseButton do
begin
Left := ScaleX(390);
Top := ScaleY(204);
Parent := WizardForm.SelectDirPage;
end;

with WizardForm.GroupEdit do
begin
Left := ScaleX(48);
Top := ScaleY(204);
Parent := WizardForm.SelectDirPage;
end;

with WizardForm.SelectStartMenuFolderBrowseLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(48);
Top := ScaleY(180);
end;

with WizardForm.SelectStartMenuFolderLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(92);
Top := ScaleY(145);
end;

WizardForm.NoIconsCheck.TabOrder := 0;
WizardForm.GroupBrowseButton.TabOrder := 1;
WizardForm.GroupEdit.TabOrder := 2;
WizardForm.SelectStartMenuFolderBrowseLabel.TabOrder := 3;
WizardForm.SelectStartMenuFolderLabel.TabOrder := 4;

with WizardForm.TasksList do
begin
Left := ScaleX(64);
Height := ScaleY(224);
end;

with WizardForm.SelectTasksLabel do
begin
Left := ScaleX(56);
end;

with WizardForm.ReadyMemo do
begin
Width := ScaleX(521);
Height := ScaleY(237);
end;

with WizardForm.ReadyLabel do
begin
Left := ScaleX(40);
end;

with WizardForm.PreparingErrorBitmapImage do
begin
Left := ScaleX(48);
Top := ScaleY(56);
end;

with WizardForm.PreparingLabel do
begin
Left := ScaleX(72);
Top := ScaleY(56);
end;

with WizardForm.PreparingYesRadio do
begin
Left := ScaleX(72);
Top := ScaleY(161);
end;

with WizardForm.PreparingNoRadio do
begin
Left := ScaleX(72);
Top := ScaleY(183);
end;

with WizardForm.FilenameLabel do
begin
Top := ScaleY(136);
end;

with WizardForm.StatusLabel do
begin
Top := ScaleY(120);
end;

with WizardForm.ProgressGauge do
begin
Top := ScaleY(162);
Width := ScaleX(521);
Height := ScaleY(29);
end;

with WizardForm.InfoAfterMemo do
begin
Width := ScaleX(521);
Height := ScaleY(237);
end;

with WizardForm.MainPanel do
begin
Width := ScaleX(603);
end;

with WizardForm.WizardSmallBitmapImage do
begin
Left := ScaleX(544);
Top := ScaleY(0);
end;

with WizardForm.WizardBitmapImage2 do
begin
Width := ScaleX(200);
Height := ScaleY(340);
end;

with WizardForm.RunList do
begin
Left := ScaleX(264);
end;

with WizardForm.NoRadio do
begin
Left := ScaleX(264);
Top := ScaleY(180);
end;

with WizardForm.YesRadio do
begin
Left := ScaleX(264);
Top := ScaleY(158);
end;

with WizardForm.FinishedLabel do
begin
Left := ScaleX(264);
Top := ScaleY(79);
end;

with WizardForm.FinishedHeadingLabel do
begin
Left := ScaleX(264);
Top := ScaleY(24);
end;

with WizardForm.BeveledLabel do
begin
Top := ScaleY(330);
end;
end;
Код длинноват, потому что под новые размеры все подгонял - передвигал, может есть способ его оптимизировать :)
Да, и еще, на расширенной версии 541 иннерпейдж ни скрывать, ни отключать не требуется, она не мешает - видимо автоматом раздвигается :)

my-94
22-02-2011, 09:25
Кто не то может помочь хочу чтобы перед установкой высвечивалась картинка

к этому скрипту надо привязать

вот это

[Code]
procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';

procedure InitializeWizard();
begin

ExtractTemporaryFile('splash.png');
ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\splash.png',1000,3000,1000,0,255,False, $FFFFFF,10);
end;

[Files]


Source: isgsg.dll; DestDir: {tmp}; Flags: dontcopy nocompression
Source: splash.png; DestDir: {tmp}; Flags: dontcopy nocompression


с помощью библиотеки isgsg.dll
и картинки splash.png которая будет отображаться
всё файлы в архиве

Gnom_aka_Lexander
22-02-2011, 10:23
my-94, Лови :)

[Setup]
AppId={{4E7C4AAA-6115-4228-B387-707B52DDCD89}
AppName=My Program
AppVerName=My Program 1.5
AppPublisher=My Company, Inc.
AppPublisherURL=http://www.example.com/
AppSupportURL=http://www.example.com/
AppUpdatesURL=http://www.example.com/
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup
Compression=lzma
SolidCompression=no
disablereadypage=true


[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Files]
Source: Office2007.cjstyles; DestDir: {tmp}; Flags: dontcopy nocompression
Source: ISSkin.dll; DestDir: {tmp}; Flags: dontcopy nocompression
source: 1.bmp; DestDir: {tmp}; Flags: dontcopy nocompression
Source: isgsg.dll; DestDir: {tmp}; Flags: dontcopy nocompression
Source: splash.png; DestDir: {tmp}; Flags: dontcopy nocompression

[_Code]// ибрать *_* перед [
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';

procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';

function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('Office2007.cjstyles');
LoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), '');
Result := True;
end;

procedure DeinitializeSetup();
begin
UnloadSkin();
end;

procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox('Это демо версия программы.', mbInformation, mb_Ok);
end;

procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin

end;

procedure InitializeWizard();
var
AboutButton, CancelButton: TButton;
URLLabel: TNewStaticText;
BackgroundBitmapImage: TBitmapImage;
BackgroundBitmapText: TNewStaticText;
b:string;
BmpFile: TBitmapImage;
begin
ExtractTemporaryFile('1.bmp'); //Извлекаем файл, который пойдет в окно инсталлятора
//Вставляем изображение в окно инсталлятора, для каждой страницы нужно добвлять изображение заново
ExtractTemporaryFile('splash.png');
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.SetBounds(0, 0, 497, 313);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.WelcomePage;

BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.SetBounds(0, 0, 497, 313);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.FinishedPage;

ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\splash.png',1000,3000,1000,0,255,False, $FFFFFF,10);

with WizardForm do
begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
end;
CancelButton := WizardForm.CancelButton;
AboutButton := TButton.Create(WizardForm);
AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width;
AboutButton.Top := CancelButton.Top;
AboutButton.Width := CancelButton.Width;
AboutButton.Height := CancelButton.Height;
AboutButton.Caption := '&Repack info';
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Parent := WizardForm;

URLLabel := TNewStaticText.Create(WizardForm);

URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := WizardForm;
{ Alter Font *after* setting Parent so the correct defaults are inherited first }
URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
URLLabel.Font.Color := clBlue;
URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);

BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Left := 50;
BackgroundBitmapImage.Top := 100;
BackgroundBitmapImage.AutoSize := True;
BackgroundBitmapImage.Bitmap := WizardForm.WizardBitmapImage.Bitmap;
BackgroundBitmapImage.Parent := MainForm;

BackgroundBitmapText := TNewStaticText.Create(MainForm);
BackgroundBitmapText.Left := BackgroundBitmapImage.Left;
BackgroundBitmapText.Top := BackgroundBitmapImage.Top + BackgroundBitmapImage.Height + ScaleY(8);
BackgroundBitmapText.Caption := 'TBitmapImage';
BackgroundBitmapText.Parent := MainForm;
end;
[Messages]
BeveledLabel=111

my-94
22-02-2011, 10:48
Лександер Лександер

ОГРОМНОЕ Спасибо!!

Лександер

Помоги если сможешь чтобы кнопка "Repack info" отображалась только на первой странице

Gnom_aka_Lexander
22-02-2011, 11:37
my-94, Я только вот так могу:

[Setup]
AppId={{4E7C4AAA-6115-4228-B387-707B52DDCD89}
AppName=My Program
AppVerName=My Program 1.5
AppPublisher=My Company, Inc.
AppPublisherURL=http://www.example.com/
AppSupportURL=http://www.example.com/
AppUpdatesURL=http://www.example.com/
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup
Compression=lzma
SolidCompression=no
disablereadypage=true


[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Files]
Source: Office2007.cjstyles; DestDir: {tmp}; Flags: dontcopy nocompression
Source: ISSkin.dll; DestDir: {tmp}; Flags: dontcopy nocompression
source: 1.bmp; DestDir: {tmp}; Flags: dontcopy nocompression
Source: isgsg.dll; DestDir: {tmp}; Flags: dontcopy nocompression
Source: splash.png; DestDir: {tmp}; Flags: dontcopy nocompression

[Code]
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';

procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';

function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('Office2007.cjstyles');
LoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), '');
Result := True;
end;

procedure DeinitializeSetup();
begin
UnloadSkin();
end;

procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox('Ýòî äåìî âåðñèÿ ïðîãðàììû.', mbInformation, mb_Ok);
end;

procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin

end;

procedure InitializeWizard();
var
AboutButton, CancelButton: TButton;
URLLabel: TNewStaticText;
BackgroundBitmapImage: TBitmapImage;
BackgroundBitmapText: TNewStaticText;
b:string;
BmpFile: TBitmapImage;
begin
ExtractTemporaryFile('1.bmp'); //Èçâëåêàåì ôàéë, êîòîðûé ïîéäåò â îêíî èíñòàëëÿòîðà
//Âñòàâëÿåì èçîáðàæåíèå â îêíî èíñòàëëÿòîðà, äëÿ êàæäîé ñòðàíèöû íóæíî äîáâëÿòü èçîáðàæåíèå çàíîâî
ExtractTemporaryFile('splash.png');
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.SetBounds(0, 0, 497, 313);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.WelcomePage;

BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.SetBounds(0, 0, 497, 313);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.FinishedPage;

ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\splash.png',1000,3000,1000,0,255,False, $FFFFFF,10);

with WizardForm do
begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
end;
CancelButton := WizardForm.CancelButton;
AboutButton := TButton.Create(WizardForm);
AboutButton.Left := 12;
AboutButton.Top := 12;
AboutButton.Width := CancelButton.Width;
AboutButton.Height := CancelButton.Height;
AboutButton.Caption := '&Repack info';
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Parent := WizardForm.WelcomePage

URLLabel := TNewStaticText.Create(WizardForm);

URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := WizardForm;
{ Alter Font *after* setting Parent so the correct defaults are inherited first }
URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
URLLabel.Font.Color := clBlue;
URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);

BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Left := 50;
BackgroundBitmapImage.Top := 100;
BackgroundBitmapImage.AutoSize := True;
BackgroundBitmapImage.Bitmap := WizardForm.WizardBitmapImage.Bitmap;
BackgroundBitmapImage.Parent := MainForm;

BackgroundBitmapText := TNewStaticText.Create(MainForm);
BackgroundBitmapText.Left := BackgroundBitmapImage.Left;
BackgroundBitmapText.Top := BackgroundBitmapImage.Top + BackgroundBitmapImage.Height + ScaleY(8);
BackgroundBitmapText.Caption := 'TBitmapImage';
BackgroundBitmapText.Parent := MainForm;
AboutButton.TabOrder := 2
end;
[Messages]
BeveledLabel=111

nik1967, может подскажет, как это поэлегантнее сделать :)

my-94
22-02-2011, 11:59
Спасибо =)

nik1967
22-02-2011, 12:02
my-94,
[Setup]
AppId={{4E7C4AAA-6115-4228-B387-707B52DDCD89}
AppName=My Program
AppVerName=My Program 1.5
AppPublisher=My Company, Inc.
AppPublisherURL=http://www.example.com/
AppSupportURL=http://www.example.com/
AppUpdatesURL=http://www.example.com/
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup
Compression=lzma
SolidCompression=no
;disablereadypage=true

[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

[Messages]
BeveledLabel=111

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Files]
Source: Office2007.cjstyles; DestDir: {tmp}; Flags: dontcopy nocompression
Source: ISSkin.dll; DestDir: {tmp}; Flags: dontcopy nocompression
source: 1.bmp; DestDir: {tmp}; Flags: dontcopy nocompression
Source: isgsg.dll; DestDir: {tmp}; Flags: dontcopy nocompression
Source: splash.png; DestDir: {tmp}; Flags: dontcopy nocompression

[_Code]
var
AboutButton, CancelButton: TButton;
URLLabel: TNewStaticText;
BackgroundBitmapImage: TBitmapImage;
BackgroundBitmapText: TNewStaticText;
b:string;
BmpFile: TBitmapImage;

procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';

procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';

function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('Office2007.cjstyles');
LoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), '');
Result := True;
end;

procedure DeinitializeSetup();
begin
UnloadSkin();
end;

procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox('Это демо версия программы.', mbInformation, mb_Ok);
end;

procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://forum.ru-board.com/topic.cgi?forum=5&topic=35848&start=40#lt', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure InitializeWizard();
begin
ExtractTemporaryFile('1.bmp'); //Извлекаем файл, который пойдет в окно инсталлятора
//Вставляем изображение в окно инсталлятора, для каждой страницы нужно добвлять изображение заново
ExtractTemporaryFile('splash.png');
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.SetBounds(0, 0, 497, 313);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.WelcomePage;

BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.SetBounds(0, 0, 497, 313);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.FinishedPage;

ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\splash.png',1000,3000,1000,0,255,False, $FFFFFF,10);

with WizardForm do
begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
end;
CancelButton := WizardForm.CancelButton;
AboutButton := TButton.Create(WizardForm);
AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width;
AboutButton.Top := CancelButton.Top;
AboutButton.Width := CancelButton.Width;
AboutButton.Height := CancelButton.Height;
AboutButton.Caption := '&Repack info';
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Parent := WizardForm;

URLLabel := TNewStaticText.Create(WizardForm);

URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := WizardForm;
{ Alter Font *after* setting Parent so the correct defaults are inherited first }
URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
URLLabel.Font.Color := clBlue;
URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
URLLabel.Caption:= 'Сайт';

BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Left := 50;
BackgroundBitmapImage.Top := 100;
BackgroundBitmapImage.AutoSize := True;
BackgroundBitmapImage.Bitmap := WizardForm.WizardBitmapImage.Bitmap;
BackgroundBitmapImage.Parent := MainForm;

BackgroundBitmapText := TNewStaticText.Create(MainForm);
BackgroundBitmapText.Left := BackgroundBitmapImage.Left;
BackgroundBitmapText.Top := BackgroundBitmapImage.Top + BackgroundBitmapImage.Height + ScaleY(8);
BackgroundBitmapText.Caption := 'TBitmapImage';
BackgroundBitmapText.Parent := MainForm;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
if CurPageID <> wpWelcome then begin
AboutButton.Hide; URLLabel.Hide end else begin
AboutButton.Show; URLLabel.Show; end;
end;

my-94
22-02-2011, 12:07
Что то вообще как стандартный стал

nik1967
22-02-2011, 12:16
my-94,
Ну дак ты тут [_Code] убери подчёркивание, что бы стало так [Code]
nik1967, может подскажет, как это поэлегантнее сделать
Неа, не подскажу. И времени нет, и думать лень :unsure:

my-94
22-02-2011, 13:25
nik1967

А можа чтобы вместо слова "сайт" была то же кнопка с переходом на сайт ?

nik1967
22-02-2011, 13:53
my-94,
[Setup]
AppId={{4E7C4AAA-6115-4228-B387-707B52DDCD89}
AppName=My Program
AppVerName=My Program 1.5
AppPublisher=My Company, Inc.
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup
Compression=lzma
SolidCompression=no
;disablereadypage=true

[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

[Messages]
BeveledLabel=111

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Files]
Source: Office2007.cjstyles; DestDir: {tmp}; Flags: dontcopy nocompression
Source: ISSkin.dll; DestDir: {tmp}; Flags: dontcopy nocompression
source: 1.bmp; DestDir: {tmp}; Flags: dontcopy nocompression
Source: isgsg.dll; DestDir: {tmp}; Flags: dontcopy nocompression
Source: splash.png; DestDir: {tmp}; Flags: dontcopy nocompression

[_Code]
var
AboutButton, CancelButton, URLButton: TButton;
BackgroundBitmapImage: TBitmapImage;
BackgroundBitmapText: TNewStaticText;
BmpFile: TBitmapImage;

procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';

procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';

function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('Office2007.cjstyles');
LoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), '');
Result := True;
end;

procedure DeinitializeSetup();
begin
UnloadSkin();
end;

procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox('Это демо версия программы.', mbInformation, mb_Ok);
end;

procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://forum.ru-board.com/topic.cgi?forum=5&topic=35848&start=40#lt', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure InitializeWizard();
begin
ExtractTemporaryFile('1.bmp'); //Извлекаем файл, который пойдет в окно инсталлятора
//Вставляем изображение в окно инсталлятора, для каждой страницы нужно добвлять изображение заново
ExtractTemporaryFile('splash.png');
BmpFile:= TBitmapImage.Create(WizardForm);
with BmpFile do begin
Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
SetBounds(ScaleX(0), ScaleY(0), ScaleX(497), ScaleY(313));
Stretch:= true;
Parent:= WizardForm.WelcomePage;
end;

BmpFile:= TBitmapImage.Create(WizardForm);
with BmpFile do begin
Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
SetBounds(ScaleX(0), ScaleY(0), ScaleX(497), ScaleY(313));
Stretch:= true;
Parent:= WizardForm.FinishedPage;
end;

ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\splash.png',1000,3000,1000,0,255,False, $FFFFFF,10);

with WizardForm do
begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
end;
CancelButton := WizardForm.CancelButton;
AboutButton := TButton.Create(WizardForm);
with AboutButton do begin
Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width;
Top := CancelButton.Top;
Width := CancelButton.Width;
Height := CancelButton.Height;
Caption := '&Repack info';
OnClick := @AboutButtonOnClick;
Parent := WizardForm;
end;

URLButton := TButton.Create(WizardForm);
with URLButton do begin
Left := AboutButton.Left + AboutButton.Width + ScaleX(10);
Top := CancelButton.Top;
Width := CancelButton.Width;
Height := CancelButton.Height;
Caption := 'Сайт';
OnClick := @URLLabelOnClick;
Parent := WizardForm;
end;

BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Left := ScaleX(50);
BackgroundBitmapImage.Top := ScaleY(100);
BackgroundBitmapImage.AutoSize := True;
BackgroundBitmapImage.Bitmap := WizardForm.WizardBitmapImage.Bitmap;
BackgroundBitmapImage.Parent := MainForm;

BackgroundBitmapText := TNewStaticText.Create(MainForm);
BackgroundBitmapText.Left := BackgroundBitmapImage.Left;
BackgroundBitmapText.Top := BackgroundBitmapImage.Top + BackgroundBitmapImage.Height + ScaleY(8);
BackgroundBitmapText.Caption := 'TBitmapImage';
BackgroundBitmapText.Parent := MainForm;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
if CurPageID <> wpWelcome then begin
AboutButton.Hide; URLButton.Hide end else begin
AboutButton.Show; URLButton.Show; end;
end;




© OSzone.net 2001-2012