skeptik_vdm Цитата: Вот код
А как сделать тоже самое, но на странице выбора дирректории установки
Добавлено: Всё, помощи не надо, просто поредактить один параметр надо было
Добавлено: Скажите как совместить этот код -
[more]
[Setup]
AppName=Stranglehold
AppVerName=Stranglehold
DefaultDirName=D:\Games\Stranglehold
OutputBaseFilename=Setup
Compression=lzma/ultra64
SolidCompression=yes
;+++ðåçäåëåíèå
DiskSpanning=yes
SlicesPerDisk=3
DiskSliceSize=1560000000
;---ðåçäåëåíèå
;+++Óðîâåíü êîìïðåññèè
InternalCompressLevel=ultra64
;---Óðîâåíü êîìïðåññèè
UsePreviousAppDir=false
AllowUNCPath=false
;+++Äèðåêòîðèÿ âûõîäà èíñòàëÿòîðà
OutputDir=D:\test
;---Äèðåêòîðèÿ âûõîäà èíñòàëÿòîðà Untitled-3
WizardImageFile=D:\test\str.bmp
WizardSmallImageFile=D:\test\str_small.bmp
DisableProgramGroupPage=true
UsePreviousGroup=false
DefaultGroupName=Stranglehold
VersionInfoVersion=1.0.0.0
UninstallFilesDir={app}\
DirExistsWarning=no
DisableReadyPage=true
VersionInfoCompany=© Qarmaa
AppCopyright=© Qarmaa
AppVersion=1.0.0.0
UninstallDisplayName=Stranglehold
UsePreviousSetupType=false
UsePreviousUserInfo=false
PrivilegesRequired=none
RestartIfNeededByRun=false
LanguageDetectionMethod=locale
;+++icon.ico ýòî èêîíêà èíñòàëëåðà!
;---icon.ico ýòî èêîíêà èíñòàëëåðà!
;+++Small.bmp ýòî êàðòèíêà íà âåðõó ïðîäîëãîâàòàÿ!
;---Small.bmp ýòî êàðòèíêà íà âåðõó ïðîäîëãîâàòàÿ!
AppPublisherURL=http://Qarmaa.lan
[Languages]
Name: rus; MessagesFile: compiler:\Languages\Russian.isl
[UninstallDelete]
Type: filesandordirs; Name: "{app}"
[Tasks]
Name: "desktopicon"; Description: "Ñîçäàòü ÿðëûê íà ðàáî÷åì ñòîëå";
[LangOptions]
WelcomeFontSize=10
[Icons]
Name: "{group}\Íà÷àòü èãðó"; Filename: "{app}\Binaries\Retail-Stranglehold.exe"; WorkingDir: "{app}\";
Name: "{group}\Óäàëèòü èãðó"; Filename: "{uninstallexe}";
Name: "{userdesktop}\Stranglehold"; Filename: "{app}\Binaries\Retail-Stranglehold.exe"; WorkingDir: "{app}\"; Tasks: desktopicon
[Run]
Filename: "{src}\depack.exe"; WorkingDir: "{src}"; Parameters: "x gamedata.bin -o""{app}\"" -y"; StatusMsg: "Çàâåðøåíèå óñòàíîâêè, ïîæàëóéñòà ïîäîæäèòå...";
[Files]
Source: "D:\Games\Stranglehold\*"; DestDir: "{app}"; Flags: ignoreversion createallsubdirs recursesubdirs sortfilesbyextension
Source: C:\Program Files\Inno Setup 5\Corona\logo_.bmp; DestDir: {tmp}; Flags: dontcopy
Source: C:\Program Files\Inno Setup 5\InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
[UninstallDelete]
Type: filesandordirs; Name: "{app}"
[Code]
//////////////
var
PageNameLabel, PageDescriptionLabel: TLabel;
const
NeedSize = 12902;
var
LogoImage:TBitmapImage;
LogoPanel: TPanel;
LogoLabel: TLabel;
FreeMB, TotalMB: Cardinal;
NeedSpaceLabel, FreeSpaceLabel: TLabel;
Comp1, Comp2: TCheckBox;
ProgressBar : TNewProgressBar;
ExtractFile:TNewStaticText;
Button1:TButton;
/////////
//////
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB > 1024 then
FreeSpaceLabel.Caption := 'Äîñòóïíî ìåñòî íà äèñêå: ' + FloatToStr(round(FreeMB/1024*100)/100) + ' GB'
else
FreeSpaceLabel.Caption := 'Äîñòóïíî ìåñòî íà äèñêå: ' + IntToStr(FreeMB)+ ' MB';
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled := false
else
WizardForm.NextButton.Enabled := true;
end;
//////////
procedure LogoOnClick(Sender: TObject);
var ReturnCode: Integer;
begin
ShellExec('open', 'http://rls.lan', '', '', SW_SHOWNORMAL, ewNoWait, ReturnCode)
end;
type
TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
var
TimerID: LongWord;
pfunc: LongWord;
Label1:tlabel;
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';
procedure InitializeWizard();
var
WLabel1, WLabel2: TLabel;
FLabel1, FLabel2: TLabel;
begin
////////////
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(76);
FLabel2.Left := ScaleX(176);
FLabel2.Width := ScaleX(301);
FLabel2.Height := ScaleY(53);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Font.Color:= clblack;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := 'Ïðîãðàììà óñòàíîâëåíà íà Âàø êîìïüþòåð.' #13#13
'Íàæìèòå «Çàâåðøèòü», ÷òîáû âûéòè èç ïðîãðàììû óñòàíîâêè.';
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.WizardBitmapImage.Width := WizardForm.Width;
WizardForm.WizardBitmapImage.Height := WizardForm.Height;
WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(176);
WLabel1.Top := ScaleY(16);
WLabel1.Width := ScaleX(301);
WLabel1.Height := ScaleY(54);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Font.Size := 12;
WLabel1.Font.Style := [fsBold];
WLabel1.Font.Color:= clblack;
WLabel1.ShowAccelChar := False;
WLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;
WLabel2:=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(76);
WLabel2.Left := ScaleX(176);
WLabel2.Width := ScaleX(301);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Font.Color:= clblack;
WLabel2.ShowAccelChar := False;
WLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;
WizardForm.WizardBitmapImage2.Width := WizardForm.Width;
WizardForm.WizardBitmapImage2.Height := WizardForm.Height;
FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(176);
FLabel1.Top := ScaleY(16);
FLabel1.Width := ScaleX(301);
FLabel1.Height := ScaleY(54);
FLabel1.AutoSize := False;
FLabel1.WordWrap := True;
FLabel1.Font.Size := 12;
FLabel1.Font.Style := [fsBold];
FLabel1.Font.Color:= clblack;
FLabel1.ShowAccelChar := False;
FLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
begin
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.WizardBitmapImage.Width := WizardForm.Width;
WizardForm.WizardBitmapImage.Height := WizardForm.Height;
WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(176);
WLabel1.Top := ScaleY(16);
WLabel1.Width := ScaleX(301);
WLabel1.Height := ScaleY(100);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Font.Size := 12;
WLabel1.Font.Style := [fsBold];
WLabel1.Font.Color:= clblack;
WLabel1.ShowAccelChar := False;
WLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;
WLabel2 :=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(76);
WLabel2.Left := ScaleX(176);
WLabel2.Width := ScaleX(301);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Font.Color:= clblack;
WLabel2.ShowAccelChar := False;
WLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;
WizardForm.WizardBitmapImage2.Width := WizardForm.Width;
WizardForm.WizardBitmapImage2.Height := WizardForm.Height;
FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(176);
FLabel1.Top := ScaleY(16);
FLabel1.Width := ScaleX(301);
FLabel1.Height := ScaleY(54);
FLabel1.AutoSize := False;
FLabel1.WordWrap := True;
FLabel1.Font.Size := 12;
FLabel1.Font.Style := [fsBold];
FLabel1.Font.Color:= clblack;
FLabel1.ShowAccelChar := False;
FLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(76);
FLabel2.Left := ScaleX(176);
FLabel2.Width := ScaleX(301);
FLabel2.Height := ScaleY(77);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Font.Color:= clblack;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := 'Ïðîãðàììà óñòàíîâëåíà íà Âàø êîìïüþòåð.' #13#13
'Íàæìèòå «Çàâåðøèòü», ÷òîáû âûéòè èç ïðîãðàììû óñòàíîâêè.';
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage;
end;
//////////
begin
WizardForm.DiskSpaceLabel.Hide;
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(198);
Width := ScaleX(209);
Height := ScaleY(13);
Caption := 'Òðåáóåòñÿ ìåñòî íà äèñêå: 12,6 GB' ;
end;
////////////
begin
begin
WizardForm.WizardSmallBitmapImage.Left:=0;
WizardForm.WizardSmallBitmapImage.Width:=497;
WizardForm.WizardSmallBitmapImage.Height:=58;
WizardForm.PageDescriptionLabel.Width:=300;
WizardForm.PageNameLabel.Width:=300;
end ;
begin
PageNameLabel := TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left := ScaleX(10);
Top := ScaleY(10);
Width := ScaleX(300);
Height := ScaleY(14);
AutoSize := False;
WordWrap := True;
Font.Color := clred;
Font.Style := [fsBold];
Transparent := True;
Parent := WizardForm.MainPanel;
end;
PageDescriptionLabel := TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left := ScaleX(15);
Top := ScaleY(25);
Width := ScaleX(475);
Height := ScaleY(30);
AutoSize := False;
WordWrap := True;
Font.Color := clred;
Transparent := True;
Parent := WizardForm.MainPanel;
end;
with WizardForm do
begin
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
with MainPanel do
begin
with WizardSmallBitmapImage do
begin
Left := ScaleX(0);
Top := ScaleY(0);
Width := Mainpanel.Width;
Height := MainPanel.Height;
end;
end;
end;
end;
end;
////////////IntToStr(NeedSize) + ' GB'
FreeSpaceLabel := TLabel.Create(WizardForm);
with FreeSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(216);
Width := ScaleX(209);
Height := ScaleY(13);
end;
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
end;
/////////////////
ExtractTemporaryFile('logo_.bmp');
LogoPanel := TPanel.Create(WizardForm);
with LogoPanel do
begin
Parent := WizardForm;
Left := ScaleX(8);
Top := ScaleY(323);
Width := ScaleX(165);
Height := ScaleY(28);
BevelOuter := bvNone;
end;
LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
Parent := LogoPanel;
Left := ScaleX(0);
Top := ScaleY(0);
AutoSize:=true;
ReplaceColor:=clFuchsia;
ReplaceWithColor:=clBtnFace;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo_.bmp'));
end;
LogoLabel := TLabel.Create(WizardForm);
with LogoLabel do
begin
Parent := LogoPanel;
Width := LogoPanel.Width;
Height := LogoPanel.Height;
Transparent:=True;
Cursor := crHand;
OnClick:=@LogoOnClick;
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
If CurPageID=wpFinished then KillTimer(0, TimerID);
if CurPageID = wpSelectDir then
if FreeMB < NeedSize then
begin
WizardForm.NextButton.Enabled:=False
end;
end;
[/more]
с этим:
[more]
[Code]
var
DesktopIcon: TCheckBox;
function MakeDesktopIcon: Boolean;
begin
Result:=DesktopIcon.Checked;
end;
procedure InitializeWizard();
begin
DesktopIcon := TCheckBox.Create(WizardForm);
with DesktopIcon do
begin
Parent := WizardForm.SelectDirPage;
Caption := 'Äîáàâèòü ÿðëûê íà ðàáî÷èé ñòîë';
Left := ScaleX(0);
Top := WizardForm.DirEdit.Top+35;
Width := ScaleX(400);
Height := ScaleY(15);
TabOrder := 0;
Checked := True;
end;
[/more]
ПОМОГИТЕ ПОЖАЛУЙСТА