[Setup]
AppVersion=1.5
AppName=My Prog
DefaultDirName=.\My Prog
OutputDir=.
Uninstallable=false
CreateUninstallRegKey=false
SetupStyleFile="compiler:.\Styles\Carbon.vsf"
DisableWelcomePage=false
//RawDataResource=Resredist>compiler:Resource\redist.txt, Resmiles>compiler:Resource\miles.txt
// тут путь к idp.iss
#include "C:\Users\ADMIN\Documents\My ISO Files\idpsetup-1.5.1\{app}\idp.iss"
[Messages]
ButtonNext=Accept
ButtonCancel=Bay
ButtonBack=Prev
ButtonInstall=Go
ButtonFinish=Chao
[Files]
Source: compiler:Resource\redist.txt; Flags: ignoreversion dontcopy noencryption
Source: compiler:Resource\miles.txt; Flags: ignoreversion dontcopy noencryption
[Run]
Filename: "{app}\license.txt"; Description: "Перейти на сайт"; Flags: postinstall shellexec unchecked
Filename: "{app}\license.txt"; Description: "Запустить обновление"; Flags: postinstall shellexec unchecked
Filename: "{app}\license.txt"; Description: "Войти на сервер с модом"; Flags: postinstall shellexec unchecked
Filename: "{app}\license.txt"; Description: "Войти на сервер без модом"; Flags: postinstall shellexec unchecked
[Code]
#define AW = (Defined UNICODE) ? "W" : "A"
#include "copymoveEx.iss"
//const
// RT_RCDATA = 10;
var
i: Integer;
FinishedHeadingLabel: TLabel;
redist, miles: TArrayOfString;
procedure CheckMod(Sender: TObject);
begin
case WizardForm.RunList.ItemIndex of
2: WizardForm.RunList.Checked[3] := False;
3: WizardForm.RunList.Checked[2] := False;
4: WizardForm.RunList.ItemIndex
end;
end;
// тут нужно чет дорабатывать
function FormatFloat(Value: LongInt): string;
var
mr, dr: longint;
begin
dr:=value mod (1024*1024)
mr:=Trunc(value/(1024*1024))
result:=IntToStr(mr)+'.'+Copy(IntToStr(dr),0,3) + ' Mb';
end;
procedure restructuring();
begin
//WizardForm.Width:=800
//WizardForm.Height:=640
WizardForm.WizardSmallBitmapImage.Hide;
WizardForm.WizardBitmapImage.Hide;
WizardForm.WizardBitmapImage2.Hide;
WizardForm.DiskSpaceLabel.Caption:='Required:' +' '+ FormatFloat(16672358);
WizardForm.DirEdit.AutoSelect:=False
WizardForm.WelcomeLabel1.Left:=ScaleX(100)
WizardForm.WelcomeLabel2.Left:=ScaleX(100)
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Left :=ScaleX(130)
WizardForm.RunList.Left:=ScaleX(150)
FinishedHeadingLabel:= TLabel.Create(WizardForm);
FinishedHeadingLabel.AutoSize:= False;
with WizardForm.FinishedHeadingLabel do
FinishedHeadingLabel.SetBounds(WizardForm.FinishedHeadingLabel.Left-ScaleX(50), WizardForm.FinishedHeadingLabel.Top, WizardForm.FinishedHeadingLabel.Width, WizardForm.FinishedHeadingLabel.Height);
FinishedHeadingLabel.Font:= WizardForm.FinishedHeadingLabel.Font
FinishedHeadingLabel.Font.Color:= clGreen;
FinishedHeadingLabel.Transparent:= True;
FinishedHeadingLabel.WordWrap:= true;
FinishedHeadingLabel.Caption:= WizardForm.FinishedHeadingLabel.Caption;
FinishedHeadingLabel.Parent:= WizardForm.FinishedPage
FinishedHeadingLabel.Caption:= WizardForm.FinishedHeadingLabel.Caption
end;
procedure downloadfiles(const url, filename: string);
begin
idpAddFile(url + filename, ExpandConstant('{tmp}\') + filename);
end;
procedure InitializeWizard();
var
i:integer;
begin
restructuring;
ExtractTemporaryFile('redist.txt')
ExtractTemporaryFile('miles.txt')
LoadStringsFromFile(ExpandConstant('{tmp}\redist.txt'), redist);
DeleteFile(ExpandConstant('{tmp}\redist.txt'));
LoadStringsFromFile(ExpandConstant('{tmp}\miles.txt'), miles);
DeleteFile(ExpandConstant('{tmp}\miles.txt'));
(* тут сервер то доступен то нет
for i := 0 to Length(redist)-1 do
downloadfiles('http://188.120.240.106:8080/188_120_240_106_28960/Redist/',redist[i]);
*)
for i := 0 to Length(miles)-1 do
downloadfiles('http://188.120.240.106:8080/188_120_240_106_28960/miles/',miles[i]);
//MsgBox('Size файлov: ' + FormatFloat(16672358), mbInformation, MB_OK);
WizardForm.RunList.OnClick := @CheckMod;
idpSetOption('DetailedMode', '1');
idpSetOption('DetailsButton', '0');
idpDownloadAfter(wpPreparing);
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
CreateBackup(ExpandConstant('{tmp}'), ExpandConstant('{app}\mods'), 'move:*.flt');
//CreateBackup(ExpandConstant('{tmp}'), ExpandConstant('{app}'), 'move:*.exe');
end;