Скрытый текст
#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"
//---Сюда вставлять include---\\
#include "SHFileOperation.iss";
[Setup]
; Примечание: Значение AppId идентифицирует это приложение.
; Не используйте одно и тоже значение в разных установках.
; (Для генерации значения GUID, нажмите Инструменты | Генерация GUID.)
AppId={{FD7CFF3B-3C19-4FAE-A164-CA3A90B2C135}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "default"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "D:\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; Примечание: Не используйте "Flags: ignoreversion" для системных файлов
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[code]
//---Сюда вставлять скрипт---\\
var
BackupPage: TWizardPage;
DeleteRadioButton, MoveRadioButton, NoneRadioButton: TNewRadioButton;
const
BackupDescText =
'Во избежание проблем совместимости и конфликтов между модификациями рекомендуется удалить уже установленные на данный момент в игровом клиенте.' #13#13 'Выберите необходимый пункт из представленных. При этом будет очищено содержимое папки "res_mods\0.8.11", удалена папка "res_mods\xvm" или созданы резервные копии Ваших файлов.';
DeleteDescText =
'Установщик удалит все файлы в папках.';
MoveDescText =
'Установщик сделает резервную копию всех файлов в папках.';
NoneDescText =
'Установщик оставит всё как есть.';
function BackupCheck_1(): Boolean;
var
BackupDescLabel, DeleteDescLabel, MoveDescLabel, NoneDescLabel: TLabel;
begin
BackupPage:=CreateCustomPage(wpWelcome, 'Создание резервных копий файлов перед установкой', 'Пожалуйста, прочтите следующую важную информацию перед тем, как продолжить.');
BackupDescLabel:=TLabel.Create(WizardForm);
BackupDescLabel.Parent:=BackupPage.Surface;
BackupDescLabel.Left:=0;
BackupDescLabel.Top:=0;
BackupDescLabel.Width:=BackupPage.SurfaceWidth;
BackupDescLabel.Height:=90;
BackupDescLabel.AutoSize:=False;
BackupDescLabel.Wordwrap:=True;
BackupDescLabel.Caption:=BackupDescText;
DeleteRadioButton:=TNewRadioButton.Create(WizardForm);
DeleteRadioButton.Parent:=BackupPage.Surface;
DeleteRadioButton.Checked:=False;
DeleteRadioButton.Top:=95;
DeleteRadioButton.Width:=BackupPage.SurfaceWidth;
DeleteRadioButton.Font.Style:=[fsBold];
DeleteRadioButton.Font.Size:=9;
DeleteRadioButton.Caption:='Удалить файлы'
DeleteDescLabel:=TLabel.Create(WizardForm);
DeleteDescLabel.Parent:=BackupPage.Surface;
DeleteDescLabel.Left:=18;
DeleteDescLabel.Top:=DeleteRadioButton.Top + DeleteRadioButton.Height + 4;
DeleteDescLabel.Width:=BackupPage.SurfaceWidth;
DeleteDescLabel.Height:=40;
DeleteDescLabel.AutoSize:=False;
DeleteDescLabel.Wordwrap:=True;
DeleteDescLabel.Caption:=DeleteDescText;
MoveRadioButton:=TNewRadioButton.Create(WizardForm);
MoveRadioButton.Parent:=BackupPage.Surface;
MoveRadioButton.Checked:=True;
MoveRadioButton.Top:=140;
MoveRadioButton.Width:=BackupPage.SurfaceWidth;
MoveRadioButton.Font.Style:=[fsBold];
MoveRadioButton.Font.Size:=9;
MoveRadioButton.Caption:='Сделать резервную копию файлов'
MoveDescLabel:=TLabel.Create(WizardForm);
MoveDescLabel.Parent:=BackupPage.Surface;
MoveDescLabel.Left:=18;
MoveDescLabel.Top:=MoveRadioButton.Top + MoveRadioButton.Height + 4;
MoveDescLabel.Width:=BackupPage.SurfaceWidth;
MoveDescLabel.Height:=40;
MoveDescLabel.AutoSize:=False;
MoveDescLabel.Wordwrap:=True;
MoveDescLabel.Caption:=MoveDescText;
NoneRadioButton:=TNewRadioButton.Create(WizardForm);
NoneRadioButton.Parent:=BackupPage.Surface;
NoneRadioButton.Checked:=False;
NoneRadioButton.Top:=185;
NoneRadioButton.Width:=BackupPage.SurfaceWidth;
NoneRadioButton.Font.Style:=[fsBold];
NoneRadioButton.Font.Size:=9;
NoneRadioButton.Caption:='Ничего не трогать'
NoneDescLabel:=TLabel.Create(WizardForm);
NoneDescLabel.Parent:=BackupPage.Surface;
NoneDescLabel.Left:=18;
NoneDescLabel.Top:=NoneRadioButton.Top + NoneRadioButton.Height + 4;
NoneDescLabel.Width:=BackupPage.SurfaceWidth;
NoneDescLabel.Height:=40;
NoneDescLabel.AutoSize:=False;
NoneDescLabel.Wordwrap:=True;
NoneDescLabel.Caption:=NoneDescText;
end;
function BackupCheck_2(): Boolean;
begin
If DeleteRadioButton.Checked then
begin
DelTree(ExpandConstant('{app}\res_mods\0.8.11'), True, True, True);
DelTree(ExpandConstant('{app}\res_mods\xvm'), True, True, True);
CreateDir(ExpandConstant('{app}\res_mods\0.8.11'));
end;
end;
function BackupCheck_3(): Boolean;
begin
If MoveRadioButton.Checked then
begin
MoveDir(ExpandConstant('{app}\res_mods\0.8.11\'),ExpandConstant('{app}\res_mods\backup\0.8.11'));
MoveDir(ExpandConstant('{app}\res_mods\xvm\'),ExpandConstant('{app}\res_mods\backup\xvm'));
CreateDir(ExpandConstant('{app}\res_mods\0.8.11'));
DelTree(ExpandConstant('{app}\res_mods\xvm'), True, True, True);
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
If CurStep=ssInstall then
begin
BackupCheck_2();
BackupCheck_3();
end;
end;
procedure InitializeWizard();
begin
BackupCheck_1();
end;
Скрытый текст
[Setup]
WizardSmallImageFile=C:\Users\PowerTanks\Desktop\Без имени-1.bmp
WizardImageFile=D:\FFOutput\PowerTanks.bmp
AppName=PowerTanks ModPack-0.9.2-Extendet
AppVerName=1
DefaultDirName={code:MyDirName}
Compression=lzma/max
SetupIconFile=D:\Mods\Иконки проги и т.д\powertanks.ico
AppId={{DE24C6EE-F032-412E-8A6D-A594EA2C8BF5}
AppVersion=[2]
DefaultGroupName=PowerTanks ModPack-0.9.2-Extendet
[Files]
//------- ваши картинки ------------
Source: 5.bmp; Flags: dontcopy nocompression
Source: 6.bmp; Flags: dontcopy nocompression
//------- ваши файлы ------------
Source: BELIE TRUPI\*; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: BT;
Source: KRUG15M\*; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: K5;
[Components]
Name: BT; Description: 1.Белые трупы таков.;
Name: K5; Description: 2.Круг 15м.;
[code]
{ RedesignWizardFormBegin } // Не удалять эту строку!
// Не изменять эту секцию. Она создана автоматически.
var
OldEvent_BackButtonClick: TNotifyEvent;
procedure WizardFormCreate(Sender: TObject); forward;
procedure MainPanelClick(Sender: TObject); forward;
procedure PageDescriptionLabelClick(Sender: TObject); forward;
procedure _BackButtonClick(Sender: TObject); forward;
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 RedesignWizardForm;
begin
with WizardForm do
begin
OnCreate := @WizardFormCreate;
AutoScroll := False;
ClientHeight := ScaleY(490);
ClientWidth := ScaleX(740);
end;
with WizardForm.Bevel do
begin
Top := ScaleY(243);
Width := ScaleX(457);
Height := ScaleY(70);
end;
with WizardForm.OuterNotebook do
begin
Width := ScaleX(745);
Height := ScaleY(457);
end;
with WizardForm.WizardBitmapImage do
begin
Width := ScaleX(740);
Height := ScaleY(458);
end;
with WizardForm.WelcomeLabel2 do
begin
Caption := '' + #13#10 +
'';
Left := ScaleX(744);
Top := ScaleY(-23);
Width := ScaleX(125);
Height := ScaleY(25);
end;
with WizardForm.WelcomeLabel1 do
begin
Caption := '';
Left := ScaleX(744);
Top := ScaleY(-23);
Width := ScaleX(13);
Height := ScaleY(25);
end;
with WizardForm.Bevel1 do
begin
Top := ScaleY(57);
Width := ScaleX(523);
Height := ScaleY(1);
end;
with WizardForm.InnerNotebook do
begin
Width := ScaleX(659);
Height := ScaleY(357);
end;
with WizardForm.LicenseNotAcceptedRadio do
begin
Top := ScaleY(312);
end;
with WizardForm.LicenseAcceptedRadio do
begin
Top := ScaleY(292);
end;
with WizardForm.LicenseMemo do
begin
Width := ScaleX(617);
Height := ScaleY(244);
end;
with WizardForm.DiskSpaceLabel do
begin
Top := ScaleY(344);
Width := ScaleX(353);
end;
with WizardForm.DirBrowseButton do
begin
Left := ScaleX(574);
Top := ScaleY(79);
end;
with WizardForm.DirEdit do
begin
Left := ScaleX(16);
Width := ScaleX(540);
end;
with WizardForm.ComponentsDiskSpaceLabel do
begin
Top := ScaleY(344);
Width := ScaleX(273);
end;
with WizardForm.ComponentsList do
begin
Width := ScaleX(657);
Height := ScaleY(227);
end;
with WizardForm.TypesCombo do
begin
Width := ScaleX(657);
end;
with WizardForm.SelectComponentsLabel do
begin
Caption := 'Выберите моды которые хотите установить, и нажмите далее';
Height := ScaleY(16);
end;
with WizardForm.TasksList do
begin
Width := ScaleX(465);
Height := ScaleY(240);
end;
with WizardForm.ReadyMemo do
begin
Width := ScaleX(657);
Height := ScaleY(333);
end;
with WizardForm.ProgressGauge do
begin
Left := ScaleX(8);
Width := ScaleX(641);
end;
with WizardForm.InfoAfterMemo do
begin
Width := ScaleX(465);
Height := ScaleY(253);
end;
with WizardForm.MainPanel do
begin
Width := ScaleX(745);
Height := ScaleY(66);
OnClick := @MainPanelClick;
end;
with WizardForm.WizardSmallBitmapImage do
begin
Left := ScaleX(0);
Top := ScaleY(3);
Width := ScaleX(735);
Height := ScaleY(63);
end;
with WizardForm.PageDescriptionLabel do
begin
OnClick := @PageDescriptionLabelClick;
Left := ScaleX(-288);
Top := ScaleY(-5);
Width := ScaleX(285);
Height := ScaleY(5);
end;
with WizardForm.PageNameLabel do
begin
Left := ScaleX(-104);
Top := ScaleY(-14);
Width := ScaleX(101);
end;
with WizardForm.WizardBitmapImage2 do
begin
Top := ScaleY(-24);
Width := ScaleX(740);
Height := ScaleY(484);
end;
with WizardForm.RunList do
begin
Left := ScaleX(-128);
Top := ScaleY(459);
Width := ScaleX(125);
Height := ScaleY(62);
end;
with WizardForm.NoRadio do
begin
Left := ScaleX(736);
Top := ScaleY(-7);
Width := ScaleX(245);
Height := ScaleY(9);
Caption := '';
end;
with WizardForm.YesRadio do
begin
Left := ScaleX(736);
Top := ScaleY(459);
Width := ScaleX(173);
Height := ScaleY(1);
Caption := '';
end;
with WizardForm.FinishedLabel do
begin
Caption := '';
Left := ScaleX(736);
Top := ScaleY(-57);
Width := ScaleX(269);
Height := ScaleY(59);
end;
with WizardForm.FinishedHeadingLabel do
begin
Caption := '';
Left := ScaleX(736);
Top := ScaleY(-16);
Width := ScaleX(213);
Height := ScaleY(18);
end;
with WizardForm.BeveledLabel do
begin
Left := ScaleX(-48);
Top := ScaleY(402);
end;
with WizardForm.CancelButton do
begin
Left := ScaleX(617);
Top := ScaleY(463);
end;
with WizardForm.NextButton do
begin
Left := ScaleX(533);
Top := ScaleY(463);
end;
with WizardForm.BackButton do
begin
Left := ScaleX(445);
Top := ScaleY(463);
OldEvent_BackButtonClick := OnClick;
OnClick := @_BackButtonClick;
end;
{ ReservationBegin }
// Вы можете добавить ваш код здесь.
{ ReservationEnd }
end;
// Не изменять эту секцию. Она создана автоматически.
{ RedesignWizardFormEnd } // Не удалять эту строку!
procedure NewButton1Click(Sender: TObject);
begin
end;
procedure MainPanelClick(Sender: TObject);
begin
end;
procedure PageDescriptionLabelClick(Sender: TObject);
begin
end;
procedure _BackButtonClick(Sender: TObject);
begin
OldEvent_BackButtonClick(Sender);
end;
procedure WizardFormCreate(Sender: TObject);
begin
end;
const
UNDEF_INDEX = -777;
function GetCursorPos(var lpPoint: TPoint): BOOL; external 'GetCursorPos@user32.dll stdcall';
var
InfoPic: TBitmapImage;
LastIndex: Integer;
TempPath: String;
procedure ShowPicHint(const PicFilePath: String);
var
pt: TPoint;
begin
if not GetCursorPos(pt) then Exit;
InfoPic.Bitmap.LoadFromFile(PicFilePath);
InfoPic.SetBounds(ScaleX(360), ScaleY(40), ScaleX(290), ScaleY(278));
InfoPic.Show;
end;
procedure CompOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea);
var
UndefPic: String;
begin
if Index = -1 then Exit;
if Index = LastIndex then Exit;
try
case TNewCheckListBox(Sender).ItemCaption[Index] of
'2.Белые трупы танков.': UndefPic := '5.bmp'; // пишем точно так же, как прописано в компонентах
'4.Боевое меню TRJ.': UndefPic := '6.bmp';
else
begin
LastIndex := UNDEF_INDEX;
InfoPic.Hide;
Exit;
end;
end;
if not FileExists(TempPath + UndefPic) then ExtractTemporaryFile(UndefPic);
ShowPicHint(TempPath + UndefPic);
finally
LastIndex := Index;
end;
end;
procedure CompOnMouseLeave(Sender: TObject);
begin
InfoPic.Hide;
LastIndex := -1;
end;
procedure InitInfo();
begin
WizardForm.TypesCombo.Hide;
WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(40), ScaleX(310), ScaleY(278));
WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
TempPath := AddBackslash(ExpandConstant('{tmp}'));
LastIndex := UNDEF_INDEX;
with TBevel.Create(WizardForm) do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(360), ScaleY(40), ScaleX(290), ScaleY(278));
Shape := bsFrame;
end;
InfoPic := TBitmapImage.Create(WizardForm)
with InfoPic do
begin
Parent := WizardForm.SelectComponentsPage;
AutoSize := True;
end;
end;
procedure InitializeWizard();
begin
RedesignWizardForm;
InitInfo();
end;
[ISFormDesigner]
WizardForm=FF0A005457495A415244464F524D0030101812000054504630F10B5457697A617264466F726D0A57697A61726 4466F726D0C436C69656E7448656967687403EA010B436C69656E74576964746803E402134F6E436F6E73747261696E65645 26573697A65071057697A617264466F726D437265617465084F6E437265617465071057697A617264466F726D43726561746 50C4578706C696369744C65667402000B4578706C69636974546F7002000D4578706C69636974576964746803F4020E45787 06C696369744865696768740310020D506978656C73506572496E636802600A54657874486569676874020D00F1065442657 6656C05426576656C03546F7003F30005576964746803C9010648656967687402460B4578706C69636974546F7003F3000D4 578706C69636974576964746803C9010E4578706C6963697448656967687402460000F302010C544E65774E6F7465626F6F6 B0D4F757465724E6F7465626F6F6B05576964746803E9020648656967687403C9010D4578706C69636974576964746803E90 20E4578706C6963697448656967687403C90100F110544E65774E6F7465626F6F6B506167650B57656C636F6D65506167650 D4578706C69636974576964746803F1010E4578706C6963697448656967687403390100F10C544269746D6170496D6167651 157697A6172644269746D617
Помогите пожалуйста соединить два верхних скрипта