DKRUBEN Posted August 7, 2018 Share Posted August 7, 2018 This is it? PageComponents.iss @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted August 8, 2018 Share Posted August 8, 2018 @DKRUBEN , yes. @ Quote Link to comment Short link Share on other sites More sharing options...
DKRUBEN Posted August 8, 2018 Share Posted August 8, 2018 @Kotyarko_O Give-me a error... @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted August 8, 2018 Share Posted August 8, 2018 2 hours ago, DKRUBEN said: Give-me a error... Always attach screenshot or part of a code if you post a message about some errors. @ Quote Link to comment Short link Share on other sites More sharing options...
DKRUBEN Posted August 8, 2018 Share Posted August 8, 2018 I, already here I put all this here. @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted August 8, 2018 Share Posted August 8, 2018 @DKRUBEN , i don`t see any mistakes can throw compiler error with "components" more (like that on the screenshot you attached before). Maybe your current error differ from previous? All i can see now, is potentional errors, like: SetInstallStatus(), SetCheckListBoxBGBMP(), SetCheckListBoxEvents() - them are declared in separate script, and you could forgot to copy. You can attach your project archive, i`ll check it (in PM if you don`t want to share it to public). 1 @ Quote Link to comment Short link Share on other sites More sharing options...
DKRUBEN Posted August 8, 2018 Share Posted August 8, 2018 @Kotyarko_O i don't have anything problem in expose the Project, in true, its your work and dont my... i just rework them... im soo happy for you expose your work and help guys like me #noobs @Kotyarko_O , script link: http://www.mediafire.com/file/n7h8ra14z53i0o8/script.rar/file @ Quote Link to comment Short link Share on other sites More sharing options...
DKRUBEN Posted August 8, 2018 Share Posted August 8, 2018 @Kotyarko_O are you there? @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted August 9, 2018 Share Posted August 9, 2018 (edited) 10 hours ago, DKRUBEN said: are you there? Only when i have a free time =) There`s so simple mistake (declaration sequence). Try this: PageComponents.iss Edited August 9, 2018 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
DKRUBEN Posted August 9, 2018 Share Posted August 9, 2018 @Kotyarko_O , thats are the msn i ricive. Nova Imagem de Mapa de Bits.bmp @Kotyarko_O , i try this 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; but same error @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted August 10, 2018 Share Posted August 10, 2018 @DKRUBEN , something wrong with MCTCreator-app. Make sure you use actual configs (*.cfg-files). @ Quote Link to comment Short link Share on other sites More sharing options...
DKRUBEN Posted August 10, 2018 Share Posted August 10, 2018 @Kotyarko_O , MCTCreator.7z @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted August 10, 2018 Share Posted August 10, 2018 @DKRUBEN , there is actual: MCTCreator.rar @ Quote Link to comment Short link Share on other sites More sharing options...
DKRUBEN Posted August 10, 2018 Share Posted August 10, 2018 @Kotyarko_O , I'll send all the code to you, by private message. @ Quote Link to comment Short link Share on other sites More sharing options...
DKRUBEN Posted August 11, 2018 Share Posted August 11, 2018 @Kotyarko_O , tanks @ Quote Link to comment Short link Share on other sites More sharing options...
AlexChe Posted August 11, 2018 Share Posted August 11, 2018 (edited) Вопрос такой. После инсталяции применяю подстройку конфига путем замены параметра на уже установленном модпаке. Следующим путем 1. Проверяю, был ли checked пункта с именем "Пункт1" следующим видом Function ComponentsChecked(Name: String): Boolean; begin Result := _IsComponentSelected(WizardForm.ComponentsList, Name); end; Function _IsComponentSelected(CheckListBox: TNewCheckListBox; Name: String): Boolean; var I, Idx: Integer; begin Result := False; try Idx := CheckListBox.Items.IndexOf(Name); // Idx := CheckListBox.Items.IndexOfName(Name) for I := 0 to CheckListBox.ItemCount - 1 do if (Idx <= CheckListBox.ItemCount) and (Idx = I) then Result := CheckListBox.Checked[Idx]; except MsgBoxEx(WizardForm.Handle, GetExceptionMessage(), '{#__FILE__}: {#__LINE__}', MB_ICONERROR or MB_OK, 0, 0); Log('[CUSTOM LOG]: ' + 'Checked. I = ' + IntToStr(I) + '. Name: "' + Name + '".'); end; end; 2. Дальше делаю если пункт выбран, делаю замену в конечном фонфиге функцией Procedure ConfigEdit(DefPath, ConfigFile: String; IsComponents: Boolean; OldValue, NewValue: String); var Config: TStringList; ConfigPath: String; back_num: Integer; begin if IsComponents then try Config := TStringList.Create; ConfigPath := ExpandConstant(DefPath + ConfigFile); ChangeConfiguratorStatus(ConfigPath); back_num:=Editor(Config, DefPath, ConfigPath, OldValue, NewValue); if back_num < 1 then MsgBoxEx(WizardForm.Handle, ConfigPath + #13#10 + OldValue + #13#10 + NewValue, 'Config value doesn`t changed', MB_ICONWARNING or MB_OK, 0, 0); finally Config.Free; end; end; 3. Это все замечательно работает, но не не в странах, где нет русской кодировки. т.е. на этапе поиска/одобрения этого пункта идет затык. Как мне обойти этот момент? Есть еще строчки вида Name: KMP\punkt1; Description: "{cm:CompName1}"; Flags: disablenouninstallwarning; Types: custom; Вероятно можно делать поиск по "KMP\punkt1", но тогда какие параметры запроса должны быть в _IsComponentSelected(WizardForm.ComponentsList, Name); и какая сама функция _IsComponentSelected должна быть? Мы должны искать вместо: Idx := CheckListBox.Items.IndexOf(Name); искать Idx := CheckListBox.Items.IndexOfName( 'KMP\punkt1'); Но при этом ничего не ищет. В общем вот такая задача. Edited August 11, 2018 by Alex_ @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted August 11, 2018 Share Posted August 11, 2018 47 minutes ago, Alex_ said: 3. Это все замечательно работает, но не не в странах, где нет русской кодировки. т.е. на этапе поиска/одобрения этого пункта идет затык. Речь идёт про "поиск\одобрение" какого конкретно "пункта"? Компонента в списке или строки в конфиге? 49 minutes ago, Alex_ said: Есть еще строчки вида Name: KMP\punkt1; Description: "{cm:CompName1}"; Flags: disablenouninstallwarning; Types: custom; Вероятно можно делать поиск по "KMP\punkt1", но тогда какие параметры запроса должны быть в _IsComponentSelected(WizardForm.ComponentsList, Name); и какая сама функция _IsComponentSelected должна быть? Мы должны искать вместо: Idx := CheckListBox.Items.IndexOf(Name); искать Idx := CheckListBox.Items.IndexOfName( 'KMP\punkt1'); Но при этом ничего не ищет. Можно просто использовать стандартную функцию, предназначенную для этой цели: IsComponentSelected('KMP\punkt1'). @ Quote Link to comment Short link Share on other sites More sharing options...
AlexChe Posted August 11, 2018 Share Posted August 11, 2018 (edited) 42 минуты назад, Kotyarko_O сказал: Речь идёт про "поиск\одобрение" какого конкретно "пункта"? Компонента в списке или строки в конфиге? Можно просто использовать стандартную функцию, предназначенную для этой цели: IsComponentSelected('KMP\punkt1'). мы ищем "включена ли галочка" в WizardForm.ComponentsList.Items т.к поиск по имени не срабатывает при отсутствии русской кодировки. сейчас проверю IsComponentSelected('KMP\punkt1'). А как сделать деревянную функцию поиска этого 'KMP\punkt1' в функции ниже? function GetIndexComponent(ComponentName: String): Integer; var J: Integer; Nowstring: String; begin Result:= -1; for J:=0 to WizardForm.ComponentsList.ItemCount-1 do begin Nowstring:=Lowercase(WizardForm.ComponentsList.Items[J]); if (Lowercase(ComponentName)=Nowstring) then begin Result:=J; break; end; end; end; т.к. при функции выше в WizardForm.ComponentsList.Items[J] он выдает опять же текстовое значение пункта, а не Name Edited August 11, 2018 by Alex_ @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted August 11, 2018 Share Posted August 11, 2018 (edited) 46 minutes ago, Alex_ said: т.к поиск по имени не срабатывает при отсутствии русской кодировки. Если 1251 (кириллица) не определена для ACP в кодовых страницах, то ни о каком поиске речи идти не может, ведь даже отображение кириллицы не будет нормальным. Тут надо решать проблему или указанием пользователю настроек региональных стандартов, или делать полноценный перевод. 46 minutes ago, Alex_ said: А как сделать деревянную функцию поиска этого 'KMP\punkt1' в функции ниже? Никак. Обработка этих имён находится на уровне ниже (https://github.com/jrsoftware/issrc/blob/master/Projects/Struct.pas#L174). Edited August 11, 2018 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
AlexChe Posted August 11, 2018 Share Posted August 11, 2018 (edited) 2 минуты назад, Kotyarko_O сказал: Никак. Обработка этих имён находится на уровне ниже. 1. т.е. только IsComponentSelected('KMP\punkt1').? (кстати работает спасибо) 2. а как функцию выше переделать, чтобы она выдавала все названия 'KMP\***' (т.е. спускалась "ниже")? Edited August 11, 2018 by Alex_ @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
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.