Jump to content
Korean Random

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


Recommended Posts

1 minute ago, ShuraBB said:

Подскажите как называются выделенные области в иерархии WizardForm.

По порядку выделений:

  1. PageNameLabel, PageDescriptionLabel, WizardSmallBitmapImage.
  2. SelectComponentsLabel.
  3. TypesCombo.
  4. ComponentsDiskSpaceLabel.
  5. Bevel.
  • Upvote 2
Link to comment
Short link
Share on other sites

33 minutes ago, ShuraBB said:

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

Полное, но без наглядного обзора, тут: http://www.jrsoftware.org/ishelp/topic_scriptclasses.htm#TWizardForm

А вообще, для просмотра и редактирования удобно использовать расширенный компилятор (закинуть в корневую папку инно): Compil32Ex.rar

Выглядит так:

2018-06-28_22-34-59.thumb.png.d3c860a166ca713d8bb53b4716721701.png

  • Upvote 2
Link to comment
Short link
Share on other sites

@Budyx69 , Enhanced Inno Setup Compiler

 

Цитата

Расширенный компилятор (редактор) для InnoSetup от китайских собратьев ResTools. Содержит более удобный редактор, дизайнер диалогов, шаблоны коды и множество других возможностей.

 

  • Upvote 1
Link to comment
Short link
Share on other sites

Никак не могу заставить [UninstallDelete] делать так, чтобы он удалял только подпапки в res_mods/x.x.x.x

Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\*"

Type: filesandordirs; Name: "{app}\res_mods\{#Patch}"

Такие варианты приводят к удалению папки х.х.х.х целиком, после чего клиент не стартует, восстановление клиента папку не восстанавливает.

Указание всех подпапок в папке тоже приводит к удалению всей папки 

[UninstallDelete]
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\content\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\gui\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\localization\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\maps\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\objects\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\particles\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\scripts\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\spaces\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\speedtree\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\system\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\vehicles\*"

Хотя в некоторых случаях он наоборот оставляет пару подпапок не удаленными, но пустыми.

Link to comment
Short link
Share on other sites

1 час назад, Furious сказал:

Никак не могу заставить [UninstallDelete] делать так, чтобы он удалял только подпапки в res_mods/x.x.x.x


Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\*"

Type: filesandordirs; Name: "{app}\res_mods\{#Patch}"

Такие варианты приводят к удалению папки х.х.х.х целиком, после чего клиент не стартует, восстановление клиента папку не восстанавливает.

Указание всех подпапок в папке тоже приводит к удалению всей папки 


[UninstallDelete]
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\content\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\gui\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\localization\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\maps\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\objects\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\particles\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\scripts\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\spaces\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\speedtree\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\system\*"
Type: filesandordirs; Name: "{app}\res_mods\{#Patch}\vehicles\*"

Хотя в некоторых случаях он наоборот оставляет пару подпапок не удаленными, но пустыми.

после удаления просто надо создать отдельно нужные папки примерно так:

 CreateDir(ExpandConstant('{app}\res_mods\{#Patch}'));

Kotyarko_O очень много мне помогал и я по его исходникам много чего переделывал !!!

 

Edited by Nowik1971
  • Upvote 1
Link to comment
Short link
Share on other sites

50 minutes ago, Furious said:

Указание всех подпапок в папке тоже приводит к удалению всей папки

У меня два предположения:

  1. В коде деинсталляции прописано удаление папки "{#Patch}".
  2. В секциях инсталляции прописано удаление папки "{#Patch}" с её пересозданием. В таком случае эта папка, созданная установщиком, заносится в реестр файлов деинсталлятора, которые он должен удалить при деинсталляции автоматически. Что и происходит.
     
50 minutes ago, Furious said:

Такие варианты приводят к удалению папки х.х.х.х целиком, после чего клиент не стартует, восстановление клиента папку не восстанавливает.

ОС забыли переустановить. (сарказм)

Папку никто не запрещает создать вручную, через проводник.

Edited by Kotyarko_O
  • Upvote 2
Link to comment
Short link
Share on other sites

  • 1 month later...

@Kotyarko_OHello and sorry to be a bit annoying, in your source of the inno I am trying to add MCTCreator as you have but gives me error to compile, any idea?

[Files]
Source: "MODS\MCTCREATOR\*.cfg"; DestDir: "{app}\KMP\MCTCreator"; Flags: ignoreversion; BeforeInstall: SetInstallStatus('Изменение игровых текстур..'); Components: KMP\MCT;
Source: "MODS\MCTCREATOR\MCTCreator.exe"; DestDir: "{app}\KMP\MCTCreator"; Flags: ignoreversion; BeforeInstall: SetInstallStatus('Изменение игровых текстур..'); AfterInstall: MCTCreatorLaunch(); Components: KMP\MCT;

