Войти

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


Страниц : 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

vint56
07-01-2014, 19:41
habib2302
const
LOAD_LIBRARY_AS_DATAFILE = $2;

function LoadLibraryEx(lpFileName: String; hFile: THandle; dwFlags: DWORD): THandle;
external 'LoadLibraryExA@kernel32.dll stdcall';habib2302,

Ivan_009
07-01-2014, 20:42
Почему при нехватке места на диске при нажатии кнопки далее инсталл тупо предлагает выйти не пойму в чем проблема вот код... Заранее спасибо за помощь...

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;
Label1: TLabel;
///
const
NORMAL_PRIORITY_CLASS = $00000020;
IDLE_PRIORITY_CLASS = $00000040;
HIGH_PRIORITY_CLASS = $00000080;
REALTIME_PRIORITY_CLASS = $00000100;

function SetPriorityClass(hProcess: THandle; dwPriorityClass: DWORD): BOOL;
external 'SetPriorityClass@kernel32';

function GetCurrentProcess: THandle;
external 'GetCurrentProcess@kernel32';
///
///
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';
///
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.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
//WizardForm.Color:=clMenu;
///
SetPriorityClass(GetCurrentProcess, IDLE_PRIORITY_CLASS); //óñòàíîâêà ïðèîðèòåòà äëÿ èíñòàëëÿòîðà.
///
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.NextButton do
begin
Parent:=WizardForm;
Left := ScaleX(460);
Top := ScaleY(372);
Width := ScaleX(110);
Height := ScaleY(30);
end;

with WizardForm.CancelButton do
begin
Parent:=WizardForm;
Left := ScaleX(460);
Top := ScaleY(372);
Width := ScaleX(110);
Height := ScaleY(30);
end;

with WizardForm.BackButton do
begin
Parent:=WizardForm;
Left := ScaleX(343);
Top := ScaleY(372);
Width := ScaleX(110);
Height := 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(22);
Top := ScaleY(25);
Width := ScaleX(496);
Height := ScaleY(214);
end;

with WizardForm.ProgressGauge do
begin
Left := ScaleX(55);
Top := ScaleY(375);
Width := ScaleX(390);
Height := ScaleY(25);
Parent:= WizardForm;
end;

with WizardForm.ComponentsList do
begin
Parent:=Panel2;
Width := ScaleX(465);
Left := ScaleX(15);
Top := ScaleY(15);
Height := ScaleY(183);
end;

with WizardForm.ReadyMemo do
begin
Left := ScaleX(13);
Top := ScaleY(5);
Width := ScaleX(470);
Height := ScaleY(193);
Parent:=Panel2;
end;

// Bevel
with WizardForm.Bevel1 do
begin
Parent:=WizardForm;
Left := ScaleX(1);
Top := ScaleY(47);
Width := ScaleX(578);
Height := ScaleY(2);
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
Parent:=WizardForm;
Left := ScaleX(1);
Top := ScaleY(361);
Width := ScaleX(578);
Height := ScaleY(2);
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
Parent:=Panel1;
Left := ScaleX(395);
Top := ScaleY(37);
Width := ScaleX(110);
Height := ScaleY(30);
end;

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

with WizardForm.GroupBrowseButton do
begin
Parent:=Panel1;
Left := ScaleX(395);
Top := ScaleY(115);
Width := ScaleX(110);
Height := ScaleY(30);
end;

with WizardForm.GroupEdit do
begin
Parent:=Panel1;
Left := ScaleX(43);
Top := ScaleY(120);
Width := ScaleX(330);
Height := ScaleY(25);
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(285, 195, 200, 20);
InstallSpacelabel.Parent:= Panel1;

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

WizardForm.DirEdit.OnChange:=@DirEditOnChange;

StatusLabel1:= TLabel.Create(WizardForm);
with StatusLabel1 do
begin
Parent:=WizardForm;
Left := ScaleX(20);
Top := ScaleY(5);
Width := ScaleX(578);
Height := ScaleY(20);
Font.Name:='Tahoma';
Font.Size:= 10;
Font.Style:=[fsBold];
end;

StatusLabel2:= TLabel.Create(WizardForm);
with StatusLabel2 do
begin
Parent:=WizardForm;
Left := ScaleX(32);
Top := ScaleY(25);
Width := ScaleX(578);
Height := ScaleY(20);
Font.Name:='Tahoma';
Font.Size:= 8;
end;

StatusLabel3:= TLabel.Create(WizardForm);
with StatusLabel3 do
begin
Parent := Panel1;
Left := ScaleX(43);
Top := ScaleY(18);
Width := ScaleX(496);
Height := ScaleY(20);
Font.Name:='Tahoma';
Font.Size:= 10;
end;

StatusLabel4:= TLabel.Create(WizardForm);
with StatusLabel4 do
begin
Parent := Panel1;
Left := ScaleX(43);
Top := ScaleY(92);
Width := ScaleX(496);
Height := ScaleY(20);
Font.Name:='Tahoma';
Font.Size:= 10;
end;

StatusLabel5:= TLabel.Create(WizardForm);
with StatusLabel5 do
begin
Parent := Panel1;
Left := ScaleX(43);
Top := ScaleY(170);
Width := ScaleX(496);
Height := ScaleY(20);
Font.Name:='Tahoma';
Font.Size:= 10;
end;

StatusLabel6 := TLabel.Create(WizardForm);
with StatusLabel6 do
begin
Parent := WizardForm;
Left := ScaleX(37);
Top := ScaleY(337);
Width := ScaleX(178);
Height := ScaleY(13);
end;
end;

// Ïðîïóñê ñòðàíèö
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID =wpLicense)or(PageID =wpInfoBefore)or(PageID =wpUserInfo)or(PageID =wpSelectProgramGroup)or(PageID =wpSelectTasks) then
Result:= True;
end;

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;

procedure CurPageChanged(CurPageID: Integer);
begin
ShowComponents(CurPageID);
end;

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

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

nik1967
07-01-2014, 21:47
Почему при нехватке места на диске при нажатии кнопки далее инсталл тупо предлагает выйти »
with WizardForm.NextButton do
begin
Parent:=WizardForm;
Left := ScaleX(460);
Top := ScaleY(372);
Width := ScaleX(110);
Height := ScaleY(30);
end;

with WizardForm.CancelButton do
begin
Parent:=WizardForm;
Left := ScaleX(460);
Top := ScaleY(372);
Width := ScaleX(110);
Height := ScaleY(30);
end;
У тебя CancelButton накладывается на NextButton. Соответственно при неактивной кнопке NextButton вместо неё нажимается CancelButton.

Ivan_009
09-01-2014, 20:26
Помогите растянуть панель при задвижении и выкате на всю форму вот код

var
SettingPanel : TPanel;
Flag : boolean;
Timer : LongWord;
DirBevel,GroupBevel,DriveBevel: TBevel;

function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';

