Jump to content
Korean Random
EvilAlex

Создание инсталляторов для модпаков на базе Inno Setup

Recommended Posts

у меня нет фото редактора 

ну тогда просто на телефон сфоткай закинь на файлообменник и так покажи)) не проблема же))) 

Share this post


Link to post

Short link
Share on other sites

не поверишь я не знаю как  на компе делать скриншоты  или прога нужна

В Гугле вроде баны давно не раздавали. Поискать никак?

  • Upvote 2

Share this post


Link to post

Short link
Share on other sites

В Гугле вроде баны давно не раздавали. Поискать никак?

ты это к чему

Share this post


Link to post

Short link
Share on other sites

я смотрю норм у вас тут беседа.

там ошибка ссылается на неверное имя файла

упс-с-с... забыл флаги приписать в секции [Run]

"вот так будет работать"

[Tasks]
Name: "gotositeone"; Description: "Перейти на первый сайт после окончания установки"; GroupDescription: "Дополнительные задачи:"
Name: "gotositetwo"; Description: "Перейти на второй сайт после окончания установки"; GroupDescription: "Дополнительные задачи:"

[Run]
Filename: http://bla.ru/; Flags: shellexec; Tasks: gotositeone
Filename: http://blabla.ru/; Flags: shellexec; Tasks: gotositetwo

Edited by Gad575

Share this post


Link to post

Short link
Share on other sites

я смотрю норм. у вас тут беседа.

упс-с-с... забыл флаги приписать в секции [Run]

"вот так будет работать"

[Tasks]
Name: "gotositeone"; Description: "Перейти на первый сайт после окончания установки"; GroupDescription: "Дополнительные задачи:"
Name: "gotositetwo"; Description: "Перейти на второй сайт после окончания установки"; GroupDescription: "Дополнительные задачи:"

[Run]
Filename: http://bla.ru/; Flags: shellexec; Tasks: gotositeone
Filename: http://blabla.ru/; Flags: shellexec; Tasks: gotositetwo

СПС 

Share this post


Link to post

Short link
Share on other sites

раньше работало а сейчас ошибку выдаёт

 


[Tasks]
Name: "gotositeone"; Description: "Перейти на первый сайт после окончания установки"; GroupDescription: "Дополнительные задачи:"
Name: "gotositetwo"; Description: "Перейти на второй сайт после окончания установки"; GroupDescription: "Дополнительные задачи:"

[Run]
Filename: http://bla.ru/; Flags: shellexec; Tasks: gotositeone
Filename: http://blabla.ru/; Flags: shellexec; Tasks: gotositetwo

post-36801-0-40796800-1479147668_thumb.png

post-36801-0-93318400-1479150062_thumb.png

Edited by sergy2010

Share this post


Link to post

Short link
Share on other sites

а почему у меня работает, гений ты наш? давай-ка в ЛС это обсудим

я разобрался это всё дело в браузере только незнаю почему но щя всё работает

гугл был в помощ

Edited by sergy2010

Share this post


Link to post

Short link
Share on other sites

Подскажите, как сделать чтобы при наведении мышкой на название мода появлялась картинка? Как сделать чтобы файл удаления мод пака устанавливался в определенную папку?

Share this post


Link to post

Short link
Share on other sites

Подскажите, как сделать чтобы при наведении мышкой на название мода появлялась картинка? Как сделать чтобы файл удаления мод пака устанавливался в определенную папку?

1. Вот тут очень сырой и глючный скрипт, но "бесплатно и без регистрации": тык!

2. Вот так:

[Setup]
UninstallFilesDir={app}\Install_Amway921_Modpack

Share this post


Link to post

Short link
Share on other sites

 

1. Вот тут очень сырой и глючный скрипт, но "бесплатно и без регистрации": тык!

2. Вот так:

[Setup]
UninstallFilesDir={app}\Install_Amway921_Modpack

А смысл в этом глючном скрипте?

 

А платный есть у Вас?

Edited by GT_22rus

Share this post


Link to post

Short link
Share on other sites