[Code]
Var
 ComponentsPage: TWizardPage;
 ComponentsList: TNewCheckListBox;
 ComponentsPageImg: Longint;

Procedure MCTCreatorLaunch();
var
 ResCode: Integer;
 Params: String;
begin
 ResCode := 666;
 if FileExists(ExpandConstant('{app}\KMP\MCTCreator\MCTCreator.exe')) then
 begin
  Params := ExpandConstant('/wot-path "{app}" /operational-mode=0');
  if IsComponentSelected('KMP\MCT\DPT') then
   Params := Params + ' /DPT-mod "#FFFFFF"';
  if IsComponentSelected('KMP\MCT\CT') then
   Params := Params + ' /CT-mod "#FFFFFF"';
  Exec('MCTCreator.exe', Params, ExpandConstant('{app}\KMP\MCTCreator'), SW_SHOW, ewWaitUntilTerminated, ResCode);
  if ResCode <> 0 then
   MsgBoxEx(WizardForm.Handle, 'Unexpected error.' + #13#10 + 'Result code: ' + IntToStr(ResCode) + '.', '{#__FILE__}: {#__LINE__}', MB_OK or MB_ICONERROR, 0, 0);
 end else
  MsgBoxEx(WizardForm.Handle, 'MCTCreator files doesn`t exists.', '{#__FILE__}: {#__LINE__}', MB_OK or MB_ICONERROR, 0, 0);
end;

 

Link to comment
Short link
Share on other sites

@DKRUBEN , i have looked into sources from repository and understood there`s a mistakes, one of them you`ve found. 

Remote repo i didn`t update about few month and have worked only in local. I`ll try to update remote repo asap.

 

If you are using standard components page, you have to create "KMP\MCT\*" components. Else (page is custom) you have to change "Components" to "Check" in your [Files] section, like "Check: ComponentsChecked('some_item_name')".

 

Edited by Kotyarko_O
Link to comment
Short link
Share on other sites

well it seemed to me, because in my old script I used [files] and [components], and with this, yours is really good for me, I could not find them, I know my question was a little silly.

big thanks for you and @night_dragon_on...:thx:

PageComponents.iss

@Kotyarko_O it's this?

Source: "MODS\ComponetsPage\MCTCREATOR\*.cfg";                DestDir: "{app}\Driftkings\MCTCreator"; Flags: ignoreversion; BeforeInstall: SetInstallStatus('Extart MTCreator...:');                                     Check: ComponentsChecked('Changing game texture (MCTCreator):');
Source: "MODS\ComponetsPage\MCTCREATOR\MCTCreator.exe";       DestDir: "{app}\Driftkings\MCTCreator"; Flags: ignoreversion; BeforeInstall: SetInstallStatus('Extart MTCreator...:'); AfterInstall: "MCTCreatorLaunch()"; Check: ComponentsChecked('Changing game texture (MCTCreator):');
#endif

[Code]
Var
 ComponentsPage: TWizardPage;
 ComponentsList: TNewCheckListBox;
 ComponentsPageImg: Longint;

////
//*2
 Procedure MCTCreatorLaunch();
var
 ResCode: Integer;
 Params: String;
begin
 ResCode := 666;
 if FileExists(ExpandConstant('{app}\Driftkings\MCTCreator\MCTCreator.exe')) then
 begin
  Params := ExpandConstant('/wot-path "{app}" /operational-mode=0');
  if IsComponentSelected('Change the texture of destroyed equipment') then
   Params := Params + ' /DPT-mod "#FFFFFF"';
  if IsComponentSelected('Change the texture of the downed track/tank') then
   Params := Params + ' /CT-mod "#FFFFFF"';
  Exec('MCTCreator.exe', Params, ExpandConstant('{app}\Driftkings\MCTCreator'), SW_SHOW, ewWaitUntilTerminated, ResCode);
  if ResCode <> 0 then
   MsgBoxEx(WizardForm.Handle, 'Unexpected error.' + #13#10 + 'Result code: ' + IntToStr(ResCode) + '.', '{#__FILE__}: {#__LINE__}', MB_OK or MB_ICONERROR, 0, 0);
 end else
  MsgBoxEx(WizardForm.Handle, 'MCTCreator files doesn`t exists.', '{#__FILE__}: {#__LINE__}', MB_OK or MB_ICONERROR, 0, 0);
end;

 

Edited by DKRUBEN
Link to comment
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...