Войти

Показать полную графическую версию : Скрипты 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

Rikill
15-10-2011, 14:32
insombia, вобще-то можно сделать тень текста. В самом Inno Setup. Просто надо чутка подумать (совсем чучуть), а реализация просто смешна. Создаём лейб белого цвета, на второй план чёрного. Чёрный текст ставим вправо на один пиксель от белого. Вуаля.

VASYAKRN, надо сказать "абракадабра" и сфотографироваться на фоне компа! Ещё
прислать нам свой адрес. Мы тебе на дом привезём скриптов пачку.

ntrx, ничего не давай!

sergey3695
15-10-2011, 16:04
Как создать тень для текста »
Это два лейбла, один поверх другого.

Edison007
15-10-2011, 16:27
Это два лейбла, один поверх другого. »
не обязательно ;)

Damaks
15-10-2011, 16:31
Damaks, конструкция case не начинается с begin и должна выглядеть, например, так:

case Param of
0: Result := '0';
1: Result := '1';
2: begin //несколько команд заключаем в begin-end
команда 1
команда 2 и т.д.
Result := '2';
end;
3: Result := '3';
else
Result := 'nothing'; //если Param не равен 0,1,2,3.
end;»
Нет, необходимо сделать другое.
Эти пункты (0: 1: 2: 3: и т.д.) генерирует как раз цикл for, поэтому я не знаю заранее не их количество, не их значение, в этом и сложность.

insombia
15-10-2011, 18:51
del

VASYAKRN
15-10-2011, 18:56
Devils Night, Нет типа так
http://s017.radikal.ru/i400/1110/72/e3c2fce84401.jpg

Dark_Delphin
15-10-2011, 21:32
VASYAKRN, не учат.

Подскажите пожалуйста , почему на странице компоннетов нет выбора компонентов?


http://i31.fastpic.ru/big/2011/1015/a1/89ca881d736333f3211627768f7b06a1.png

Вот скрипт
#define Components

// Навания игры ;;
#define MyAppName "Call of Duty - Black Ops"
#define AppName "Call of Duty - Black Ops"
#define CompanyName "Activision"
#define Version "1.3"
#define Publisher "Dark"
// Навания игры ;;

// Создаем запуск игры ;;
#define EXE "Chernobyl.exe"
// Создаем запуск игры ;;



// Форма инсталлятора ;;
#define FormPic "form.png"
// Форма инсталлятора ;;

// Место на диске в (МБ)
#define Size "7500"
// Место на диске в (МБ)

// ExtraDiskSpaceRequired ;;
#define NeedSize "5000000000"
// ExtraDiskSpaceRequired ;;

// Количество свободной оперативной памяти нужное для распаковки ;;
#define NeedMem 512
// Количество свободной оперативной памяти нужное для распаковки ;;