procedure MyTimer;
begin
case Flag of
True :
begin
if SettingPanel.Top = 0 then
KillTimer(WizardForm.Handle, Timer);
if SettingPanel.Top < 0 then SettingPanel.Top := SettingPanel.Top + ScaleY(3);
end;
False :
begin
if SettingPanel.Top = ScaleY(-315) then
KillTimer(WizardForm.Handle, Timer);
if SettingPanel.Top > ScaleY(-315) then SettingPanel.Top := SettingPanel.Top - ScaleY(3);
end;
end;
end;

procedure HideShow(Sender: TObject);
begin
KillTimer(WizardForm.Handle, Timer);
Timer := SetTimer(WizardForm.Handle, 1, 5 , CallbackAddr('MyTimer'));
case Flag of
True : TButton(Sender).Caption:='Íàñòðîéêè';
False : TButton(Sender).Caption:='Íàçàä';
end;
Flag:= not Flag;
end;

procedure InitializeWizard();
begin
Flag:= False;

WizardForm.Width:=ScaleX(700);
WizardForm.Height:=ScaleY(400);
WizardForm.Position:=poScreenCenter;
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.Color:=$000000;

SettingPanel := TPanel.Create(WizardForm);
with SettingPanel do
begin
Parent := WizardForm;
SetBounds(ScaleX(0),ScaleY(-315),ScaleX(497),ScaleY(313));
ParentBackground := False;
SettingPanel.Color:=$000000;
end;

with WizardForm.DirBrowseButton do
begin
Parent:=SettingPanel;
Left := ScaleX(395);
Top := ScaleY(37);
Width := ScaleX(110);
Height := ScaleY(30);
end;

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

with WizardForm.GroupBrowseButton do
begin
Parent:=SettingPanel;
Left := ScaleX(395);
Top := ScaleY(115);
Width := ScaleX(110);
Height := ScaleY(30);
end;

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

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

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

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

(*with WizardForm.ProgressGauge do
begin
Left := ScaleX(75);
Top := ScaleY(160);
Width := ScaleX(430);
Height := ScaleY(25);
Parent:= WizardForm;
end;*)

with TButton.Create(WizardForm) do
begin
OnClick:= @HideShow;
SetBounds(ScaleX(40),ScaleY(327),ScaleX(75),ScaleY (25))
Caption:='Íàñòðîéêè';
Parent:= WizardForm;
end;
end;

Nordek
09-01-2014, 21:03
Помогите растянуть панель при задвижении и выкате на всю форму вот код »

[Code]
var
SettingPanel : TPanel;
Flag : boolean;
Timer : LongWord;
DirBevel,GroupBevel,DriveBevel: TBevel;

function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';

procedure MyTimer;
begin
case Flag of
True :
begin
if SettingPanel.Top = 0 then
KillTimer(WizardForm.Handle, Timer);
if SettingPanel.Top < 0 then SettingPanel.Top := SettingPanel.Top + ScaleY(3);
end;
False :
begin
if SettingPanel.Top = ScaleY(-315) then
KillTimer(WizardForm.Handle, Timer);
if SettingPanel.Top > ScaleY(-315) then SettingPanel.Top := SettingPanel.Top - ScaleY(3);
end;
end;
end;

procedure HideShow(Sender: TObject);
begin
KillTimer(WizardForm.Handle, Timer);
Timer := SetTimer(WizardForm.Handle, 1, 5 , CallbackAddr('MyTimer'));
case Flag of
True : TButton(Sender).Caption:='Iano?ieee';
False : TButton(Sender).Caption:='Iacaa';
end;
Flag:= not Flag;
end;

procedure InitializeWizard();
begin
Flag:= False;

WizardForm.Width:=ScaleX(700);
WizardForm.Height:=ScaleY(400);
WizardForm.Position:=poScreenCenter;
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.Color:=$000000;

WizardForm.Bevel.Width := ScaleX(695);
//WizardForm.Bevel.Visible := False; // äëÿ òîãî ÷òîá ñêðûòü Bevel, ðàñêîìåíòèðóé "WizardForm.Bevel.Visible := False;" è çàêîìåíòèðóé "WizardForm.Bevel.Width := ScaleX(695);"

SettingPanel := TPanel.Create(WizardForm);
with SettingPanel do
begin
Parent := WizardForm;
SetBounds(ScaleX(7),ScaleY(-315),ScaleX(680),ScaleY(313));
ParentBackground := False;
SettingPanel.Color:=$000000;
end;

with WizardForm.DirBrowseButton do
begin
Parent:=SettingPanel;
Left := ScaleX(395);
Top := ScaleY(37);
Width := ScaleX(110);
Height := ScaleY(30);
end;

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

with WizardForm.GroupBrowseButton do
begin
Parent:=SettingPanel;
Left := ScaleX(395);
Top := ScaleY(115);
Width := ScaleX(110);
Height := ScaleY(30);
end;

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

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

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

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

(*with WizardForm.ProgressGauge do
begin
Left := ScaleX(75);
Top := ScaleY(160);
Width := ScaleX(430);
Height := ScaleY(25);
Parent:= WizardForm;
end;*)

with TButton.Create(WizardForm) do
begin
OnClick:= @HideShow;
SetBounds(ScaleX(40),ScaleY(327),ScaleX(75),ScaleY (25))
Caption:='Iano?ieee';
Parent:= WizardForm;
end;
end;

Ivan_009
09-01-2014, 22:18
Как скрыть TButton на wpInstalling: пробовал TButton.Hide; не работает

var
SettingPanel : TPanel;
Flag : boolean;
Timer : LongWord;
BmpFile: TBitmapImage;
DirBevel,GroupBevel,DriveBevel: TBevel;

//Skin
procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskin.dll stdcall delayload setuponly';
procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall delayload setuponly';

