[more]
[Setup]
AppName=The Witcher
AppVerName=The Witcher
DefaultDirName=D:\Games\The Witcher
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\wc.bmp
WizardSmallImageFile=D:\test\wc_small.bmp
DisableProgramGroupPage=true
UsePreviousGroup=false
DefaultGroupName=The Witcher
VersionInfoVersion=1.0.0.0
UninstallFilesDir={app}\
DirExistsWarning=no
DisableReadyPage=true
AppVersion=1.0.0.0
UninstallDisplayName=The Witcher
UsePreviousSetupType=false
UsePreviousUserInfo=false
PrivilegesRequired=none
RestartIfNeededByRun=false
LanguageDetectionMethod=locale
;+++icon.ico это иконка инсталлера!
setupiconfile=D:\test\4.ico
;---icon.ico это иконка инсталлера!
;+++Small.bmp это картинка на верху продолговатая!
;---Small.bmp это картинка на верху продолговатая!
[Languages]
Name: rus; MessagesFile: compiler:\Languages\Russian.isl
[UninstallDelete]
Type: filesandordirs; Name: "{app}"
[LangOptions]
WelcomeFontSize=10
[Messages]
BeveledLabel=Qarmaa Presents
[Registry]
Root: HKLM32; SubKey: SOFTWARE\CD Projekt Red\The Witcher; ValueType: none; Flags: uninsdeletekey
Root: HKLM32; SubKey: SOFTWARE\CD Projekt Red\The Witcher; ValueType: string; ValueName: InstallFolder; ValueData: {app} ; Flags: uninsdeletekeyifempty
Root: HKLM32; SubKey: SOFTWARE\CD Projekt Red\The Witcher; ValueType: string; ValueName: Language; ValueData: 14 ; Flags: uninsdeletekeyifempty
Root: HKLM32; SubKey: SOFTWARE\CD Projekt Red\Ведьмак\1.00.0000; ValueType: none; Flags: uninsdeletekey
[Icons]
Name: "{group}\Начать игру"; Filename: "{app}\launcher.exe"; WorkingDir: "{app}\";
Name: "{group}\Удалить игру"; Filename: "{uninstallexe}";
Name: "{userdesktop}\The Witcher"; Filename: "{app}\launcher.exe"; WorkingDir: "{app}\";
Name: "{userdesktop}\!ПЕРЕД ЗАПУСКОМ ИГРЫ, ЗАПУСТИТЬ ЭТО!"; Filename: "{app}\NS-TW_SS-poseden.mds"; WorkingDir: "{app}\";
[Run]
Filename: "{src}\depack.exe"; WorkingDir: "{src}"; Parameters: "x data.wc -o""{app}\Data\"" -y"; StatusMsg: "Завершение установки, пожалуйста подождите...";
;DereX
Filename: {src}\DirectX\dxsetup.exe; Parameters: /silent; StatusMsg: Идет установка дополнительных программ...; Check: InstallDop
;PhysX
Filename: {src}\Redistributables\PhysX_SystemSoftware.exe; Parameters: /quiet; StatusMsg: Идет установка дополнительных программ...; Check: InstallDop
[Files]
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}"
[Buttons]
ButtonNext=&Далее >
[Code]
//////////////
var
PageNameLabel, PageDescriptionLabel: TLabel;
DesktopIcon,Dop: TCheckBox;
const
NeedSize = 7298;
var
FreeMB, TotalMB: Cardinal;
NeedSpaceLabel, FreeSpaceLabel: TLabel;
Comp1, Comp2: TCheckBox;
ProgressBar : TNewProgressBar;
ExtractFile:TNewStaticText;
/////////
Function InstallDop:Boolean;
begin
Result:=Dop.Checked;
end;
function MakeDesktopIcon: Boolean;
begin
Result:=DesktopIcon.Checked;
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 := 'Доступно место на диске: ' + 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://free-torrents.org/forum/', '', '', 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
DesktopIcon := TCheckBox.Create(WizardForm);
DesktopIcon.Parent := WizardForm.SelectDirPage;
DesktopIcon.Caption := 'Добавить ярлык на рабочий стол';
DesktopIcon.Left := ScaleX(0);
DesktopIcon.Top := ScaleY(WizardForm.DirEdit.Top + 35);
DesktopIcon.Width := ScaleX(400);
DesktopIcon.Height := ScaleY(15);
DesktopIcon.TabOrder := 0;
DesktopIcon.Checked := True;
dop := TCheckBox.Create(WizardForm);
with Dop do
begin
Parent := WizardForm.SelectDirPage;
Caption := 'Установить дополнительные программы (рекомендуется)';
Left := ScaleX(0);
Top := WizardForm.DirEdit.Top+55;
Width := ScaleX(400);
Height := ScaleY(15);
TabOrder := 0;
Checked := True;
end;
////////////
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:= clwhite;
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:= clwhite;
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:= clwhite;
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:= clwhite;
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:= clwhite;
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:= clwhite;
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:= clwhite;
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:= clwhite;
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 := 'Требуется место на диске: 7,04 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 := clwhite;
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 := clwhite;
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;
/////////////////
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 begin
WizardForm.NextButton.Caption:='Установить';
if FreeMB < NeedSize
then WizardForm.NextButton.Enabled:=False;
end;
end;
[/more]
Добавлено: Там несколько процедур лишних