Jump to content
Korean Random
EvilAlex

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

Recommended Posts

Сообщений очень много мог и пропустить...

Нашел сам как сделать вывод изображений при наведении.

Есть еще пару вопросов.

Как вывести описания к модам?

 

И есть проблема с backUP папок и файлов.

Вставил код бекапа

#include "SHFileOperation.iss";

[code]
//------- Скрипт backUP ------------
var
  BackupPage: TWizardPage;
  DeleteRadioButton, MoveRadioButton, NoneRadioButton: TNewRadioButton;

const
  BackupDescText =
    'Во избежание проблем совместимости и конфликтов между модификациями рекомендуется удалить уже установленные на данный момент в игровом клиенте.' #13#13 'Выберите необходимый пункт из представленных. При этом будет очищено содержимое папки "res_mods\0.9.14", удалена папка "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:='Удалить старый ModPack'
  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:='Сделать резервную копию ModPacka'
  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.9.14'), True, True, True);
  DelTree(ExpandConstant('{app}\res_mods\xvm'), True, True, True);
  CreateDir(ExpandConstant('{app}\res_mods\0.9.14'));
end;
end;

function BackupCheck_3(): Boolean;
begin
  If MoveRadioButton.Checked then
begin
  MoveDir(ExpandConstant('{app}\res_mods\0.9.14\'),ExpandConstant('{app}\res_mods\backup\0.9.14'));
  MoveDir(ExpandConstant('{app}\res_mods\xvm\'),ExpandConstant('{app}\res_mods\backup\xvm'));
  CreateDir(ExpandConstant('{app}\res_mods\0.9.14'));
  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;

Но проблема при компиляции выдает вот такую ошибку

attachicon.gif2016-03-21_093649.png

 

Если убрать или закоментировать этот код то не работають картинки при наведении и весь вид инстолятора искревляется...

Пробуи так праблема била в procedure InitializeWizard(); ана у тебя ести ишё гдета я переменавал в procedure Backup();

 

#define Patch     "0.9.14"
#include          "SHFileOperation.iss";
[code]
//------- Скрипт backUP ------------
var
  BackupPage: TWizardPage;
  DeleteRadioButton, MoveRadioButton, NoneRadioButton: TNewRadioButton;
const
  BackupDescText =
    'Во избежание проблем совместимости и конфликтов между модификациями рекомендуется удалить уже установленные на данный момент в игровом клиенте.' #13#13 'Выберите необходимый пункт из представленных. При этом будет очищено содержимое папки "res_mods\0.9.14", удалена папка "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:='Удалить старый ModPack'
  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:='Сделать резервную копию ModPacka'
  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\{#Patch}'), True, True, True);
  DelTree(ExpandConstant('{app}\res_mods\xvm'), True, True, True);
  CreateDir(ExpandConstant('{app}\res_mods\{#Patch}'));
end;
end;
function BackupCheck_3(): Boolean;
begin
  If MoveRadioButton.Checked then
begin
  MoveDir(ExpandConstant('{app}\res_mods\{#Patch}\'),ExpandConstant('{app}\res_mods\backup\{#Patch}'));
  MoveDir(ExpandConstant('{app}\res_mods\xvm\'),ExpandConstant('{app}\res_mods\backup\xvm'));
  CreateDir(ExpandConstant('{app}\res_mods\{#Patch}'));
  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 Backup();
begin
  BackupCheck_1();
end;

Edited by asterix93

Share this post


Link to post

Short link
Share on other sites

Пробуи так праблема била в procedure InitializeWizard(); ана у тебя ести ишё гдета я переменавал в procedure Backup();

 

#define Patch     "0.9.14"
#include          "SHFileOperation.iss";
[code]
//------- Скрипт backUP ------------
var
  BackupPage: TWizardPage;
  DeleteRadioButton, MoveRadioButton, NoneRadioButton: TNewRadioButton;
const
  BackupDescText =
    'Во избежание проблем совместимости и конфликтов между модификациями рекомендуется удалить уже установленные на данный момент в игровом клиенте.' #13#13 'Выберите необходимый пункт из представленных. При этом будет очищено содержимое папки "res_mods\0.9.14", удалена папка "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:='Удалить старый ModPack'
  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:='Сделать резервную копию ModPacka'
  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\{#Patch}'), True, True, True);
  DelTree(ExpandConstant('{app}\res_mods\xvm'), True, True, True);
  CreateDir(ExpandConstant('{app}\res_mods\{#Patch}'));
end;
end;
function BackupCheck_3(): Boolean;
begin
  If MoveRadioButton.Checked then
begin
  MoveDir(ExpandConstant('{app}\res_mods\{#Patch}\'),ExpandConstant('{app}\res_mods\backup\{#Patch}'));
  MoveDir(ExpandConstant('{app}\res_mods\xvm\'),ExpandConstant('{app}\res_mods\backup\xvm'));
  CreateDir(ExpandConstant('{app}\res_mods\{#Patch}'));
  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 Backup();
begin
  BackupCheck_1();
end;

Не помогло

Share this post


Link to post

Short link
Share on other sites

Как сделать несколько страниц с выбором модов?
На скринах пример, Шаг 1 -> Шаг 2 и т.д.

post-36070-0-92724000-1458577108_thumb.png

post-36070-0-07045800-1458577110_thumb.png

Share this post


Link to post

Short link
Share on other sites

я вот реально не понимаю, введи емае в поиск темы "несколько стр"

Edited by Ekspoint

Share this post


Link to post

Short link
Share on other sites

я вот реально не понимаю, введи емае в поиск темы "несколько стр"

Я вот тоже не понимаю! Тема создана для помощи, а не для писанины типа "Поиск в помощь".

Не знаешь что ответить или чем помочь лучше просто промолчи.

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

 

 

Я как то пробовал с этими CheckBox работать ни чего не выходит(
Иначе - никак.

Share this post


Link to post

Short link
Share on other sites

Иначе - никак.

Да ну я прям уверен есть и другие способы))

 

Может я тебе скину свой скрипт, подправишь не много, остальное я сам доделаю?

То если объяснять мне это много времени займет и нервов :-D

Share this post


Link to post

Short link
Share on other sites

Я вот тоже не понимаю! Тема создана для помощи, а не для писанины типа "Поиск в помощь".

Не знаешь что ответить или чем помочь лучше просто промолчи.

Грамотей ты наш.

Я перед тем как задавать тут вопросы прочитал всю тему от начала и до конца все страницы и не один раз, а тебе впадло читать и искать.

Я думаю это  не правильный подход и тебе тут никто не принесет на блюдечке с голубой каемкой то что ты хочешь.

Читай и Гугл в помощь ,а потом спрашивай, тут если поиска есть все почти...

  • Upvote 1
  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

вот вот


Не знаешь что ответить или чем помочь лучше просто промолчи.

я раз 15 тут выкладывал в теме пример

Share this post


Link to post

Short link
Share on other sites
Да ну я прям уверен есть и другие способы)

Ты можешь быть бесконечно уверен... Но какой в этом толк, если других способов нет?

 

Может я тебе скину свой скрипт, подправишь не много, остальное я сам доделаю?

Может, но когда отвечу - не знаю, времени не особо.

Edited by Kotyarko_O

Share this post


Link to post

Short link
Share on other sites

Ты можешь быть бесконечно уверен... Но какой в этом толк, если других способов нет?

 

Может, но когда отвечу - не знаю, времени не особо.

Кинул тебе в ЛС все что я сделал... Пока буду пробовать сам что то делать. Если что то сделаю до того как ты сделаешь я напишу.

Share this post


Link to post

Short link
Share on other sites

Привет всем как можна избавитса ат атаи праблеме

ищи где ты еще прописал PChar

Share this post


Link to post

Short link
Share on other sites

ищи где ты еще прописал PChar

 

 

я знаю где

Edited by asterix93

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...