procedure LoadSkinU(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
procedure UnloadSkinU(); external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
//Skin

function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';

procedure MyTimer;
begin
case Flag of
True :
begin
if SettingPanel.Top = 0 then
KillTimer(WizardForm.Handle, Timer);
if SettingPanel.Top < 0 then SettingPanel.Top := SettingPanel.Top + ScaleY(3);
end;
False :
begin
if SettingPanel.Top = ScaleY(-315) then
KillTimer(WizardForm.Handle, Timer);
if SettingPanel.Top > ScaleY(-315) then SettingPanel.Top := SettingPanel.Top - ScaleY(3);
end;
end;
end;

procedure HideShow(Sender: TObject);
begin
KillTimer(WizardForm.Handle, Timer);
Timer := SetTimer(WizardForm.Handle, 1, 5 , CallbackAddr('MyTimer'));
case Flag of
True : TButton(Sender).Caption:='Íàñòðîéêè';
False : TButton(Sender).Caption:='Íàçàä';
end;
Flag:= not Flag;
end;

procedure InitializeWizard();
begin
Flag:= False;

WizardForm.Width:=ScaleX(700);
WizardForm.Height:=ScaleY(400);
WizardForm.Position:=poScreenCenter;
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.Bevel.Width := ScaleX(695);
//WizardForm.Color:=$000000;

ExtractTemporaryFile('WizardImage.bmp')
//ExtractTemporaryFile('Finished.bmp')
//ExtractTemporaryFile('CBImg.bmp');

BmpFile:= TBitmapImage.Create(WizardForm)
BmpFile.Stretch:= True;
BmpFile.SetBounds(ScaleX(0),ScaleY(0), ScaleX(700), ScaleY(313))
BmpFile.Parent:= WizardForm;

with WizardForm.NextButton do
begin
Parent:=WizardForm;
Left := ScaleX(460);
Top := ScaleY(330);
Width := ScaleX(110);
Height := ScaleY(30);
end;

with WizardForm.CancelButton do
begin
Parent:=WizardForm;
Left := ScaleX(9);
Top := ScaleY(330);
Width := ScaleX(110);
Height := ScaleY(30);
end;

with WizardForm.BackButton do
begin
Parent:=WizardForm;
Left := ScaleX(343);
Top := ScaleY(330);
Width := ScaleX(110);
Height := ScaleY(30);
end;

SettingPanel := TPanel.Create(WizardForm);
with SettingPanel do
begin
Parent := WizardForm;
SetBounds(ScaleX(0),ScaleY(-315),ScaleX(694),ScaleY(313));
ParentBackground := False;
//SettingPanel.Color:=$000000;
end;

with WizardForm.DirBrowseButton do
begin
Parent:=SettingPanel;
Left := ScaleX(395);
Top := ScaleY(37);
Width := ScaleX(110);
Height := ScaleY(30);
end;

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

with WizardForm.GroupBrowseButton do
begin
Parent:=SettingPanel;
Left := ScaleX(395);
Top := ScaleY(115);
Width := ScaleX(110);
Height := ScaleY(30);
end;

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

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

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

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

with WizardForm.ProgressGauge do
begin
Left := ScaleX(75);
Top := ScaleY(160);
Width := ScaleX(430);
Height := ScaleY(25);
Parent:= WizardForm;
end;

with TButton.Create(WizardForm) do
begin
OnClick:= @HideShow;
Left := ScaleX(10);
Top := ScaleY(330);
Width := ScaleX(110);
Height := ScaleY(30);
Caption:='Íàñòðîéêè';
Parent:= WizardForm;
end;
end;

//Óáèðàåì âñå ñòðàíèöû êðîìå WelcomePage
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID =wpLicense)or(PageID =wpInfoBefore)or(PageID =wpUserInfo)or(PageID =wpSelectDir)or(PageID =wpSelectComponents)or(PageID =wpSelectProgramGroup)or(PageID =wpSelectTasks)or(PageID =wpReady)then
Result:= True;
end;

procedure ShowComponents(CurPageID: Integer);
begin
WizardForm.ProgressGauge.Hide;
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardImage.bmp'))
Case CurPageID of
wpWelcome:
begin
WizardForm.NextButton.Caption := 'Íà÷àòü óñòàíîâêó';
end;
wpInstalling:
begin
SettingPanel.Hide;
WizardForm.ProgressGauge.Show;
end;
wpFinished:
begin

end;
end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
ShowComponents(CurPageID);
end;

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

function InitializeUninstall(): Boolean;
begin
FileCopy(ExpandConstant('{app}\isskin.dll'),
ExpandConstant('{tmp}\isskin.dll'), False);
FileCopy(ExpandConstant('{app}\Skin.cjstyles'),
ExpandConstant('{tmp}\Skin.cjstyles'), False); LoadSkinU(ExpandConstant('{tmp}\Skin.cjstyles'), '');
Result:=True;
end;

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

procedure DeinitializeUninstall();
begin
UnloadSkinU();
end;

saurn
09-01-2014, 23:13
Как скрыть TButton на wpInstalling »
var
SettingPanel : TPanel;
Flag : boolean;
Timer : LongWord;
BmpFile: TBitmapImage;
DirBevel,GroupBevel,DriveBevel: TBevel;
CustomBtn: TButton;

//Skin
procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskin.dll stdcall delayload setuponly';
procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall delayload setuponly';

procedure LoadSkinU(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
procedure UnloadSkinU(); external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
//Skin

function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';

procedure MyTimer;
begin
case Flag of
True :
begin
if SettingPanel.Top = 0 then
KillTimer(WizardForm.Handle, Timer);
if SettingPanel.Top < 0 then SettingPanel.Top := SettingPanel.Top + ScaleY(3);
end;
False :
begin
if SettingPanel.Top = ScaleY(-315) then
KillTimer(WizardForm.Handle, Timer);
if SettingPanel.Top > ScaleY(-315) then SettingPanel.Top := SettingPanel.Top - ScaleY(3);
end;
end;
end;

procedure HideShow(Sender: TObject);
begin
KillTimer(WizardForm.Handle, Timer);
Timer := SetTimer(WizardForm.Handle, 1, 5 , CallbackAddr('MyTimer'));
case Flag of
True : TButton(Sender).Caption:='I'a`n~o`?i^e'e^e`';
False : TButton(Sender).Caption:='I'a`c,a`a"';
end;
Flag:= not Flag;
end;

procedure InitializeWizard();
begin
Flag:= False;

WizardForm.Width:=ScaleX(700);
WizardForm.Height:=ScaleY(400);
WizardForm.Position:=poScreenCenter;
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.Bevel.Width := ScaleX(695);
//WizardForm.Color:=$000000;

ExtractTemporaryFile('WizardImage.bmp')
//ExtractTemporaryFile('Finished.bmp')
//ExtractTemporaryFile('CBImg.bmp');

BmpFile:= TBitmapImage.Create(WizardForm)
BmpFile.Stretch:= True;
BmpFile.SetBounds(ScaleX(0),ScaleY(0), ScaleX(700), ScaleY(313))
BmpFile.Parent:= WizardForm;

with WizardForm.NextButton do
begin
Parent:=WizardForm;
Left := ScaleX(460);
Top := ScaleY(330);
Width := ScaleX(110);
Height := ScaleY(30);
end;

with WizardForm.CancelButton do
begin
Parent:=WizardForm;
Left := ScaleX(9);
Top := ScaleY(330);
Width := ScaleX(110);
Height := ScaleY(30);
end;

with WizardForm.BackButton do
begin
Parent:=WizardForm;
Left := ScaleX(343);
Top := ScaleY(330);
Width := ScaleX(110);
Height := ScaleY(30);
end;

SettingPanel := TPanel.Create(WizardForm);
with SettingPanel do
begin
Parent := WizardForm;
SetBounds(ScaleX(0),ScaleY(-315),ScaleX(694),ScaleY(313));
ParentBackground := False;
//SettingPanel.Color:=$000000;
end;

with WizardForm.DirBrowseButton do
begin
Parent:=SettingPanel;
Left := ScaleX(395);
Top := ScaleY(37);
Width := ScaleX(110);
Height := ScaleY(30);
end;

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

with WizardForm.GroupBrowseButton do
begin
Parent:=SettingPanel;
Left := ScaleX(395);
Top := ScaleY(115);
Width := ScaleX(110);
Height := ScaleY(30);
end;

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

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

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

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

with WizardForm.ProgressGauge do
begin
Left := ScaleX(75);
Top := ScaleY(160);
Width := ScaleX(430);
Height := ScaleY(25);
Parent:= WizardForm;
end;

CustomBtn := TButton.Create(WizardForm);
with CustomBtn do
begin
OnClick:= @HideShow;
Left := ScaleX(10);
Top := ScaleY(330);
Width := ScaleX(110);
Height := ScaleY(30);
Caption:='I'a`n~o`?i^e'e^e`';
Parent:= WizardForm;
end;
end;

//O'a'e`?a`a*i` a^n~a* n~o`?a`i'e`o"u^ e^?i^i`a* WelcomePage
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID =wpLicense)or(PageID =wpInfoBefore)or(PageID =wpUserInfo)or(PageID =wpSelectDir)or(PageID =wpSelectComponents)or(PageID =wpSelectProgramGroup)or(PageID =wpSelectTasks)or(PageID =wpReady)then
Result:= True;
end;