Подскажите, как сделать чтобы при наведении мышкой на название мода появлялась картинка?

[Setup]
AppName=Моя программа
AppVersion=1.5
DefaultDirName={pf}\Моя программа
[CustomMessages]
CompName1=Компонент 1
CompName2=Компонент 2
ComponentsImgInfo=Наведите курсор мыши на компонент, чтобы посмотреть его превью.
CompDesc1=Описание первого компонента
CompDesc2=Описание второго компонента
[Files]
Source: "compiler:WizModernImage.bmp"; DestName: "CompDescImg1.bmp"; Flags: dontcopy
Source: "compiler:WizModernImage-IS.bmp"; DestName: "CompDescImg2.bmp"; Flags: dontcopy
Source: "compiler:WizModernImage.bmp"; DestName: "MainPic.bmp"; Flags: dontcopy
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Components]
Name: comp1; Description: "{cm:CompName1}"; Types: full
Name: comp2; Description: "{cm:CompName2}"; Types: full
Name: comp3; Description: "{cm:CompName1}"; Types: full
Name: comp4; Description: "{cm:CompName2}"; Types: full
Name: comp5; Description: "{cm:CompName1}"; Types: full
Name: comp6; Description: "{cm:CompName2}"; Types: full
Name: comp7; Description: "{cm:CompName1}"; Types: full
Name: comp8; Description: "{cm:CompName2}"; Types: full
[Code]
type
  TComponentDesc = record
    ImageName: String;
    Index: Integer;
  end;
var
  CompDescs: array of TComponentDesc;
  CompDescImgPanel: TPanel;
  CompIndex, LastIndex: Integer;
  CompDescImg: TBitmapImage;
procedure ShowCompDescription(Sender: TObject; X, Y, Index: Integer; Area: TItemArea);
var
  i: Integer;
