TneRED 0 #264963 Posted April 25, 2015 (edited) TneRED, вот так: #define PackForVersion "0.9.7.0"; [CustomMessages] FileNotFoundLabel=Игра не найдена в данной директории!%n%nПожалуйста, укажите папку с игрой. FileVersionWrongLabel=Обнаружена несовместимая версия игрового клиента!%n%nПожалуйста, укажите клиент версии {#PackForVersion}. [~~Code~~] function FileVersion(const FilePath: AnsiString): AnsiString; var oFS: Variant; begin oFS:=CreateOleObject('Scripting.FileSystemObject'); try Result:=oFS.GetFileVersion(FilePath); except end; end; function NextButtonClick(CurPage: Integer): Boolean; begin Result:=True; If CurPage=6 then begin If not FileExists(ExpandConstant('{app}\WorldOfTanks.exe')) then begin MsgBox(ExpandConstant('{cm:FileNotFoundLabel}'), mbError, MB_OK); Result:=False; end; If FileExists(ExpandConstant('{app}')+'\WorldOfTanks.exe') then begin If FileVersion(ExpandConstant('{app}')+'\WorldOfTanks.exe') <> '{#PackForVersion}' then begin MsgBox(ExpandConstant('{cm:FileVersionWrongLabel}'), mbError, MB_OK); Result:=False; end; end; end; end; Обратите внимание, что версия в exe'шнике игры прописывается как 0.9.7.0, а не 0.9.7. Проверку на запущенный клиент тут я уже видел. Заумную версию, можно конечно сделать намного короче. В примерах в шапке темы скорее всего должен быть код. Спасибо пытался свой написать) Пишу еще проверку запуска процесса клиента игры пока ничего не работает [Files] Source: ISTask.dll; DestDir: {app}; Flags: dontcopy [Code] function RunTask(FileName: string; bFullpath: Boolean): Boolean; external 'RunTask@files:ISTask.dll stdcall delayload'; function InitializeSetup(): Boolean; begin Result:=True; If RunTask('WorldOfTanks.exe', false) then begin MsgBox('Перед началом установки МодПака закройте клиент World of Tanks!', mbError, MB_OK); Result := False; end; end; Edited April 25, 2015 by TneRED Quote Share this post Link to post Short link Share on other sites
guceds 2 #264977 Posted April 25, 2015 1. подскажите, в чем проблема?http://s43.radikal.ru/i099/1504/a9/dae794ab29bc.png 2. И еще, как сделать к компонентам комментарий (описание). Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #264978 Posted April 25, 2015 1. подскажите, в чем проблема? http://s43.radikal.ru/i099/1504/a9/dae794ab29bc.png 2. И еще, как сделать к компонентам комментарий (описание). [Setup] AppName=Моя программа AppVersion=1.5 AppPublisher=YURSHAT AppPublisherURL= DefaultDirName={pf}\Моя программа [Languages] Name: "RU"; MessagesFile: "compiler:Languages\Russian.isl" [CustomMessages] RU.CompName1=Компонент 1 RU.CompName2=Компонент 2 RU.ComponentsInfo=Наведите курсор мыши на компонент, чтобы прочитать его описание. RU.ComponentsImgInfo=Наведите курсор мыши на компонент, чтобы посмотреть его превью. RU.CompDesc1=Описание первого компонента RU.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 [Components] Name: comp1; Description: "{cm:CompName1}"; Name: comp2; Description: "{cm:CompName2}"; Name: comp3; Description: "{cm:CompName1}"; Name: comp4; Description: "{cm:CompName2}"; Name: comp5; Description: "{cm:CompName1}"; Name: comp6; Description: "{cm:CompName2}"; [code] type TComponentDesc = record Description: String; ImageName: String; Index: Integer; end; var CompDescs: array of TComponentDesc; CompDescPanel, CompDescImgPanel: TPanel; CompDescText: array[1..2] of TLabel; 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; CompDescText[2].Caption := CompDescs[CompIndex].Description; CompDescText[2].Enabled := True; end else begin CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp')); CompDescText[2].Caption := CustomMessage('ComponentsInfo'); CompDescText[2].Enabled := False; end; LastIndex := Index; end; procedure CompListMouseLeave(Sender: TObject); begin CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp')); CompDescText[2].Caption := CustomMessage('ComponentsInfo'); CompDescText[2].Enabled := False; LastIndex := -1; end; procedure AddCompDescription(AIndex: Integer; ADescription: String; AImageName: String); var i: Integer; begin i := GetArrayLength(CompDescs); SetArrayLength(CompDescs, i + 1); CompDescs[i].Description := ADescription; CompDescs[i].ImageName := AImageName; CompDescs[i].Index := AIndex - 1 end; procedure InitializeWizard(); begin ExtractTemporaryFile('MainPic.bmp'); WizardForm.SelectComponentsLabel.Hide; WizardForm.TypesCombo.Hide; WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(0), ScaleX(184), ScaleY(205)); 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; CompDescText[1] := TLabel.Create(WizardForm); with CompDescText[1] do begin Parent := CompDescImgPanel; SetBounds(ScaleX(5), ScaleY(5), CompDescImgPanel.Width - ScaleX(10), CompDescImgPanel.Height - ScaleY(10)); AutoSize := False; WordWrap := True; Enabled := False; Caption := CustomMessage('ComponentsImgInfo'); 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; CompDescPanel := TPanel.Create(WizardForm); with CompDescPanel do begin Parent := WizardForm.SelectComponentsPage; SetBounds(ScaleX(192), ScaleY(125), ScaleX(225), ScaleY(80)); BevelInner := bvLowered; end; CompDescText[2] := TLabel.Create(WizardForm); with CompDescText[2] do begin Parent := CompDescPanel; SetBounds(ScaleX(5), ScaleY(5), CompDescPanel.Width - ScaleX(10), CompDescPanel.Height - ScaleY(10)); AutoSize := False; WordWrap := True; Enabled := False; Caption := CustomMessage('ComponentsInfo'); end; AddCompDescription(1, CustomMessage('CompDesc1'), 'CompDescImg1.bmp'); AddCompDescription(2, CustomMessage('CompDesc2'), 'CompDescImg2.bmp'); end; 1 Quote Share this post Link to post Short link Share on other sites
guceds 2 #264982 Posted April 25, 2015 (edited) [Setup] AppName=Моя программа AppVersion=1.5 AppPublisher=YURSHAT AppPublisherURL= DefaultDirName={pf}\Моя программа [Languages] Name: "RU"; MessagesFile: "compiler:Languages\Russian.isl" [CustomMessages] RU.CompName1=Компонент 1 RU.CompName2=Компонент 2 RU.ComponentsInfo=Наведите курсор мыши на компонент, чтобы прочитать его описание. RU.ComponentsImgInfo=Наведите курсор мыши на компонент, чтобы посмотреть его превью. RU.CompDesc1=Описание первого компонента RU.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 [Components] Name: comp1; Description: "{cm:CompName1}"; Name: comp2; Description: "{cm:CompName2}"; Name: comp3; Description: "{cm:CompName1}"; Name: comp4; Description: "{cm:CompName2}"; Name: comp5; Description: "{cm:CompName1}"; Name: comp6; Description: "{cm:CompName2}"; [code] type TComponentDesc = record Description: String; ImageName: String; Index: Integer; end; var CompDescs: array of TComponentDesc; CompDescPanel, CompDescImgPanel: TPanel; CompDescText: array[1..2] of TLabel; 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; CompDescText[2].Caption := CompDescs[CompIndex].Description; CompDescText[2].Enabled := True; end else begin CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp')); CompDescText[2].Caption := CustomMessage('ComponentsInfo'); CompDescText[2].Enabled := False; end; LastIndex := Index; end; procedure CompListMouseLeave(Sender: TObject); begin CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp')); CompDescText[2].Caption := CustomMessage('ComponentsInfo'); CompDescText[2].Enabled := False; LastIndex := -1; end; procedure AddCompDescription(AIndex: Integer; ADescription: String; AImageName: String); var i: Integer; begin i := GetArrayLength(CompDescs); SetArrayLength(CompDescs, i + 1); CompDescs[i].Description := ADescription; CompDescs[i].ImageName := AImageName; CompDescs[i].Index := AIndex - 1 end; procedure InitializeWizard(); begin ExtractTemporaryFile('MainPic.bmp'); WizardForm.SelectComponentsLabel.Hide; WizardForm.TypesCombo.Hide; WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(0), ScaleX(184), ScaleY(205)); 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; CompDescText[1] := TLabel.Create(WizardForm); with CompDescText[1] do begin Parent := CompDescImgPanel; SetBounds(ScaleX(5), ScaleY(5), CompDescImgPanel.Width - ScaleX(10), CompDescImgPanel.Height - ScaleY(10)); AutoSize := False; WordWrap := True; Enabled := False; Caption := CustomMessage('ComponentsImgInfo'); 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; CompDescPanel := TPanel.Create(WizardForm); with CompDescPanel do begin Parent := WizardForm.SelectComponentsPage; SetBounds(ScaleX(192), ScaleY(125), ScaleX(225), ScaleY(80)); BevelInner := bvLowered; end; CompDescText[2] := TLabel.Create(WizardForm); with CompDescText[2] do begin Parent := CompDescPanel; SetBounds(ScaleX(5), ScaleY(5), CompDescPanel.Width - ScaleX(10), CompDescPanel.Height - ScaleY(10)); AutoSize := False; WordWrap := True; Enabled := False; Caption := CustomMessage('ComponentsInfo'); end; AddCompDescription(1, CustomMessage('CompDesc1'), 'CompDescImg1.bmp'); AddCompDescription(2, CustomMessage('CompDesc2'), 'CompDescImg2.bmp'); end; Все конечно хорошо, но что мне нужно вырезать? (Простите за тупизну, но только начинаю, прошу понять, простить ) И да, тут есть ответ на вторую мою проблему? P.s. В днный момент прописано так. [Components] Name: KMP; Description: Mod Pack; Types: custom; Flags: fixed Name: KMP\P; Description: 1. AIMBOT от ШАЙТАНА.; Name: KMP\DP; Description: 2. КРАСНЫЕ ШАРЫ для АРТЫ.; Name: KMP\ZK; Description: 3. Показ разрушенных объектов; Edited April 25, 2015 by guceds Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #264984 Posted April 25, 2015 Все конечно хорошо, но что мне нужно вырезать? (Простите за тупизну, но только начинаю, прошу понять, простить ) И да, тут есть ответ на вторую мою проблему? P.s. В днный момент прописано так. [Components] Name: KMP; Description: Mod Pack; Types: custom; Flags: fixed Name: KMP\P; Description: 1. AIMBOT от ШАЙТАНА.; Name: KMP\DP; Description: 2. КРАСНЫЕ ШАРЫ для АРТЫ.; Name: KMP\ZK; Description: 3. Показ разрушенных объектов; ставь расширенный компилятор Юникод версии Quote Share this post Link to post Short link Share on other sites
guceds 2 #264985 Posted April 25, 2015 ставь расширенный компилятор Юникод версии А можете пожалуйста дать ссылку в лс или тут. Ибо просил уже ссылку, дали, увы, не работающюю. Был бы признателен :) Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #264986 Posted April 25, 2015 в первом посте темы 1 Quote Share this post Link to post Short link Share on other sites
guceds 2 #265041 Posted April 25, 2015 (edited) Подскажите уважаемые.http://www.koreanrandom.com/forum/topic/9050-инсталлятор-для-модпаков/?p=179060 Пытаюсь вырезать код и вставить к себе в инсталятор. Только увы не получается (ну это то и понятно, потому что не знаю что к чему относится). Нужно именно, чтобы отображалась картинка в блоке и все. А у меня почему то плющится первая страничка установки, потом когда перехожу к компонентам, то там при наводке на компонент вылезает ошибка. В общем руки явно у меня не из того места..) Так же не понимаю, куда впиливать "описание" в свой код. Ошибки вылазят Edited April 25, 2015 by guceds Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #265050 Posted April 25, 2015 Подскажите уважаемые. http://www.koreanrandom.com/forum/topic/9050-инсталлятор-для-модпаков/?p=179060 Пытаюсь вырезать код и вставить к себе в инсталятор. Только увы не получается (ну это то и понятно, потому что не знаю что к чему относится). Нужно именно, чтобы отображалась картинка в блоке и все. А у меня почему то плющится первая страничка установки, потом когда перехожу к компонентам, то там при наводке на компонент вылезает ошибка. В общем руки явно у меня не из того места..) Так же не понимаю, куда впиливать "описание" в свой код. Ошибки вылазят Ошибка какая? Quote Share this post Link to post Short link Share on other sites
guceds 2 #265054 Posted April 25, 2015 строка 207 Null Pointer Exteption. "SetBounds(ScaleX(pt.x + 16), ScaleY(pt.y + 7), InfoPic.Width, InfoPic.Height);" Quote Share this post Link to post Short link Share on other sites
Kotyarko_O 1,906 #265058 Posted April 25, 2015 Null Pointer Exteption. А где находится указатель точки pt? Quote Share this post Link to post Short link Share on other sites
guceds 2 #265060 Posted April 25, 2015 (edited) а как ее правильно будет указать?Да и как оставить все как было, только поменять страничку компонентов, чтобы там делилось на два блока (компоненты с выбором, а второй блок картинка). Ибо даже с ошибкой, как я говорил ранее плющит все картинки ( при запуске основная заставка, шапка и т.д.)а то изучаю тему на 28 страничке и еще не нашел решения Edited April 25, 2015 by guceds Quote Share this post Link to post Short link Share on other sites
Kotyarko_O 1,906 #265062 Posted April 25, 2015 а как ее правильно будет указать? Не так. Такой способ используется, если нужно выводить изображение под курсором. а то изучаю тему на 28 страничке и еще не нашел решения Изучайте лучше тот пример, откуда вы этот код взяли. Quote Share this post Link to post Short link Share on other sites
guceds 2 #265063 Posted April 25, 2015 Не так. Такой способ используется, если нужно выводить изображение под курсором. Изучайте лучше тот пример, откуда вы этот код взяли. Долго в него тыкал, но все четно.. Пытался все заменять в , но все равно не получается.. Вот и ищу помощи, после того, как попробовал различные способы замены. Увы знаний не хватает. Quote Share this post Link to post Short link Share on other sites
Kotyarko_O 1,906 #265065 Posted April 25, 2015 Архивируйте скрипт со всем необходимым для компиляции (кроме модов) и прикрепляйте. Quote Share this post Link to post Short link Share on other sites
guceds 2 #265068 Posted April 25, 2015 (edited) Архивируйте скрипт со всем необходимым для компиляции (кроме модов) и прикрепляйте. http://rghost.ru/6hvgQw9xn Если что это изначальная версия без ошибки Edited April 25, 2015 by guceds Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #265074 Posted April 25, 2015 А подобный образом? var I: Integer; .... for I := 0 to WizardForm.ComponentsList.Items.Count - 1 do begin WizardForm.ComponentsList.Checked[I] := SearchValues(ExpandConstant('{app}\1.txt'), WizardForm.ComponentsList.ItemCaption[I]); end; Ошибку нашел,но все равно грузит долго, у меня список где то из 40 компонентов Quote Share this post Link to post Short link Share on other sites
Kotyarko_O 1,906 #265083 Posted April 25, 2015 Ошибку нашел,но все равно грузит долго, у меня список где то из 40 компонентов Так не должно быть. Что значит "долго грузит"? Переход на страницу тормозит? Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #265084 Posted April 25, 2015 Так не должно быть. Что значит "долго грузит"? Переход на страницу тормозит? Переход норм, а список загружает долго Quote Share this post Link to post Short link Share on other sites
Kotyarko_O 1,906 #265086 Posted April 25, 2015 Переход норм, а список загружает долго Это как? Quote Share this post Link to post Short link Share on other sites