// Раскоментируем после первой установки и компилим проект заново. ;;
//#define records
// Раскоментируем после первой установки и компилим проект заново. ;;
#define precomp04
//#define precomp038
//#define unrar

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#Version}
AppPublisher={#Publisher}
DefaultDirName={pf}\{#CompanyName}\{#MyAppName}
DefaultGroupName={#Publisher}\{#MyAppName}
AllowNoIcons=yes
OutputDir=Out
OutputBaseFilename=setup
ShowLanguageDialog=no
DirExistsWarning=no
MinVersion=0,5.01
VersionInfoDescription={#MyAppName}
ShowTasksTreeLines=True
DisableReadyPage=True
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif

#include "ISS\Messages.iss"

#ifdef Components
[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
Name: text; Description: Язык субтитров; Types: full; Flags: fixed
Name: text\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 100000000
Name: text\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 200000000
Name: voice; Description: Язык озвучки; Types: full; Flags: fixed
Name: voice\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 500000000
Name: voice\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 600000000
Name: redist; Description: Дополнительное ПО; Types: full; Flags: fixed
Name: redist\VCRedist; Description: Установить библиотеки Microsoft Visual C ++ ; Flags:checkablealone;
Name: redist\DirectX; Description: Обновить Microsoft DirectX; Flags: checkablealone;
#endif



[Files]
Source: "Files\*"; Flags: dontcopy;
Source: "ISDone\*"; Flags: dontcopy;

Source: "Files\InnoCallback.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
//Source: "Files\ISSkin.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
//Source: "Files\skin.cjstyles"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;

#ifdef records
Source: "ISDone\records.inf"; DestDir: "{tmp}"; Flags: dontcopy
#endif
#ifdef precomp04
Source: "ISDone\packjpg_dll.dll"; DestDir: "{tmp}"; Flags: dontcopy
Source: "ISDone\RTconsole.exe"; DestDir: "{tmp}"; Flags: dontcopy
Source: "ISDone\precomp04.exe"; DestDir: "{tmp}"; Flags: dontcopy
#endif
#ifdef precomp038
Source: "ISDone\packjpg_dll.dll"; DestDir: "{tmp}"; Flags: dontcopy
Source: "ISDone\RTconsole.exe"; DestDir: "{tmp}"; Flags: dontcopy
Source: "ISDone\precomp038.exe"; DestDir: "{tmp}"; Flags: dontcopy
Source: "ISDone\zlib1.dll"; DestDir: "{tmp}"; Flags: dontcopy
#endif
#ifdef unrar
Source: "ISDone\Unrar.dll"; DestDir: "{tmp}"; Flags: dontcopy
#endif

[Icons]
Name: {userdesktop}\{#MyAppName}; Filename: "{app}\{#EXE}"; WorkingDir: "{app}"; Check: Desktop and not InstallRedist;
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}; IconFilename: "{app}\5.ico"; Comment: {cm:Deletegame}; Check: NoIcons and not InstallRedist;
Name: {group}\{#MyAppName}; Filename: "{app}\{#EXE}"; WorkingDir: "{app}"; Comment: {cm:Launchgame}; Check: NoIcons and not InstallRedist;

[Registry]
Root: HKLM; Subkey: "SOFTWARE\{#CompanyName}\{#MyAppName}"; ValueName: "InstallDir"; ValueType: String; ValueData: "{app}"; Flags: uninsdeletekey; Check: not InstallRedist;
Root: HKLM; Subkey: "SOFTWARE\{#CompanyName}\{#MyAppName}"; ValueName: "Language"; ValueType: String; ValueData: "rus"; Flags: uninsdeletekey; Check: not InstallRedist;
Root: HKLM; Subkey: "SOFTWARE\{#CompanyName}\{#MyAppName}"; ValueName: "execPath"; ValueType: String; ValueData: "{app}\{#EXE}"; Flags: uninsdeletekey; Check: not InstallRedist;
Root: HKLM; Subkey: "SOFTWARE\{#CompanyName}\{#MyAppName}"; ValueName: "info"; ValueType: String; ValueData: "adab76f30e304e148dd119624ee27b07"; Flags: uninsdeletekey; Check: not InstallRedist;
Root: HKLM; Subkey: "SOFTWARE\{#CompanyName}\{#MyAppName}"; ValueName: "installdir"; ValueType: String; ValueData: "{app}"; Flags: uninsdeletekey; Check: not InstallRedist;
Root: HKLM; Subkey: "SOFTWARE\{#CompanyName}\{#MyAppName}"; ValueName: "language"; ValueType: String; ValueData: "us"; Flags: uninsdeletekey; Check: not InstallRedist;

[UninstallDelete]
Type: filesandordirs; Name: "{app}"

[Code]
const
WFDiskTimerID = 1;
WFSysReqTimerID = 2;
ARTitleTimerID = 2;
BASS_ACTIVE_PAUSED = 3;
BASS_SAMPLE_LOOP = 4;

type
TPBProc = function (h:hWnd;Msg,wParam,lParam:Longint):Longint;// Для прогресс бара
TTimerProc = procedure (h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
TSystemTime = record wYear, wMonth, wDayOfWeek, wDay, wHour, wMinute, wSecond, wMilliseconds: Word; end;

var
SelectTasksPage: TWizardPage; // Создаем страницу с ДОП. ПО

Image, Workspace, TextWorkspace,
Logo, Edit, HDD: Longint;

Welcome1, Welcome2, PageNameLabel, PageDescriptionLabel,
SelectDirBrowseLabel, DirEditLabel,
SelectStartMenuFolderBrowseLabel, GroupEditLabel, NoIconsLabel,
SelectTasksLabel, DesktopLabel, DirectXLabel, Finish1, Finish2: TLabel;

NoIconsCheck, DesktopCheck, DirectXCheck: HWND;

StatusLabel, FilenameLabel: TLabel;

mp3Name: string;
MusicButton,mp3Handle: HWND;

NeedSize:Integer;
FreeMB, TotalMB: Cardinal;
NeedSpaceLabel, FreeSpaceLabel: TLabel;

/////////////////////////////////////////////////////////////////////
function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall';
function SetLayeredWindowAttributes(hwnd: hWnd; crKey: TColor; bAlpha: byte; dwFlags: DWORD): Boolean; external 'SetLayeredWindowAttributes@user32.dll stdcall';
function GetWindowLong(Wnd: HWnd; Index: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall';

//Процедура для подвижности инсталлятора
procedure LabelOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
SendMessage(WizardForm.Handle,$0112,$F012,0);
end;

function GetLocalTime(var lpSystemTime: TSystemTime): Boolean; external 'GetLocalTime@kernel32.dll stdcall';
function SystemTimeToFileTime(const lpSystemTime: TSystemTime; var lpFileTime: TFileTime): Boolean; external 'SystemTimeToFileTime@kernel32.dll stdcall';
function FileTimeToSystemTime(const lpFileTime: TFileTime; var lpSystemTime: TSystemTime): Boolean; external 'FileTimeToSystemTime@kernel32.dll stdcall';
function WrapTimerProc(callback:TTimerProc; 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 ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
// Подключаем botva2
#include "ISS\botva2.iss"
// Подключаем кнопки
#include "ISS\Button.iss"
// Подключаем музыку
#include "ISS\BASS.iss"
// Подключаем сис требования
//#include "ISS\System.iss"
// Подключаем прогресс бар(Для прогресс бара)
#include "ISS\ProgressBar.iss"
// Подключаем распаковщик ISDone
#include "ISS\ISDone.iss"
// Подключаем сам прогресс бар
#include "ISS\ProgresStep.iss"
/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
procedure InitializeWizard2;
begin


with WizardForm do begin
ComponentsDiskSpaceLabel.Hide;
SelectComponentsLabel.Hide;
//WizardForm.ComponentsList.Hide;
//WizardForm.ComponentsList.Show;
Bevel.Hide;// Убераем стандартною линию
BorderStyle:=bsNone;// Убераем заголовок(Стандартную тему)
InnerNotebook.Hide;// Убераем всё стандартное
OuterNotebook.Hide;// Убераем всё стандартное
ClientWidth:=ScaleX(606);// Размер инсталлятора(Ширина)
ClientHeight:=ScaleY(384);// Размер инсталлятора(Высота)
Color:=$282828;// Цвет всего инсталлятора
end;
with TLabel.Create(WizardForm) do begin
Parent:=WizardForm;
AutoSize:=False;
Top:=14;
Left:=-10;
Width:=WizardForm.ClientWidth
Height:=WizardForm.ClientHeight
Transparent:=True;
Alignment := taCenter;
Font.Name:= 'Comic Sans MS'
Font.Color:=$FFFFFF;
Caption:=WizardForm.Caption;
OnMouseDown:=@LabelOnMouseDown;
end;
ExtractTemporaryFile('Skin.png');
ExtractTemporaryFile('Img.jpg');
ExtractTemporaryFile('Workspace.png');
ExtractTemporaryFile('Textspace.png');
ExtractTemporaryFile('Logo.png');
ExtractTemporaryFile('Edit.png');
ExtractTemporaryFile('hard-drive.png');
ExtractTemporaryFile('CheckBox.png');

//Skin - Тема инсталлятора Skin:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Skin.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
//Image и Worspace - Картинка Инсталлятора
Image:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Img.jpg'),ScaleX(15), ScaleY(34),ScaleX(578), ScaleY(335),True,True);
Workspace:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Workspace.png'),ScaleX(15), ScaleY(34),ScaleX(578), ScaleY(335),True,True);
//TextWorckspace - Для того чтобы, текст можно было различить
TextWorkspace:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Textspace.png'),ScaleX(30), ScaleY(80),ScaleX(546), ScaleY(240),True,True);
//Logo - Инфо о создателя этой программы или RePack`a
Logo:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Logo.png'),ScaleX(35), ScaleY(345),ScaleX(171), ScaleY(13),True,True);
//Edit - полоса которая отображает путь установки
Edit:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Edit.png'),ScaleX(125), ScaleY(185),ScaleX(280),ScaleY(20),True,True);
//HDD - Просто картинка (Папка)
HDD:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\hard-drive.png'),ScaleX(60), ScaleY(147),ScaleX(60), ScaleY(60),True,True);

ImgApplyChanges(WizardForm.Handle);
SetWindowLong(WizardForm.Handle,-20,GetWindowLong(WizardForm.Handle,-20) or $80000);
SetLayeredWindowAttributes(WizardForm.Handle,$00FF00,0,1);
end;
/////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);

if FreeMB > 1024 then
FreeSpaceLabel.Caption := ExpandConstant('{cm:FreeSpace} ')+ FloatToStr(round(FreeMB/1024*100)/100) + ' Гб' else
FreeSpaceLabel.Caption := ExpandConstant('{cm:FreeSpace} ')+ IntToStr(FreeMB)+ ' Мб';

if FreeMB < NeedSize then
WizardForm.NextButton.Enabled := False else
WizardForm.NextButton.Enabled := True; end;

procedure GetNeedSpaceCaptionFlashing(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
begin
if FreeSpaceLabel.Font.Color=$FFFFFF then FreeSpaceLabel.Font.Color:=$0000FF else FreeSpaceLabel.Font.Color:=$FFFFFF;
end;

procedure GetNeedSpaceCaption;
begin
if NeedSize > 1024 then
NeedSpaceLabel.Caption := ExpandConstant('{cm:NeedSpace} ')+ FloatToStr(round(NeedSize/1024*100)/100) + ' Гб' else
NeedSpaceLabel.Caption := ExpandConstant('{cm:NeedSpace} ')+ IntToStr(NeedSize)+ ' Мб';

if (FreeMB<NeedSize) then
SetTimer(WizardForm.Handle,WFDiskTimerID,1000,WrapTimerProc(@GetNeedSpaceCaptionFlashing,4));
end;

procedure CurPageChanged3(CurPageID: Integer);
begin
if CurPageID=wpSelectDir then begin
GetNeedSpaceCaption;

if FreeMB < NeedSize then
WizardForm.NextButton.Enabled:=False
end;
end;
////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////
//Не создавать папку в меню Пуск
function InstallRedist: Boolean;
begin
if MyError then
Result:= True;
end;

function NoIcons: Boolean;
begin
Result:= BtnGetEnabled(hGroupBrowseBtn);
end;

procedure NoIconsClick(hBtn:HWND);
var
Check:boolean;
begin
sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
Check:=BtnGetChecked(hBtn);
BtnSetEnabled(hGroupBrowseBtn, not Check);
GroupEditLabel.Enabled:=not Check;
if Check then NoIconsLabel.Font.Color:=$B6B6B6 else NoIconsLabel.Font.Color:=$FFFFFF;
end;

procedure NoIconsLabelClick(Sender:TObject);
begin
BtnSetChecked(NoIconsCheck, not BtnGetChecked(NoIconsCheck));
NoIconsClick(NoIconsCheck);
end;
//=====================================

//Создать ярлык на Рабочем столе
function Desktop: Boolean;
begin
Result:= BtnGetChecked(DesktopCheck);
end;

procedure DesktopClick(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
if BtnGetChecked(hBtn) then DesktopLabel.Font.Color:=$B6B6B6 else DesktopLabel.Font.Color:=$FFFFFF;
end;

procedure DesktopLabelClick(Sender:TObject);
begin
BtnSetChecked(DesktopCheck, not BtnGetChecked(DesktopCheck));
DesktopClick(DesktopCheck);
end;
//=====================================

//Установить Microsoft DirectX
function DirectX: Boolean;
begin
Result:= BtnGetChecked(DirectXCheck);
end;

procedure DirectXClick(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Check.wav'),$0001);
if BtnGetChecked(hBtn) then DirectXLabel.Font.Color:=$B6B6B6 else DirectXLabel.Font.Color:=$FFFFFF;
end;

procedure DirectXLabelClick(Sender:TObject);
begin
BtnSetChecked(DirectXCheck, not BtnGetChecked(DirectXCheck));
DirectXClick(DirectXCheck);
end;

//=====================================
/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
procedure InitializeWizard3;
begin
PageNameLabel:=TLabel.Create(WizardForm);
with PageNameLabel do begin
AutoSize:= False;
WordWrap:= True;
SetBounds(ScaleX(45), ScaleY(90), ScaleX(400), ScaleY(50));
Transparent:=True;
Font.Name:= 'Verdana';
Font.Size:= 9;
Font.Color:=$FFFFFF;
// Font.Style:=[fsBold, fsItalic];
OnMouseDown:=@LabelOnMouseDown;
Parent:=WizardForm;
end;
PageDescriptionLabel:=TLabel.Create(WizardForm);
with PageDescriptionLabel do begin
AutoSize:= False;
WordWrap:= True;
SetBounds(ScaleX(80), ScaleY(110), ScaleX(400), ScaleY(50));
Transparent:=True;
Font.Name:= 'Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
// Font.Style:=[fsBold, fsItalic];
OnMouseDown:=@LabelOnMouseDown;
Parent:=WizardForm;
end;
///////////////////////////////
Welcome1:= TLabel.Create(WizardForm);
with Welcome1 do begin
AutoSize:=False
SetBounds(ScaleX(118), ScaleY(127), ScaleX(350), ScaleY(65));
WordWrap:=True
Alignment := taCenter;
Transparent:=True
Font.Name:='Verdana';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold]
Caption:= ExpandConstant('{cm:Welcome1}')+#13#10+('{#MyAppName}');
OnMouseDown:=@LabelOnMouseDown;
Parent:=WizardForm;
end;

Welcome2:=TLabel.Create(WizardForm);
with Welcome2 do begin
AutoSize:=False
SetBounds(ScaleX(50), ScaleY(170), ScaleX(500), ScaleY(500));
WordWrap:=True
Alignment := taCenter;
Transparent:=True
Font.Name:='Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
//Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Welcome2}');
OnMouseDown:=@LabelOnMouseDown;
Parent:=WizardForm;
end;
///////////////////////////////
SelectDirBrowseLabel := TLabel.Create(WizardForm);
with SelectDirBrowseLabel do begin
AutoSize:=False;
SetBounds(ScaleX(125), ScaleY(150), ScaleX(400), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
// Font.Style := [fsBold]//, fsItalic];
OnMouseDown:=@LabelOnMouseDown;
Caption:= WizardForm.SelectDirBrowseLabel.Caption;
Parent := WizardForm;
end;

DirEditLabel := TLabel.Create(WizardForm);
with DirEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(130), ScaleY(188), ScaleX(275), ScaleY(15));
WordWrap:= True;
ShowAccelChar := False;
Transparent:=True;
Font.Name:= 'Arial'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
OnMouseDown:=@LabelOnMouseDown;
Parent := WizardForm;
end;

NeedSize := {#Size};
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do begin
Parent := WizardForm;
AutoSize:=False;
Left := ScaleX(165);
Top := ScaleY(235);
Width := ScaleX(209);
Height := ScaleY(13);
WordWrap:= True;
Transparent:=True;
Alignment := taCenter;
Font.Name:= 'Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
//Font.Style:=[fsItalic];
OnMouseDown:=@LabelOnMouseDown;
end;

FreeSpaceLabel := TLabel.Create(WizardForm);
with FreeSpaceLabel do begin
Parent := WizardForm;
AutoSize:=False;
Left := ScaleX(165);
Top := ScaleY(213);
Width := ScaleX(209);
Height := ScaleY(13);
WordWrap:= True;
Transparent:=True;
Alignment := taCenter;
Font.Name:= 'Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
//Font.Style:=[fsItalic];
OnMouseDown:=@LabelOnMouseDown;
end;
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
WizardForm.DiskSpaceLabel.Hide;
///////////////////////////////
SelectStartMenuFolderBrowseLabel := TLabel.Create(WizardForm);
with SelectStartMenuFolderBrowseLabel do begin
AutoSize:=False;
SetBounds(ScaleX(125), ScaleY(150), ScaleX(400), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
// Font.Style := [fsBold]//, fsItalic];
OnMouseDown:=@LabelOnMouseDown;
Caption:= WizardForm.SelectStartMenuFolderBrowseLabel.Caption;
Parent := WizardForm;
end;

GroupEditLabel := TLabel.Create(WizardForm);
with GroupEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(130), ScaleY(188), ScaleX(275), ScaleY(15));
WordWrap:= True;
ShowAccelChar := False;
Transparent:=True;
Font.Name:= 'Arial'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
OnMouseDown:=@LabelOnMouseDown;
Parent := WizardForm;
end;

//Не создавать папку в меню Пуск
NoIconsCheck:=BtnCreate(WizardForm.Handle,ScaleX(122),ScaleY(213),ScaleX(20),ScaleY(20),ExpandConsta nt('{tmp}\CheckBox.png'),2,True);
BtnSetEvent(NoIconsCheck,BtnClickEventID,WrapBtnCallback(@NoIconsClick,1));
BtnSetEvent(NoIconsCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(NoIconsCheck,GetSysCursorHandle(32649));

NoIconsLabel := TLabel.Create(WizardForm);
with NoIconsLabel do begin
AutoSize:=False;
SetBounds(ScaleX(147), ScaleY(215), ScaleX(275), ScaleY(17));
OnClick:= @NoIconsLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
//Font.Style:=[fsBold, fsItalic];
Caption := WizardForm.NoIconsCheck.Caption;
Parent := WizardForm;
end;
///////////////////////////////
SelectTasksPage := CreateCustomPage(wpSelectProgramGroup, ExpandConstant('{cm:TasksName}'), ExpandConstant('{cm:TasksDescription}'));
SelectTasksLabel := TLabel.Create(WizardForm);
with SelectTasksLabel do begin
AutoSize:=False;
SetBounds(ScaleX(90), ScaleY(150), ScaleX(400), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
//Font.Style:=[fsBold, fsItalic];
Caption:= ExpandConstant('{cm:SelectTasksLabel}');
OnMouseDown:=@LabelOnMouseDown;
Parent := WizardForm;
end;

//Создать ярлык на Рабочем столе
DesktopCheck:=BtnCreate(WizardForm.Handle,ScaleX(87),ScaleY(196),ScaleX(20),ScaleY(20),ExpandConstan t('{tmp}\CheckBox.png'),2,True);
BtnSetEvent(DesktopCheck,BtnClickEventID,WrapBtnCallback(@DesktopClick,1));
BtnSetEvent(DesktopCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(DesktopCheck,GetSysCursorHandle(32649));

DesktopLabel := TLabel.Create(WizardForm);
with DesktopLabel do begin
AutoSize:=False;
SetBounds(ScaleX(112), ScaleY(198), ScaleX(400), ScaleY(20));
OnClick:= @DesktopLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
//Font.Style:=[fsBold, fsItalic];
Caption := ExpandConstant('{cm:Desktop}');
Parent := WizardForm;
end;

//Установить Microsoft DirectX
DirectXCheck:=BtnCreate(WizardForm.Handle,ScaleX(87),ScaleY(220),ScaleX(20),ScaleY(20),ExpandConstan t('{tmp}\CheckBox.png'),2,True);
BtnSetEvent(DirectXCheck,BtnClickEventID,WrapBtnCallback(@DirectXClick,1));
BtnSetEvent(DirectXCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(DirectXCheck,GetSysCursorHandle(32649));

DirectXLabel := TLabel.Create(WizardForm);
with DirectXLabel do begin
AutoSize:=False;
SetBounds(ScaleX(112), ScaleY(222), ScaleX(400), ScaleY(20));
OnClick:= @DirectXLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
//Font.Style:=[fsBold, fsItalic];
Caption := ExpandConstant('{cm:DirectX}');
Parent := WizardForm;
end;
///////////////////////////////
StatusLabel := TLabel.Create(WizardForm);
with StatusLabel do begin
AutoSize:=False;
SetBounds(ScaleX(95), ScaleY(166), ScaleX(400), ScaleY(17));
Transparent:=True;
Font.Name:= 'Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
//Font.Style:=[fsBold,fsItalic];
OnMouseDown:=@LabelOnMouseDown;
Parent := WizardForm;
end;

FilenameLabel := TLabel.Create(WizardForm);
with FilenameLabel do begin
AutoSize:=False;
SetBounds(ScaleX(0), ScaleY(0), ScaleX(0), ScaleY(0));
Transparent:=True;
Font.Name:= 'Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
//Font.Style:=[fsItalic];
OnMouseDown:=@LabelOnMouseDown;
end;
///////////////////////////////
Finish1:= TLabel.Create(WizardForm);
with Finish1 do begin
AutoSize:=False
SetBounds(ScaleX(118), ScaleY(127), ScaleX(350), ScaleY(65));
WordWrap:=True
Alignment := taCenter;
Transparent:=True
Font.Name:='Verdana';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold]
Caption:= ExpandConstant('{cm:Finish1}');
OnMouseDown:=@LabelOnMouseDown;
Parent:=WizardForm;
end;

Finish2:=TLabel.Create(WizardForm);
with Finish2 do begin
AutoSize:=False
SetBounds(ScaleX(50), ScaleY(170), ScaleX(500), ScaleY(500));
WordWrap:=True
Alignment := taCenter;
Transparent:=True
Font.Name:='Verdana';
Font.Size:= 8;
Font.Color:=$FFFFFF;
//Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Finish2}');
OnMouseDown:=@LabelOnMouseDown;
Parent:=WizardForm;
end;
end;
/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
procedure HideComponents;
begin
Welcome1.Hide;
Welcome2.Hide;

SelectDirBrowseLabel.Hide;
DirEditLabel.Hide;
NeedSpaceLabel.Hide;
FreeSpaceLabel.Hide;

SelectStartMenuFolderBrowseLabel.Hide;
GroupEditLabel.Hide;
NoIconsLabel.Hide;

SelectTasksLabel.Hide;
DesktopLabel.Hide;
DirectXLabel.Hide;

StatusLabel.Hide;
FilenameLabel.Hide;

Finish1.Hide;
Finish2.Hide;
end;

procedure ShowComponents(CurPageID: Integer);
begin
PageNameLabel.Caption:=WizardForm.PageNameLabel.Caption
PageDescriptionLabel.Caption:=WizardForm.PageDescriptionLabel.Caption
case CurPageID of
wpWelcome: begin
Welcome1.Show
Welcome2.Show
end;

wpSelectDir: begin
ImgSetVisibility(Edit,True);
ImgSetVisibility(HDD,True);
ImgSetVisibility(DirBrowse,True);
BtnSetVisibility(hDirBrowseBtn,True);
SelectDirBrowseLabel.Show
DirEditLabel.Show
NeedSpaceLabel.Show
FreeSpaceLabel.Show
end;

wpSelectProgramGroup: begin
ImgSetVisibility(Edit,True);
ImgSetVisibility(HDD,True);
ImgSetVisibility(GroupBrowse,True);
BtnSetVisibility(hGroupBrowseBtn,True);
BtnSetVisibility(NoIconsCheck,True);
SelectStartMenuFolderBrowseLabel.Show
GroupEditLabel.Show
NoIconsLabel.Show;
end;

SelectTasksPage.ID: begin
BtnSetVisibility(DesktopCheck,True);
BtnSetVisibility(DirectXCheck,True);
SelectTasksLabel.Show;
DesktopLabel.Show;
DirectXLabel.Show;
WizardForm.NextButton.Caption:=SetupMessage(msgButtonInstall);
end;

wpInstalling: begin
BtnSetVisibility(hNextBtn,False);
BtnSetVisibility(hNextBtn,True);
BtnSetEnabled(hNextBtn,false);
StatusLabel.Show;
FilenameLabel.Show;
end;

wpFinished: begin
BtnSetVisibility(CancelUnpackingBtn,False);
BtnSetVisibility(CancelUnpackingBtn,True);
BtnSetEnabled(CancelUnpackingBtn,false);

BtnSetVisibility(hNextBtn,True);
BtnSetEnabled(hNextBtn,false);

Finish1.Show;
Finish2.Show;
end;
end;
end;
/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
procedure InitializeWizard;
begin
InitializeWizard2; // Для изображения инсталлятора
CreateWizardImage; // Для изображения кнопок
InitializeWizard3; // Для надписей
ButtonsTextures; // Для кнопок
ProgresStepWizard; // Для прогресс бара
InsertMusic; // Для музыки
// SystemWizardImage; // Для сис требований
// SystemPageComponents; // Для сис требований
end;

// Для работы с botva2 и innocallback
function InitializeSetup: Boolean;
begin
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');// Botva2
if not FileExists(ExpandConstant('{tmp}\innocallback.dll')) then ExtractTemporaryFile('innocallback.dll');// innocallback
// if not FileExists(ExpandConstant('{tmp}\skin.cjstyles')) then ExtractTemporaryFile('skin.cjstyles');
if not FileExists(ExpandConstant('{tmp}\BASS.dll')) then ExtractTemporaryFile('BASS.dll');
if not FileExists(ExpandConstant('{tmp}\MusicButton.png')) then ExtractTemporaryFile('MusicButton.png');
if not FileExists(ExpandConstant('{tmp}\Music.mp3')) then ExtractTemporaryFile('Music.mp3');
// LoadSkin(ExpandConstant('{tmp}\skin.cjstyles'), '');
Result:=True;
end;
/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
procedure CurPageChanged(CurPageID: Integer);
begin
SetStateNewButtons; // Для кнопок
HideComponents;

ImgSetVisibility(Edit,False);
ImgSetVisibility(HDD,False);
ImgSetVisibility(DirBrowse,False);
ImgSetVisibility(GroupBrowse,False);

BtnSetVisibility(hDirBrowseBtn,False);
BtnSetVisibility(hGroupBrowseBtn,False);
BtnSetVisibility(NoIconsCheck,False);
BtnSetVisibility(DesktopCheck,False);
BtnSetVisibility(DirectXCheck,False);

ShowComponents(CurPageID);
ISDonePageChanged(CurPageID);
CurPageChanged3(CurPageID);
// SystemCurPageChanged(CurPageID); // Для сис требований

ImgApplyChanges(WizardForm.Handle);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
ISDoneStepChanged(CurStep); // Для распаковщика ISDone
PBStepChanged(CurStep); // Для прогресс бара
end;
/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
procedure DeInitializeSetup();
begin
gdipShutdown;// Для botva2
BASS_Stop;
BASS_Free;
WFButtonFont.Free; // Для кнопок (Надписи)
end;

//function InitializeUninstall(): Boolean; // Скин для деинсталлятора






Заранее спасибо.

VinTagE
15-10-2011, 21:37
ntrx, Потому что инсталл был задуман без выбора компонентов!

VinTagE
15-10-2011, 21:54
ntrx, Пример есть!
Спасибо nik1967 за пример.
http://rghost.ru/4010498
Реализовано в Need for Speed™ Undercover.iss v 2.4c [Final]
Пример только на ботве, если хочешь без ботвы то вот:
WizardForm.ComponentsList.Parent:=WizardForm;
WizardForm.ComponentsList.SetBounds(10, 108, 380, 53);
Дальше сам.

Damaks
15-10-2011, 22:14
По моему вопросу отбой. Нашёл решение.

Dark_Delphin
15-10-2011, 22:14
VinTagE, тепреь у меня выбор компонентов на всех страницах)))
Как это исправить?

http://i32.fastpic.ru/big/2011/1015/41/32b3fec8d4638cbc662a73b1f83e2641.png

VinTagE
15-10-2011, 22:24
ntrx,
На нужной странице ставь...
WizardForm.ComponentsList.Show;
Не не нужной странице ставь
WizardForm.ComponentsList.Hide;

Dark_Delphin
15-10-2011, 22:36
Что-то не получается.. Либо на всех либо нигде..(((

Кто может помочь?

http://rghost.ru/25728291

Но уже замучался..(

Помогите пожалуйста.

valyok666
16-10-2011, 00:03
ntrx, чет не понимаю смысл этого компонентлиста создай лучше радиобутон для субтитров и озвучки вроде лучше будет
+ у тебя уже есть установка доп ПО смысл ещё на компонентлисте???

Dark_Delphin
16-10-2011, 00:06
valyok666, Ну как Вы считаете лучше?
Давайте как сделали..

Damaks
16-10-2011, 13:17
Inno Setup умеет подсчитывать MD5-хэш файлов. Поэтому есть возможность проверять контрольные суммы определённых файлов при обновлении и прекращать установку, ели файлы не оригинальные.

А можно ли сделать, чтобы инсталлятор перед запуском проверял свою контрольную сумму, и если она не совпадает с оригинальной, то прерывал установку? Чтобы никто не мог изменить или подменить инсталлятор.

Blid
16-10-2011, 14:43
Помогите пожалуйста.
http://s50.radikal.ru/i130/1110/ab/304f745de617.jpg
Мне надо:
1. Чтобы блок где текст стал чёрным, а текст в нём белым.
2. И внизу (то что серое) надо залить чёрным.
3. Как поменять кнопки ?
Заранее ОГРОМНОЕ СПАСИБО !

Dark_Delphin
16-10-2011, 14:47
Blid,

[Setup]
AppName=Test
AppVerName=Test
DefaultDirName={pf}\Test
OutputDir=userdocs:Test.

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

[Files]
;Изображение размером 240х23
Source: button.bmp; DestDir: {tmp}; Flags: dontcopy

[Code_]

const
ButtonWidth = 80;
ButtonHeight = 23;

bidBack = 0;
bidNext = 1;
bidCancel = 2;
bidDirBrowse = 3;
bidGroupBrowse = 4;

var
WizardLabel: TLabel;
ButtonPanel: array [0..4] of TPanel;
ButtonImage: array [0..4] of TBitmapImage;
ButtonLabel: array [0..4] of TLabel;
n: Integer;

procedure ButtonLabelClick(Sender: TObject);
var
Button: TButton;
begin
ButtonImage[TLabel(Sender).Tag].Left:=0
case TLabel(Sender).Tag of
bidBack: Button:=WizardForm.BackButton
bidNext: Button:=WizardForm.NextButton
bidCancel: Button:=WizardForm.CancelButton
bidDirBrowse: Button:=WizardForm.DirBrowseButton
bidGroupBrowse: Button:=WizardForm.GroupBrowseButton
else
Exit
end
Button.OnClick(Button)
end;

procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Enabled then
ButtonImage[TLabel(Sender).Tag].Left:=-ButtonWidth
end;

procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ButtonImage[TLabel(Sender).Tag].Left:=0
end;

procedure ButtonLabelMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Left <> -80 then
begin
for n:=0 to 4 do ButtonImage[n].Left:= 0
end;
if ButtonLabel[TLabel(Sender).Tag].Enabled then
begin
if ButtonLabel[TLabel(Sender).Tag].Left <> -80 then
ButtonImage[TLabel(Sender).Tag].Left:= -160
end;
end;

procedure WizardLabelMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Left <> -80 then
for n:=0 to 4 do ButtonImage[n].Left:= 0
end;

procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer);
var
Image: TBitmapImage;
Panel: TPanel;
Labl: TLabel;

begin
Panel:=TPanel.Create(WizardForm)
Panel.Left:=AButton.Left
Panel.Top:=AButton.Top
Panel.Width:=AButton.Width
Panel.Height:=AButton.Height
Panel.Tag:=AButtonIndex
Panel.Parent:=AButton.Parent
ButtonPanel[AButtonIndex]:=Panel

Image:=TBitmapImage.Create(WizardForm)
Image.Width:=240
Image.Height:=23
Image.Enabled:=False
Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button.bmp'))
Image.Parent:=Panel
ButtonImage[AButtonIndex]:=Image

with TLabel.Create(WizardForm) do begin
Tag:=AButtonIndex
Parent:=Panel
Width:=Panel.Width
Height:=Panel.Height
Transparent:=True
OnClick:=@ButtonLabelClick
OnDblClick:=@ButtonLabelClick
OnMouseMove:=@ButtonLabelMove
OnMouseDown:=@ButtonLabelMouseDown
OnMouseUp:=@ButtonLabelMouseUp
end

Labl:=TLabel.Create(WizardForm)
Labl.Left:=23
Labl.Top:=5
Labl.Autosize:=True
Labl.Alignment:=taCenter
Labl.Tag:=AButtonIndex
Labl.Transparent:=True
Labl.Font.Color:=clWhite
Labl.Caption:=AButton.Caption
Labl.OnClick:=@ButtonLabelClick
Labl.OnDblClick:=@ButtonLabelClick
Labl.OnMouseMove:=@ButtonLabelMove
Labl.OnMouseDown:=@ButtonLabelMouseDown
Labl.OnMouseUp:=@ButtonLabelMouseUp
Labl.Parent:=Panel
ButtonLabel[AButtonIndex]:=Labl
end;

procedure UpdateButton(AButton: TButton;AButtonIndex: integer);
begin
ButtonLabel[AButtonIndex].Caption:=AButton.Caption
ButtonPanel[AButtonIndex].Visible:=AButton.Visible
ButtonLabel[AButtonIndex].Enabled:=Abutton.Enabled
ButtonLabel[AButtonIndex].Left:= ButtonPanel[AButtonIndex].Width div 2 - ButtonLabel[AButtonIndex].Width div 2;
ButtonLabel[AButtonIndex].Top:= ButtonPanel[AButtonIndex].Height div 2 - ButtonLabel[AButtonIndex].Height div 2;
end;

procedure LicenceAcceptedRadioOnClick(Sender: TObject);
begin
ButtonLabel[bidNext].Enabled:=True
end;

procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
begin
ButtonLabel[bidNext].Enabled:=False
end;

procedure InitializeWizard();
begin
WizardLabel:= TLabel.Create(WizardForm)
WizardLabel.Left:= ScaleX(0)
WizardLabel.Top:= ScaleY(0)
WizardLabel.Width:= ScaleX(497);
WizardLabel.Height:= ScaleY(360);
WizardLabel.Transparent:= True;
WizardLabel.AutoSize:=false;
WizardLabel.Caption:='';
WizardLabel.OnMouseMove:=@WizardLabelMove
WizardLabel.Parent:= WizardForm;

WizardForm.BackButton.Width:=ButtonWidth
WizardForm.BackButton.Height:=ButtonHeight

WizardForm.NextButton.Width:=ButtonWidth
WizardForm.NextButton.Height:=ButtonHeight

WizardForm.CancelButton.Width:=ButtonWidth
WizardForm.CancelButton.Height:=ButtonHeight

WizardForm.DirBrowseButton.Left:=337
WizardForm.DirBrowseButton.Width:=ButtonWidth
WizardForm.DirBrowseButton.Height:=ButtonHeight

WizardForm.GroupBrowseButton.Left:=337
WizardForm.GroupBrowseButton.Width:=ButtonWidth
WizardForm.GroupBrowseButton.Height:=ButtonHeight

WizardForm.LicenseAcceptedRadio.OnClick:=@LicenceAcceptedRadioOnClick

WizardForm.LicenseNotAcceptedRadio.OnClick:=@LicenceNotAcceptedRadioOnClick

ExtractTemporaryFile('button.bmp')
LoadButtonImage(WizardForm.BackButton,bidBack)
LoadButtonImage(WizardForm.NextButton,bidNext)
LoadButtonImage(WizardForm.CancelButton,bidCancel)
LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse)
LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse)
end;

procedure CurPageChanged(CurPageID: Integer);
begin
UpdateButton(WizardForm.BackButton,bidBack)
UpdateButton(WizardForm.NextButton,bidNext)
UpdateButton(WizardForm.CancelButton,bidCancel)
UpdateButton(WizardForm.DirBrowseButton,bidDirBrowse)
UpdateButton(WizardForm.GroupBrowseButton,bidGroupBrowse)
end;

Кнопки (http://forum.oszone.net/attachment.php?attachmentid=38603&d=1264555032)

_______________
WizardForm.WelcomePage.Color:=clBlack; //// Чорный

insombia
16-10-2011, 14:54
Blid http://rghost.ru/25795891
Чтобы блок где текст стал чёрным

Blid
16-10-2011, 15:03
ntrx
С кнопками всё удалось, а вот с чёрным цветом не получается он строчку (WizardForm.WelcomePage.Color:=clBlack;) выделяет красным.

insombia
не рубит. Выделил красным (function DrawText(hDC: LongWord; lpString: PAnsiChar; nCount: Integer; var lpRect: TRect; uFormat: UINT): Integer; external 'DrawTextA@user32.dll stdcall';)




© OSzone.net 2001-2012