begin
  if Index = LastIndex then Exit;
  CompIndex := -1;
  for i := 0 to GetArrayLength(CompDescs) -1 do
  begin
    if (CompDescs[i].Index = Index) then
    begin
      CompIndex := i;
      Break;
    end;
  end;
  if (CompIndex >= 0) and (Area = iaItem) then
  begin
    if not FileExists(ExpandConstant('{tmp}\') + CompDescs[CompIndex].ImageName) then
      ExtractTemporaryFile(CompDescs[CompIndex].ImageName);
    CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\') + CompDescs[CompIndex].ImageName);
   CompDescImg.Show;
end else
begin
CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp'));
end;
LastIndex := Index;
end;
procedure CompListMouseLeave(Sender: TObject);
begin
  LastIndex := -1;
CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp'));
end;
procedure AddCompDescription(AIndex: Integer; AImageName: String);
var
  i: Integer;
begin
  i := GetArrayLength(CompDescs);
  SetArrayLength(CompDescs, i + 1);
  CompDescs[i].ImageName := AImageName;
  CompDescs[i].Index := AIndex - 1
end;
function GetComponentIndex(Name: String): Integer;
var
  i: Integer;
begin
  Result:= -1;
  for i:= 0 to WizardForm.ComponentsList.ItemCount-1 do begin
    if (WizardForm.ComponentsList.ItemCaption[i] = Name) then begin
      Result:= i + 1;
      Break;
    end;
  end;
end;
procedure InitializeWizard();
begin
  ExtractTemporaryFile('MainPic.bmp');
  WizardForm.SelectComponentsLabel.Hide;
  WizardForm.TypesCombo.Hide;
  WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(0), ScaleX(184), ScaleY(200));
  WizardForm.ComponentsList.OnItemMouseMove:= @ShowCompDescription;
  WizardForm.ComponentsList.OnMouseLeave := @CompListMouseLeave;
  CompDescImgPanel := TPanel.Create(WizardForm);
  with CompDescImgPanel do
  begin
    Parent := WizardForm.SelectComponentsPage;
    SetBounds(ScaleX(192), ScaleY(0), ScaleX(225), ScaleY(120));
    BevelInner := bvLowered;
  end;
  CompDescImg := TBitmapImage.Create(WizardForm);
  with CompDescImg do
  begin
    Parent := CompDescImgPanel;
    SetBounds(ScaleX(5), ScaleY(5), CompDescImgPanel.Width - ScaleX(10), CompDescImgPanel.Height - ScaleY(10));
    Stretch := True;
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp'));
  end;
  AddCompDescription(GetComponentIndex(CustomMessage('CompName1')), 'CompDescImg1.bmp');  //по названию компонента
  AddCompDescription(GetComponentIndex(CustomMessage('CompName2')), 'CompDescImg2.bmp');  //по названию компонента
end;

Как сделать чтобы файл удаления мод пака устанавливался в определенную папку?

[Setup]
UninstallFilesDir={app}\DirName 

А платный есть у Вас?

:heh:

Edited by Gad575

Share this post


Link to post

Short link
Share on other sites

Весь топ почти перелопатил, уже в глазах рябит... 

Подскажите как совместить скрипт бекап

; BackUpPage - отдельная страница для реализации резервного копирования файлов с выбором параметров

; Автор: AtotIK

#include "SHFileOperation.iss";


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;

 

и картинки при наведении

[code]

#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif

const
UNDEF_INDEX = -777;
ALPHA_BLEND_LEVEL = 255; // max=Byte=255

WS_EX_LAYERED = $80000;
WS_EX_TRANSPARENT = $20;
LWA_COLORKEY = 1;
LWA_ALPHA = 2;
GWL_EXSTYLE = (-20);


var
InfoPic: TBitmapImage;
LastIndex: Integer;
TempPath: String;
PicForm: TForm;


type
COLORREF = DWORD;


function GetCursorPos(var lpPoint: TPoint): BOOL; external '[email protected] stdcall';
function SetLayeredWindowAttributes(Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; external '[email protected] stdcall';
function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLong{#A}@user32.dll stdcall';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall';
function SetFocus(hWnd: HWND): HWND; external '[email protected] stdcall';


procedure ShowPicHint(const PicFilePath: String);
var
pt: TPoint;
begin
if not GetCursorPos(pt) then Exit;
InfoPic.Bitmap.LoadFromFile(PicFilePath);
try
with PicForm do
begin
SetBounds(ScaleX(pt.x + 390), ScaleY(pt.y + 7), InfoPic.Width, InfoPic.Height);
Show;
end;
finally
SetFocus(WizardForm.Handle);
end;
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
'1.Отражение броней(unKnown_bot).': UndefPic := '1-Забл броней урон.bmp';
'2.Радар (тылы).': UndefPic := 'Радар.bmp';
'3.Командирская камера (koshnaranek).': UndefPic := 'Командирская камера.bmp';
'4.Таймер сведения орудия в бою (Ekspoint).': UndefPic := 'таймер сведения.bmp';
'5.Винтик.': UndefPic := 'винтик.bmp';

else
begin
LastIndex := UNDEF_INDEX;
PicForm.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
PicForm.Hide;
LastIndex := -1;
end;


procedure InitInfo();
begin
WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
TempPath := AddBackslash(ExpandConstant('{tmp}'));
LastIndex := UNDEF_INDEX;
PicForm := TForm.Create(WizardForm)
with PicForm do
begin
BorderStyle := bsNone;
FormStyle := fsStayOnTop;
InfoPic := TBitmapImage.Create(PicForm)
with InfoPic do
begin
Parent := PicForm;
AutoSize := True;
end;
end;
SetWindowLong(PicForm.Handle, GWL_EXSTYLE, GetWindowLong(PicForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(PicForm.Handle, 0, ALPHA_BLEND_LEVEL, LWA_ALPHA);
end;


procedure InitializeWizard();
begin
InitInfo();
end;

 

по отдельности все работает! совместить не могу! (( 

Share this post


Link to post

Short link
Share on other sites

Подскажите как совместить

'вот так'

#define WotVersion "0.9.16"
#include "SHFileOperation.iss";

[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\{#WotVersion}'), True, True, True);
DelTree(ExpandConstant('{app}\res_mods\configs'), True, True, True);
DelTree(ExpandConstant('{app}\res_mods\mods'), True, True, True);
CreateDir(ExpandConstant('{app}\res_mods\{#WotVersion}'));
end;
end;

function BackupCheck_3(): Boolean;
begin
If MoveRadioButton.Checked then
begin
MoveDir(ExpandConstant('{app}\res_mods\{#WotVersion}\'),ExpandConstant('{app}\res_mods\backup\{#WotVersion}'));
MoveDir(ExpandConstant('{app}\res_mods\configs\'),ExpandConstant('{app}\res_mods\backup\configs'));
MoveDir(ExpandConstant('{app}\res_mods\mods\'),ExpandConstant('{app}\res_mods\backup\mods'));
CreateDir(ExpandConstant('{app}\res_mods\{#WotVersion}'));
DelTree(ExpandConstant('{app}\res_mods\configs'), True, True, True);
DelTree(ExpandConstant('{app}\res_mods\mods'), True, True, True);
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
If CurStep=ssInstall then
begin
BackupCheck_2();
BackupCheck_3();
end;
end;

procedure InitializeWizard1();
begin
BackupCheck_1();
end;

#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif

const
UNDEF_INDEX = -777;
ALPHA_BLEND_LEVEL = 255; // max=Byte=255

WS_EX_LAYERED = $80000;
WS_EX_TRANSPARENT = $20;
LWA_COLORKEY = 1;
LWA_ALPHA = 2;
GWL_EXSTYLE = (-20);


var
InfoPic: TBitmapImage;
LastIndex: Integer;
TempPath: String;
PicForm: TForm;


type
COLORREF = DWORD;


function GetCursorPos(var lpPoint: TPoint): BOOL; external '[email protected] stdcall';
function SetLayeredWindowAttributes(Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; external '[email protected] stdcall';
function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLong{#A}@user32.dll stdcall';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall';
function SetFocus(hWnd: HWND): HWND; external '[email protected] stdcall';


procedure ShowPicHint(const PicFilePath: String);
var
pt: TPoint;
begin
if not GetCursorPos(pt) then Exit;
InfoPic.Bitmap.LoadFromFile(PicFilePath);
try
with PicForm do
begin
SetBounds(ScaleX(pt.x + 390), ScaleY(pt.y + 7), InfoPic.Width, InfoPic.Height);
Show;
end;
finally
SetFocus(WizardForm.Handle);
end;
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
'1.Отражение броней(unKnown_bot).': UndefPic := '1-Забл броней урон.bmp';
'2.Радар (тылы).': UndefPic := 'Радар.bmp';
'3.Командирская камера (koshnaranek).': UndefPic := 'Командирская камера.bmp';
'4.Таймер сведения орудия в бою (Ekspoint).': UndefPic := 'таймер сведения.bmp';
'5.Винтик.': UndefPic := 'винтик.bmp';

else
begin
LastIndex := UNDEF_INDEX;
PicForm.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
PicForm.Hide;
LastIndex := -1;
end;


procedure InitInfo();
begin
WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
TempPath := AddBackslash(ExpandConstant('{tmp}'));
LastIndex := UNDEF_INDEX;
PicForm := TForm.Create(WizardForm)
with PicForm do
begin
BorderStyle := bsNone;
FormStyle := fsStayOnTop;
InfoPic := TBitmapImage.Create(PicForm)
with InfoPic do
begin
Parent := PicForm;
AutoSize := True;
end;
end;
SetWindowLong(PicForm.Handle, GWL_EXSTYLE, GetWindowLong(PicForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(PicForm.Handle, 0, ALPHA_BLEND_LEVEL, LWA_ALPHA);
end;


procedure InitializeWizard2();
begin
InitInfo();
end;

procedure InitializeWizard();
begin
 InitializeWizard1();
 InitializeWizard2();
end; 

UPD: немного подправил.

Edited by Gad575
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

'вот так'

#define WotVersion "0.9.16"
#include "SHFileOperation.iss";

[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\{#WotVersion}'), True, True, True);
DelTree(ExpandConstant('{app}\res_mods\xvm'), True, True, True);
CreateDir(ExpandConstant('{app}\res_mods\{#WotVersion}'));
end;
end;

function BackupCheck_3(): Boolean;
begin
If MoveRadioButton.Checked then
begin
MoveDir(ExpandConstant('{app}\res_mods\{#WotVersion}\'),ExpandConstant('{app}\res_mods\backup\{#WotVersion}'));
MoveDir(ExpandConstant('{app}\res_mods\configs\'),ExpandConstant('{app}\res_mods\backup\configs'));
MoveDir(ExpandConstant('{app}\res_mods\mods\'),ExpandConstant('{app}\res_mods\backup\mods'));
CreateDir(ExpandConstant('{app}\res_mods\{#WotVersion}'));
DelTree(ExpandConstant('{app}\res_mods\configs'), True, True, True);
DelTree(ExpandConstant('{app}\res_mods\mods'), True, True, True);
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
If CurStep=ssInstall then
begin
BackupCheck_2();
BackupCheck_3();
end;
end;

procedure InitializeWizard1();
begin
BackupCheck_1();
end;

#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif

const
UNDEF_INDEX = -777;
ALPHA_BLEND_LEVEL = 255; // max=Byte=255

WS_EX_LAYERED = $80000;
WS_EX_TRANSPARENT = $20;
LWA_COLORKEY = 1;
LWA_ALPHA = 2;
GWL_EXSTYLE = (-20);


var
InfoPic: TBitmapImage;
LastIndex: Integer;
TempPath: String;
PicForm: TForm;


type
COLORREF = DWORD;


function GetCursorPos(var lpPoint: TPoint): BOOL; external '[email protected] stdcall';
function SetLayeredWindowAttributes(Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; external '[email protected] stdcall';
function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLong{#A}@user32.dll stdcall';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall';
function SetFocus(hWnd: HWND): HWND; external '[email protected] stdcall';


procedure ShowPicHint(const PicFilePath: String);
var
pt: TPoint;
begin
if not GetCursorPos(pt) then Exit;
InfoPic.Bitmap.LoadFromFile(PicFilePath);
try
with PicForm do
begin
SetBounds(ScaleX(pt.x + 390), ScaleY(pt.y + 7), InfoPic.Width, InfoPic.Height);
Show;
end;
finally
SetFocus(WizardForm.Handle);
end;
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
'1.Отражение броней(unKnown_bot).': UndefPic := '1-Забл броней урон.bmp';
'2.Радар (тылы).': UndefPic := 'Радар.bmp';
'3.Командирская камера (koshnaranek).': UndefPic := 'Командирская камера.bmp';
'4.Таймер сведения орудия в бою (Ekspoint).': UndefPic := 'таймер сведения.bmp';
'5.Винтик.': UndefPic := 'винтик.bmp';

else
begin
LastIndex := UNDEF_INDEX;
PicForm.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
PicForm.Hide;
LastIndex := -1;
end;


procedure InitInfo();
begin
WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
TempPath := AddBackslash(ExpandConstant('{tmp}'));
LastIndex := UNDEF_INDEX;
PicForm := TForm.Create(WizardForm)
with PicForm do
begin
BorderStyle := bsNone;
FormStyle := fsStayOnTop;
InfoPic := TBitmapImage.Create(PicForm)
with InfoPic do
begin
Parent := PicForm;
AutoSize := True;
end;
end;
SetWindowLong(PicForm.Handle, GWL_EXSTYLE, GetWindowLong(PicForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(PicForm.Handle, 0, ALPHA_BLEND_LEVEL, LWA_ALPHA);
end;


procedure InitializeWizard2();
begin
InitInfo();
end;

procedure InitializeWizard();
begin
 InitializeWizard1();
 InitializeWizard2();
end; 

как доктор прописал! спс! )

Share this post


Link to post

Short link
Share on other sites

смотрю уже много модпакеров стало :), удачи вам в начинании :)

Share this post


Link to post

Short link
Share on other sites

смотрю уже много модпакеров стало :), удачи вам в начинании :)

:ok:  :gawi:

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

'вот так'

#define WotVersion "0.9.16"
#include "SHFileOperation.iss";

[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\{#WotVersion}'), True, True, True);
DelTree(ExpandConstant('{app}\res_mods\xvm'), True, True, True);
CreateDir(ExpandConstant('{app}\res_mods\{#WotVersion}'));
end;
end;

function BackupCheck_3(): Boolean;
begin
If MoveRadioButton.Checked then
begin
MoveDir(ExpandConstant('{app}\res_mods\{#WotVersion}\'),ExpandConstant('{app}\res_mods\backup\{#WotVersion}'));
MoveDir(ExpandConstant('{app}\res_mods\configs\'),ExpandConstant('{app}\res_mods\backup\configs'));
MoveDir(ExpandConstant('{app}\res_mods\mods\'),ExpandConstant('{app}\res_mods\backup\mods'));
CreateDir(ExpandConstant('{app}\res_mods\{#WotVersion}'));
DelTree(ExpandConstant('{app}\res_mods\configs'), True, True, True);
DelTree(ExpandConstant('{app}\res_mods\mods'), True, True, True);
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
If CurStep=ssInstall then
begin
BackupCheck_2();
BackupCheck_3();
end;
end;

procedure InitializeWizard1();
begin
BackupCheck_1();
end;

#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif

const
UNDEF_INDEX = -777;
ALPHA_BLEND_LEVEL = 255; // max=Byte=255

WS_EX_LAYERED = $80000;
WS_EX_TRANSPARENT = $20;
LWA_COLORKEY = 1;
LWA_ALPHA = 2;
GWL_EXSTYLE = (-20);


var
InfoPic: TBitmapImage;
LastIndex: Integer;
TempPath: String;
PicForm: TForm;


type
COLORREF = DWORD;


function GetCursorPos(var lpPoint: TPoint): BOOL; external '[email protected] stdcall';
function SetLayeredWindowAttributes(Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; external '[email protected] stdcall';
function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLong{#A}@user32.dll stdcall';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall';
function SetFocus(hWnd: HWND): HWND; external '[email protected] stdcall';


procedure ShowPicHint(const PicFilePath: String);
var
pt: TPoint;
begin
if not GetCursorPos(pt) then Exit;
InfoPic.Bitmap.LoadFromFile(PicFilePath);
try
with PicForm do
begin
SetBounds(ScaleX(pt.x + 390), ScaleY(pt.y + 7), InfoPic.Width, InfoPic.Height);
Show;
end;
finally
SetFocus(WizardForm.Handle);
end;
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
'1.Отражение броней(unKnown_bot).': UndefPic := '1-Забл броней урон.bmp';
'2.Радар (тылы).': UndefPic := 'Радар.bmp';
'3.Командирская камера (koshnaranek).': UndefPic := 'Командирская камера.bmp';
'4.Таймер сведения орудия в бою (Ekspoint).': UndefPic := 'таймер сведения.bmp';
'5.Винтик.': UndefPic := 'винтик.bmp';

else
begin
LastIndex := UNDEF_INDEX;
PicForm.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
PicForm.Hide;
LastIndex := -1;
end;


procedure InitInfo();
begin
WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
TempPath := AddBackslash(ExpandConstant('{tmp}'));
LastIndex := UNDEF_INDEX;
PicForm := TForm.Create(WizardForm)
with PicForm do
begin
BorderStyle := bsNone;
FormStyle := fsStayOnTop;
InfoPic := TBitmapImage.Create(PicForm)
with InfoPic do
begin
Parent := PicForm;
AutoSize := True;
end;
end;
SetWindowLong(PicForm.Handle, GWL_EXSTYLE, GetWindowLong(PicForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(PicForm.Handle, 0, ALPHA_BLEND_LEVEL, LWA_ALPHA);
end;


procedure InitializeWizard2();
begin
InitInfo();
end;

procedure InitializeWizard();
begin
 InitializeWizard1();
 InitializeWizard2();
end; 

подскажи если знаешь а как туда еще кеш клинер вмонтировать? ))

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...