procedure ShowComponents(CurPageID: Integer);
begin
WizardForm.ProgressGauge.Hide;
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardImage.bmp'))
Case CurPageID of
wpWelcome:
begin
WizardForm.NextButton.Caption := 'I'a`?a`o`u" o'n~o`a`i'i^a^e^o'';
end;
wpInstalling:
begin
CustomBtn.Hide;
SettingPanel.Hide;
WizardForm.ProgressGauge.Show;
end;
wpFinished:
begin

end;
end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
ShowComponents(CurPageID);
end;

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

function InitializeUninstall(): Boolean;
begin
FileCopy(ExpandConstant('{app}\isskin.dll'),
ExpandConstant('{tmp}\isskin.dll'), False);
FileCopy(ExpandConstant('{app}\Skin.cjstyles'),
ExpandConstant('{tmp}\Skin.cjstyles'), False); LoadSkinU(ExpandConstant('{tmp}\Skin.cjstyles'), '');
Result:=True;
end;

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

procedure DeinitializeUninstall();
begin
UnloadSkinU();
end;

Ivan_009
10-01-2014, 14:13
Как наложить изображение bmp на форму выхода. Подскажите кто знает. Зарание спасибо.

diman_21Ru
10-01-2014, 16:47
Всем привет не кто не знает почему эта ошибка при запуске уже готового скрипта по системным требованиям

Gnom_aka_Lexander
10-01-2014, 18:41
diman_21Ru, точку с запятой на предыдущей строке забыл. и таких ошибок скорей всего будет еще тьма. плюс скорей всего в паре мест вылезет несоответствие типов string и ansistring (проверено, гарантирую) поэтому есть смысл тебе пользоваться ansi-версией, к юникодной ты точно не готов (иначе этого вопроса не было-бы)

diman_21Ru
10-01-2014, 19:10
а где найти ansi-версию и какую надо именно ?

5.5.1 стоит расширенная на ней ошибку выдает (

Gnom_aka_Lexander
10-01-2014, 19:16
diman_21Ru, там-же, где нашел юникодную, я думаю :) какая именно - я так понял - обычная или расширенная? это уже нужно смотреть скрипт - если используются функции расширенной версии, то только расширенную, если нет, то достаточно обычной с официального сайта сабжа.

У меня из подписи, качаешь, при установке выбрать расширенную анси - должно компилироваться все. все примеры делались либо только под анси, либо с сохранением совместимости с анси, над совместимостью с юникодом на моей памяти никто не задумывался.

diman_21Ru
10-01-2014, 19:18
спасибо

Ivan_009
11-01-2014, 21:59
Не могу никак настроить прогресс бар при отмене установки установка все равно продолжается помогите пожалуйста...

Вот код

type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);
TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;

const
PCFonFLY=true;
notPCFonFLY=false;

GWL_STYLE = -16;

WS_MINIMIZEBOX = $20000;
WS_MAXIMIZEBOX = $10000;

var
LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
LabelPct2: TLabel;
ISDoneProgressBar2:TNewProgressBar;
#endif
ISDoneCancel:integer;
ISDoneError:boolean;
PCFVer:double;

BmpFile: TBitmapImage;
About: TNewButton;

pfunc: LongWord;
TimerID: LongWord;
intOldCurrWidth : Integer;
ProgressBar_BitmapImage: TBitmapImage;
ProgressBar_Edit : TEdit;
ProgressBar_ImageHeight : integer;

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

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

function MessageBox(hWnd: Integer; lpText, lpCaption: AnsiString; uType: Cardinal): Integer; external 'MessageBoxA@user32.dll stdcall';

// Ôóíêöèè äëÿ ðàáîòû ñ òàéìåðîì
function WrapTimerProc(callback:TProc; 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 SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall';

function WrapCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:ISDone.dll stdcall delayload';

function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean; external 'ISArcExtract@files:ISDone.dll stdcall delayload';
function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'ISRarExtract@files:ISDone.dll stdcall delayload';
function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean; external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean; external 'ISPackZIP@files:ISDone.dll stdcall delayload';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';

function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean; external 'Exec2@files:ISDone.dll stdcall delayload';
function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer; external 'ISFindFiles@files:ISDone.dll stdcall delayload';
function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean; external 'ISPickFilename@files:ISDone.dll stdcall delayload';
function ISGetName(TypeStr:integer):PAnsichar; external 'ISGetName@files:ISDone.dll stdcall delayload';
function ISFindFree(FindHandle:integer):boolean; external 'ISFindFree@files:ISDone.dll stdcall delayload';
function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean; external 'ISExec@files:ISDone.dll stdcall delayload';

function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean; external 'SrepInit@files:ISDone.dll stdcall delayload';
function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean; external 'PrecompInit@files:ISDone.dll stdcall delayload';
function FileSearchInit(RecursiveSubDir:boolean):boolean; external 'FileSearchInit@files:ISDone.dll stdcall delayload';
function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean; external 'ISDoneInit@files:ISDone.dll stdcall';
function ISDoneStop:boolean; external 'ISDoneStop@files:ISDone.dll stdcall';
function ChangeLanguage(Language:AnsiString):boolean; external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
function SuspendProc:boolean; external 'SuspendProc@files:ISDone.dll stdcall';
function ResumeProc:boolean; external 'ResumeProc@files:ISDone.dll stdcall';

function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
if OveralPct<=1000 then WizardForm.ProgressGauge.Position := OveralPct;
Result := ISDoneCancel;
end;

procedure CancelButtonOnClick(Sender: TObject);
begin
SuspendProc;
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
ResumeProc;
end;

procedure AboutClick(Sender: TObject);
begin
MessageBox(WizardForm.Handle, '{#Release}', 'Î ðåëèçå', MB_OK or MB_ICONINFORMATION);
end;

// Ôóíêöèÿ âûçûâàåìàÿ ïî òàéìåðó
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
var
CurrWidth : single;
begin
// Èñïîëüçóåì òåêóùåå ñîñòîÿíèå ñòàíäàðòíîãî Ïðîãðåññ Áàðà (ÏÁ)
with WizardForm.ProgressGauge do
begin
CurrWidth := ( Position * ScaleX(430) ) / Max; // Âû÷èñëÿåì êàêîé øèðèíû äîëæåí áûòü íàø ÏÁ
if intOldCurrWidth <> Round( CurrWidth ) then // Åñëè øèðèíà ïîêà ÷òî òàêàÿ æå, òî íå áóäåì ïîêà ÷òî ðèñîâàòü, ÷òîáû èçáåæàòü ëèøíèõ îáíîâëåíèé ôîðìû
begin
intOldCurrWidth := Round( CurrWidth );
// Òåïåðè÷à "ðèñóåì" íàø ÏÁ
ProgressBar_BitmapImage.SetBounds( 0, 0, intOldCurrWidth, ProgressBar_ImageHeight );
ProgressBar_BitmapImage.Show(); // Ïîêàçûâàåì åãî âî âñåé êðàñå
end;
end;
end;

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

procedure HideControls;
begin
WizardForm.FileNamelabel.Hide;
ISDoneProgressBar1.Hide;
LabelPct1.Hide;
LabelCurrFileName.Hide;
LabelTime1.Hide;
LabelTime2.Hide;
#ifdef SecondProgressBar
ISDoneProgressBar2.Hide;
LabelPct2.Hide;
#endif
end;

procedure CreateControls;
var PBTop:integer;
begin
PBTop:=ScaleY(50);
ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar1 do begin
Parent := WizardForm.InstallingPage;
Height := WizardForm.ProgressGauge.Height;
Left := ScaleX(0);
Top := PBTop;
Width := ScaleX(365);
Max := 1000;
end;
LabelPct1 := TLabel.Create(WizardForm);
with LabelPct1 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Left := ISDoneProgressBar1.Width+ScaleX(5);
Top := ISDoneProgressBar1.Top + ScaleY(2);
Width := ScaleX(80);
end;
LabelCurrFileName := TLabel.Create(WizardForm);
with LabelCurrFileName do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := ISDoneProgressBar1.Width+ScaleX(30);
Left := ScaleX(0);
Top := ScaleY(30);
end;
#ifdef SecondProgressBar
PBTop:=PBTop+ScaleY(25);
ISDoneProgressBar2 := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar2 do begin
Parent := WizardForm.InstallingPage;
Left := ScaleX(0);
Top := PBTop+ScaleY(8);
Width := ISDoneProgressBar1.Width;
Max := 1000;
Height := WizardForm.ProgressGauge.Height;
end;
LabelPct2 := TLabel.Create(WizardForm);
with LabelPct2 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Left := ISDoneProgressBar2.Width+ScaleX(5);
Top := ISDoneProgressBar2.Top + ScaleY(2);
Width := ScaleX(80);
end;
#endif
LabelTime1 := TLabel.Create(WizardForm);
with LabelTime1 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := ISDoneProgressBar1.Width div 2;
Left := ScaleX(0);
Top := PBTop + ScaleY(35);
end;
LabelTime2 := TLabel.Create(WizardForm);
with LabelTime2 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := LabelTime1.Width+ScaleX(40);
Left := ISDoneProgressBar1.Width div 2;
Top := LabelTime1.Top;
end;
LabelTime3 := TLabel.Create(WizardForm);
with LabelTime3 do begin
Parent := WizardForm.FinishedPage;
AutoSize := False;
Width := 300;
Left := 180;
Top := 200;
end;
end;

procedure InitializeWizard();
begin
WizardForm.Width:=ScaleX(654);
WizardForm.Height:=ScaleY(423);
WizardForm.Position:=poScreenCenter;
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.Color:=$000000;

SetWindowLong(WizardForm.handle, GWL_STYLE, GetWindowLong(WizardForm.handle, GWL_STYLE)and(not WS_MINIMIZEBOX)and(not WS_MAXIMIZEBOX));
SetWindowLong(WizardForm.Handle, (-20), GetWindowLong(WizardForm.Handle, (-20)) or $2000000);

ExtractTemporaryFile('Welcome.bmp');
ExtractTemporaryFile('Finished.bmp');
ExtractTemporaryFile('{#PB_ImageFile}');

BmpFile:= TBitmapImage.Create(WizardForm)
BmpFile.Stretch:= True;
BmpFile.SetBounds(ScaleX(0),ScaleY(0), ScaleX(654), ScaleY(355))
BmpFile.Parent:= WizardForm;

with WizardForm.Bevel do
begin
Parent:=WizardForm;
Left := ScaleX(0);
Top := ScaleY(355);
Width := ScaleX(654);
Height := ScaleY(2);
end;

with WizardForm.NextButton do
begin
Parent:=WizardForm;
Left := ScaleX(450);
Top := ScaleY(365);
Width := ScaleX(95);
Height := ScaleY(25);
end;

with WizardForm.CancelButton do
begin
Parent:=WizardForm;
Left := ScaleX(550);
Top := ScaleY(365);
Width := ScaleX(95);
Height := ScaleY(25);
end;

with WizardForm.BackButton do
begin
Parent:=WizardForm;
Left := ScaleX(350);
Top := ScaleY(365);
Width := ScaleX(95);
Height := ScaleY(25);
end;

About := TNewButton.Create(WizardForm);
with About do
begin
Parent := WizardForm;
Left := ScaleX(3);
Top := ScaleY(365);
Width := ScaleX(95);
Height := ScaleY(25);
Caption := 'Î ðåëèçå';
OnClick := @AboutClick;
end;

// Ñîçäàåì íàø Edit, ÷òîáû ó íàøåãî ÏÁ áûëà áîëåå-ìåíåå íîðìàëüíàÿ ðàìêà.
ProgressBar_Edit := TEdit.Create( WizardForm );
with ProgressBar_Edit do
begin
// Ñîçäàåì åãî íà ìåñòå ñòàíäàðòíîãî ÏÁ
Left := ScaleX(115);
Top := ScaleY(367);
Width := ScaleX(430);
Height := ScaleY(21);
Enabled := False;
ReadOnly := True;
// Ôîíîâûé öâåò äåëàåì òî÷íî òàêîé æå êàê ó ôîðìû.
Color := $000000;
Parent := WizardForm;
end;

ProgressBar_BitmapImage := TBitmapImage.Create( WizardForm );
with ProgressBar_BitmapImage do
begin
// Çàãðóæàåì êàðòèíêó
Bitmap.LoadFromFile( ExpandConstant( '{tmp}\' ) + '{#PB_ImageFile}' );
Parent := ProgressBar_Edit;
Stretch := True; // Îí äîëæåí ðàñòÿãèâàòüñÿ
Hide; // Ïðÿ÷åì åãî äî ïîðû äî âðåìåíè
end;

// Ïîëó÷àåì âûñîòó äëÿ êàðòèíêè
ProgressBar_ImageHeight := ProgressBar_Edit.Height - 2;
// Ïðÿ÷åì ñòàíäàðòíûé ÏÁ
WizardForm.ProgressGauge.Hide;
end;

procedure ShowComponents(CurPageID: Integer);
//var
// pfunc: LongWord;
begin
BmpFile.Hide;
ProgressBar_Edit.Hide;
Case CurPageID of
wpWelcome:
begin

BmpFile.Show;
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Welcome.bmp'))
end;
wpSelectDir:
begin

end;
wpSelectComponents:
begin

end;
wpReady:
begin

end;
wpInstalling:
begin
BmpFile.Show;
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Welcome.bmp'))
About.Hide;
ProgressBar_Edit.Show;
// Óñòàíàâëèâàåì òàéìåð
//pfunc := WrapTimerProc( @OnTimer, 4 );
//TimerID := SetTimer( 0, 0, 100, pfunc );
//intOldCurrWidth := 0;
end;
wpFinished:
begin
About.Hide;
BmpFile.Show;
WizardForm.NextButton.Left := ScaleX(550);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Finished.bmp'))
KillTimer( 0, TimerID );
end;
end;
end;

Procedure UnpackingISDoneFinished(CurPageID: Integer);
Begin
if (CurPageID = wpFinished) and ISDoneError then
begin
LabelTime3.Hide;
WizardForm.Caption:= ExpandConstant('{cm:Error}');
WizardForm.FinishedLabel.Font.Color:= clRed;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
end;
end;

function CheckError:boolean;
begin
result:= not ISDoneError;
end;

procedure UnpackingISDone(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:cardinal;
FindHandle1,ColFiles1,CurIndex1,tmp:integer;
ExecError:boolean;
InFilePath,OutFilePath,OutFileName:PAnsiChar;
begin
if CurStep = ssInstall then begin //Åñëè íåîáõîäèìî, ìîæíî ïîìåíÿòü íà ssPostInstall
// Óñòàíàâëèâàåì òàéìåð
pfunc := WrapTimerProc( @OnTimer, 4 );
TimerID := SetTimer( 0, 0, 100, pfunc );
intOldCurrWidth := 0;

//WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.OnClick:=@CancelButtonOnClick;
CreateControls;
WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
ISDoneCancel:=0;

// Ðàñïàêîâêà âñåõ íåîáõîäèìûõ ôàéëîâ â ïàïêó {tmp}.

ExtractTemporaryFile('unarc.dll');

#ifdef PrecompInside
ExtractTemporaryFile('CLS-precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('packjpg_dll1.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif
#ifdef MSCInside
ExtractTemporaryFile('CLS-MSC.dll');
#endif
#ifdef facompress
ExtractTemporaryFile('facompress.dll'); //óñêîðÿåò ðàñïàêîâêó .arc àðõèâîâ.
#endif
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp
#if precomp == "0.38"
ExtractTemporaryFile('precomp038.exe');
#else
#if precomp == "0.4"
ExtractTemporaryFile('precomp040.exe');
#else
#if precomp == "0.41"
ExtractTemporaryFile('precomp041.exe');
#else
#if precomp == "0.42"
ExtractTemporaryFile('precomp042.exe');
#else
ExtractTemporaryFile('precomp038.exe');
ExtractTemporaryFile('precomp040.exe');
ExtractTemporaryFile('precomp041.exe');
ExtractTemporaryFile('precomp042.exe');
#endif
#endif
#endif
#endif
#endif
#ifdef unrar
ExtractTemporaryFile('Unrar.dll');
#endif
#ifdef XDelta
ExtractTemporaryFile('XDelta3.dll');
#endif
#ifdef PackZIP
ExtractTemporaryFile('7z.dll');
ExtractTemporaryFile('PackZIP.exe');
#endif

ExtractTemporaryFile('English.ini');

// Ïîäãîòàâëèâàåì ïåðåìåííóþ, ñîäåðæàùóþ âñþ èíôîðìàöèþ î âûäåëåííûõ êîìïîíåíòàõ äëÿ ISDone.dll
// ìàêñèìóì 96 êîìïîíåíòîâ.
Comps1:=0; Comps2:=0; Comps3:=0;
#ifdef Components
TmpValue:=1;
if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue; //êîìïîíåíò 1
TmpValue:=TmpValue*2;
if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue; //êîìïîíåíò 2
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\rus') then Comps1:=Comps1+TmpValue; //êîìïîíåíò 3
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue; //êîìïîíåíò 4
// .....
// ñì. ñïðàâêó
#endif

#ifdef precomp
PCFVer:={#precomp};
#else
PCFVer:=0;
#endif
ISDoneError:=true;
if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, {#NeedMem}, @ProgressCallback) then begin
repeat
// ChangeLanguage('English');
if not SrepInit('',512,0) then break;
if not PrecompInit('',128,PCFVer) then break;
if not FileSearchInit(true) then break;

if not ISArcExtract ( 0, 0, ExpandConstant('{src}\*.arc'), ExpandConstant('{app}'), '', false, 'kis', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;

// äàëåå íàõîäÿòñÿ çàêîììåíòèðîâàíûå ïðèìåðû ðàçëè÷íûõ ôóíêöèé ðàñïàêîâêè (÷òîáû êàæäûé ðàç íå ëàçèòü â ñïðàâêó çà ïðèìåðàìè)
(*
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\arc.arc'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
if not IS7ZipExtract ( 0, 0, ExpandConstant('{src}\CODMW2.7z'), ExpandConstant('{app}\data1'), false, '') then break;
if not ISRarExtract ( 0, 0, ExpandConstant('{src}\data_*.rar'), ExpandConstant('{app}'), false, '') then break;
if not ISSRepExtract ( 0, 0, ExpandConstant('{app}\data1024_1024.srep'),ExpandConstant('{app}\data1024.arc'), true) then break;
if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data.pcf'), ExpandConstant('{app}\data.7z'), true) then break;
if not ISxDeltaExtract ( 0, 0, 0, 640, ExpandConstant('{app}\in.pcf'), ExpandConstant('{app}\*.diff'), ExpandConstant('{app}\out.dat'), false, false) then break;
if not ISPackZIP ( 0, 0, ExpandConstant('{app}\1a1\*'), ExpandConstant('{app}\1a1.pak'), 2, false ) then break;
if not ISExec ( 0, 0, 0, ExpandConstant('{tmp}\Arc.exe'), ExpandConstant('x -o+ "{src}\001.arc" "{app}\"'), ExpandConstant('{tmp}'), '...',false) then break;
if not ShowChangeDiskWindow ('Ïîæàëóéñòà, âñòàâüòå âòîðîé äèñê è äîæäèòåñü åãî èíèöèàëèçàöèè.', ExpandConstant('{src}'),'CODMW_2.arc') then break;

// ðàñïàêîâêà ãðóïïû ôàéëîâ ïîñðåäñòâîì âíåøíåãî ïðèëîæåíèÿ

FindHandle1:=ISFindFiles(0,ExpandConstant('{app}\*.ogg'),ColFiles1);
ExecError:=false;
while not ExecError and ISPickFilename(FindHandle1,ExpandConstant('{app}\'),CurIndex1,true) do begin
InFilePath:=ISGetName(0);
OutFilePath:=ISGetName(1);
OutFileName:=ISGetName(2);
ExecError:=not ISExec(0, 0, 0, ExpandConstant('{tmp}\oggdec.exe'), '"'+InFilePath+'" -w "'+OutFilePath+'"',ExpandConstant('{tmp}'),OutFileName,false);
end;
ISFindFree(FindHandle1);
if ExecError then break;
*)

ISDoneError:=false;
until true;
ISDoneStop;
end;
HideControls;
WizardForm.CancelButton.Visible:=true;
WizardForm.CancelButton.Enabled:=false;
end;
if (CurStep=ssPostInstall) and ISDoneError then begin
Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
UnpackingISDone(CurStep); // IsDone Ðàñïàêîâêà àðõèâîâ
end;

procedure CurPageChanged(CurPageID: Integer);
begin
ShowComponents(CurPageID);
UnpackingISDoneFinished(CurPageID); // IsDone Çàâåðøåíèå ðàñïàêîâêè
end;

procedure DeinitializeSetup();
begin
UnloadSkin();
KillTimer( 0, TimerID );
end;

Олег_Чернявский@vk
13-01-2014, 00:39
Помогите ! ! ! Зашёл в тупик не могу добавить шрифты в инстолятор

#define GameID "{5F05CE9B-7768-490E-9A71-C6R92B4EX123}" ;Ид инстолятора
#define MyAppName "DRZLoy Mod Pack 0.8.10" ;Название инстоллятора
#define MyInfoVer "1.0" ;Версия инсталлятора
#define MyAppVer "8.0.10" ;Версия игры
#define MyAppPublisher "DRZLoy" ;Имя компании или человека кто делал
#define MyAppURL "http://drzloywot.blogspot.com/" ;Ссылка для лого

;#include "Components.iss" ;Компаненты, они же моды
#include "Messages.iss" ;Сообщение, надписи на кнопках и т.д.

[Types]
Name: custom; Description: Full installation; Flags: iscustom

[Components]
Name: KMP; Description: DRZLoy Mod Pack; Types: custom; Flags: fixed
Name: KMP\X; Description: 1. XVM.;
Name: KMP\X\P; Description: а. Полная версия XVM; Flags: checkablealone ;
Name: KMP\X\L; Description: б. Без оленимера, версия XVM ; Flags: checkablealone ;
Name: KMP\Z; Description: 2. Модификация звуком.;
Name: KMP\Z\L; Description: a. Озвучка лампочки.;
Name: KMP\Z\G; Description: b. Озвучка перезарядки .;
Name: KMP\H; Description: 3. Модификация моделей танков .;
Name: KMP\H\T; Description: a. Серые трупы танков .; Flags: checkablealone ;
Name: KMP\P; Description: 4.Яркие платформы .;
Name: KMP\4; Description: 5.Часы .;
Name: KMP\I; Description: 6.Иконки в Ушах .;
Name: KMP\D; Description: 7.Отключение дерганья в динамической камере.;
Name: KMP\ZO; Description: 8.Многопозиционный снайперский режим.;
Name: KMP\N; Description: 9.Настраиваемое боевое меню.;
Name: KMP\K; Description: 10.Кто и чем по вам стреляли .;
Name: KMP\S; Description: 11.Блокировка выстрела по союзнику и трупам.;
Name: KMP\ZAS; Description: 12.Уведомление союзников о засвете.;
Name: KMP\PD; Description: 13.Боевой интефейс от Zayaz.;
Name: KMP\T; Description: 14.Расширенные подсказки к умениям и навыкам танкового экипажа.;


[Setup]
AppId={{#GameID}
AppName={#MyAppName}
AppVersion={#MyAppVer}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}

//====={ Ссылки }=====\\
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}

//====={ Папка устанвки }=====\\
;DefaultDirName={pf}\{#MyAppName}
DefaultDirName={code:MyDirName}
DefaultGroupName={#MyAppName}

//====={ Картинки }=====\\
SetupIconFile=Files\wot_ico.ico
WizardSmallImageFile=Files\img2.bmp
WizardImageFile=Files\img1.bmp

//====={ Отключение строниц }=====\\
DisableProgramGroupPage=yes

//====={ Лицензия и Фак }=====\\
LicenseFile=licensia.txt
InfoBeforeFile=faq.rtf

//====={ Папка создания и название сетапа }=====\\
OutputDir=.\Output
OutputBaseFilename=Setup

//====={ Сжатие сетапа }=====\\
InternalCompressLevel=ultra64
Compression=lzma2/ultra64
SolidCompression=true

//====={ Основные файлы сетапа }=====\\
[Files]
Source: Files\logo.bmp; Flags: dontcopy noencryption noencryption
//===БОльшая чать файлов==\\
Source: "MODS\MODI\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs;
//=== XVM===\\
Source: "MODS\XVM\PR\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\X\P;
Source: "MODS\XVM\L\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\X\L;

///===Модификации Звуков===\\\
Source: "{app}\res\audio\*"; DestDir: "{app}\res_mods\0.8.10\audio\"; Flags: external recursesubdirs skipifsourcedoesntexist; Components: KMP\Z\L;
Source: "MODS\ZVUKI\LAMPO4KA\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\Z\L;
Source: "{app}\res\audio\*"; DestDir: "{app}\res_mods\0.8.10\audio\"; Flags: external recursesubdirs skipifsourcedoesntexist; Components: KMP\Z\G;
Source: "MODS\ZVUKI\GOTOV\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\Z\G;
//===Текст====\\\
Source: "{app}\res\text\*"; DestDir: "{app}\res_mods\0.8.10\text\"; Flags: external recursesubdirs skipifsourcedoesntexist; Components: KMP\T;
Source: "MODS\TEXT\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\T;

// ====Модификации мира===\
Source: "MODS\PLAT\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\P;

//===Шкурки===\\
Source: "MODS\HKURKI\TRUP\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\H\T;
//===Всякая херь===\
Source: "MODS\4ASI\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\4;
Source: "MODS\IKON\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\I;
Source: "MODS\DIMCAM\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\D;
Source: "MODS\ZOM\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\ZO;
Source: "MODS\NASTRAMEN\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\N;
Source: "MODS\KTO\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\K;
Source: "MODS\SAFE\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\S;
Source: "MODS\ZASVET\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\ZAS;
Source: "MODS\PDEMAG\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: KMP\PD;



//====={ Выбор языка }=====\\
[Languages]
Name: "eng"; MessagesFile: "compiler:Default.isl"
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl"

[Code]
function MyDirName(S:String): String;
var
InsPath: String;
er: boolean;
myFile:String;
begin
Result:=ExpandConstant('C:\Games\World_of_Tanks\'); //если ключа нет то будем ставить сюда
er := RegQueryStringValue(HKLM, 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{1EAC1D02-C6AC-4FA6-9A44-96258C37C812RU}_is1', 'InstallLocation', InsPath);
if er and (InsPath<>'') then //если ключ существует и там что-то записано
begin
Result := InsPath;
end;
end;

procedure LogoOnClick(Sender: TObject);
var ResCode: Integer;
begin
ShellExec('', '{#MyAppURL}', '' , '', SW_SHOW, ewNoWait, ResCode)
end;

procedure RedesignWizardForm;
var
i: integer;
BtnPanel: TPanel;
BtnImage: TBitmapImage;

begin
ExtractTemporaryFile('logo.bmp')
BtnPanel:=TPanel.Create(WizardForm)
with BtnPanel do begin
Left:=0
Top:=315
Width:=179
Height:=46
Cursor:=crHand
OnClick:=@logoOnClick
Parent:=WizardForm
end;
BtnImage:=TBitmapImage.Create(WizardForm)
with BtnImage do begin
AutoSize:=True;
Enabled:=False;
Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\logo.bmp')
Parent:=BtnPanel
end;

with WizardForm do
begin
Caption := ExpandConstant('{cm:Main}');
end;

with WizardForm.WizardBitmapImage do
begin
Width := ScaleX(502);
end;

with WizardForm.WelcomeLabel2 do
begin
Visible := False;
end;

with WizardForm.WelcomeLabel1 do
begin
Visible := False;
end;

with WizardForm.WizardSmallBitmapImage do
begin
Left := ScaleX(0);
Width := ScaleX(502);
Height := ScaleY(70);
end;

with WizardForm.PageDescriptionLabel do
begin
Visible := False;
end;

with WizardForm.PageNameLabel do
begin
Visible := False;
end;

with WizardForm.WizardBitmapImage2 do
begin
Width := ScaleX(502);
end;

with WizardForm.FinishedLabel do
begin
Visible := False;
end;

with WizardForm.FinishedHeadingLabel do
begin
Visible := False;
end;
end;

procedure InitializeWizard();
begin
RedesignWizardForm;
end;





Название шрифтов: ANDLSO.TTF, ASROCK7SEGMENT.TTF, CONSTAN.TTF, CONSTANB.TTF, CONSTANI.TTF, CONSTANZ.TTF, CUPRUM.TTF, NeogreyMedium.otf ,NeogreyRegular.otf, XVMSymbol_4.0.ttf
Путь к шрифтам: MODS\FONTS\

NAMAT
13-01-2014, 09:12
У меня такой вопрос как сделать при установке поле в которое вписываеш слово и оно в последующем заноситься в ini файл в определенное место и сохраняеться в карневой папке установленого проекта

saurn
13-01-2014, 21:36
У меня такой вопрос как сделать при установке поле в которое вписываеш слово и оно в последующем заноситься в ini файл в определенное место и сохраняеться в карневой папке установленого проекта »
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
OutputDir=.


[INI]
Filename: {app}\Test.ini; Section: TestSection; Key: TestKey; String: {code:IniStr};


[Code]
var
InputPage: TInputQueryWizardPage;


function IniStr(const Input: String): String;
begin
Result := InputPage.Values[0];
end;


procedure InitializeWizard;
begin
InputPage := CreateInputQueryPage(wpSelectDir, 'Caption', 'Description', 'SubCaption');

InputPage.Add('Input Value:', False);
InputPage.Values[0] := 'Test_Value';
end;

habib2302
14-01-2014, 13:46
доброе время суток. как сделать так, чтобы при выборе компонента portable в SelectDirPage стояла кнопка установить вместо кнопки далее?
вот пример
Procedure CurPageChanged(CurPageID: Integer);
Begin
Case CurPageID of
wpSelectTasks:
if IsComponentSelected('VKMusic\instal') then
begin
WizardForm.NextButton.Caption:= SetupMessage(msgButtonInstall);
end;
wpSelectDir: if WizardForm.Tag = 1 then

begin
WizardForm.SelectDirPage.Notebook.ActivePage:= WizardForm.SelectComponentsPage;
WizardForm.PageNameLabel.Caption:= SetupMessage(msgWizardSelectComponents);
WizardForm.Hint:= WizardForm.PageDescriptionLabel.Caption; // çàïîìíèòü SetupMessage(msgSelectDirDesc)
WizardForm.PageDescriptionLabel.Caption:= SetupMessage(msgSelectComponentsDesc);
end;
wpSelectComponents: if WizardForm.Tag = 1 then
begin
WizardForm.SelectComponentsPage.Notebook.ActivePage:= WizardForm.SelectDirPage;
WizardForm.DiskSpaceLabel.Caption:= WizardForm.ComponentsDiskSpaceLabel.Caption;
WizardForm.PageNameLabel.Caption:= SetupMessage(msgWizardSelectDir);
WizardForm.PageDescriptionLabel.Caption:= WizardForm.Hint; // èíà÷å âìåñòî íàçâàíèÿ ïðîãðàììû [name]
if IsComponentSelected('VKMusic\Portable') then
begin
WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{src}')) + '{#MyAppName} Portable'
end;
end;
end;
end;

Shkutu
14-01-2014, 16:37
habib2302, может просто добавить аналогично твоему же примеру
Procedure CurPageChanged(CurPageID: Integer);
Begin
Case CurPageID of
wpSelectTasks:
if IsComponentSelected('VKMusic\instal') then
begin
WizardForm.NextButton.Caption:= SetupMessage(msgButtonInstall);
end;
wpSelectDir: if WizardForm.Tag = 1 then

begin
WizardForm.SelectDirPage.Notebook.ActivePage:= WizardForm.SelectComponentsPage;
WizardForm.PageNameLabel.Caption:= SetupMessage(msgWizardSelectComponents);
WizardForm.Hint:= WizardForm.PageDescriptionLabel.Caption; // çàïîìíèòü SetupMessage(msgSelectDirDesc)
WizardForm.PageDescriptionLabel.Caption:= SetupMessage(msgSelectComponentsDesc);
end;
wpSelectComponents: if WizardForm.Tag = 1 then
begin
WizardForm.SelectComponentsPage.Notebook.ActivePage:= WizardForm.SelectDirPage;
WizardForm.DiskSpaceLabel.Caption:= WizardForm.ComponentsDiskSpaceLabel.Caption;
WizardForm.PageNameLabel.Caption:= SetupMessage(msgWizardSelectDir);
WizardForm.PageDescriptionLabel.Caption:= WizardForm.Hint; // èíà÷å âìåñòî íàçâàíèÿ ïðîãðàììû [name]
if IsComponentSelected('VKMusic\Portable') then
begin
WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{src}')) + '{#MyAppName} Portable';
WizardForm.NextButton.Caption:= SetupMessage(msgButtonInstall);
end;
end;
end;
end;

saurn
14-01-2014, 20:13
habib2302,
procedure CurPageChanged(CurPageID: Integer);
begin
case CurPageID of
wpSelectDir: if IsComponentSelected('VKMusic\instal') then WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall);
end;
end;




© OSzone.net 2001-2012