Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 8]
El Sanchez, выдает ошибки при компиляций https://s8.hostingkartinok.com/uploads/images/2017/11/e7c808e2229ba20849957e9d605eb966.png
web_form, ошибка приведена непосредственно в тексте сообщения. Опишите указанную переменную в коде.
web_form, так, как это сделано в примере по ссылке (http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_getopenfilename), приведённой коллегой El Sanchez выше: в области описаний переменных — имя переменной и её тип.
Iska, и что мне делать,из за чего ошибка?
El Sanchez
30-11-2017, 17:30
и что мне делать,из за чего ошибка? »
web_form, необъявленная переменная FileName, после объявления процедуры procedure CurStepChanged(CurStep: TSetupStep); идет блок объявления локальных переменных (начинается с var), в блоке допишите FileName: string;
из за чего ошибка? »
Перечитать написанное мною ранее. Там всё сказано.
Iska, и что мне делать, »
Начать изучение языка.
как в скрипте прописать Удалить и Играть »
Перестать задавать глупые вопросы и начать изучение базовых основ InnoSetup.
web_form, на кой ляд Вы взялись за создание инсталляторов, если не стремитесь ни пальцем шевельнуть, ни мозгами?
Iska, я уже половину скрипта исправил,осталось толь ка маленькие детали
Нужна помощь, отображаются только первые четыре картинки.
Name: AKM; Description: AKM(AK-47):; Types: full; Flags: fixed;
Name: AKM\OPTION1; Description: "Вариант №1"; Types: full; Flags: exclusive;
Name: AKM\OPTION2; Description: "Вариант №2"; Types: custom; Flags: exclusive;
Name: AKM\OPTION3; Description: "Вариант №3"; Types: custom; Flags: exclusive;
Name: AKM\OPTION4; Description: "Вариант №4"; Types: custom; Flags: exclusive;
Name: COLT45; Description: Colt.45(Pistol):; Types: full; Flags: fixed;
Name: COLT45\OPTION1; Description: "Вариант №1"; Types: full; Flags: exclusive;
Name: COLT45\OPTION2; Description: "Вариант №2"; Types: custom; Flags: exclusive;
Name: COLT45\OPTION3; Description: "Вариант №3"; Types: custom; Flags: exclusive;
Name: COLT45\OPTION4; Description: "Вариант №4"; Types: custom; Flags: exclusive;
Name: KAR98K; Description: Kar98k(Rifle):; Types: full; Flags: fixed;
Name: KAR98K\OPTION1; Description: "Вариант №1"; Types: full; Flags: exclusive;
Name: KAR98K\OPTION2; Description: "Вариант №2"; Types: custom; Flags: exclusive;
Name: KAR98K\OPTION3; Description: "Вариант №3"; Types: custom; Flags: exclusive;
Name: M16A4; Description: M16A4(M4):; Types: full; Flags: fixed;
Name: M16A4\OPTION1; Description: "Вариант №1"; Types: full; Flags: exclusive;
Name: M16A4\OPTION2; Description: "Вариант №2"; Types: custom; Flags: exclusive;
Name: M16A4\OPTION3; Description: "Вариант №3"; Types: custom; Flags: exclusive;
Name: M16A4\OPTION4; Description: "Вариант №4"; Types: custom; Flags: exclusive;
Name: UMP9; Description: UMP9(MP5):; Types: full; Flags: fixed;
Name: UMP9\OPTION1; Description: "Вариант №1"; Types: full; Flags: exclusive;
Name: UMP9\OPTION2; Description: "Вариант №2"; Types: custom; Flags: exclusive;
Name: S1897; Description: S1897(ShotGun):; Types: full; Flags: fixed;
Name: S1897\OPTION1; Description: "Вариант №1"; Types: full; Flags: exclusive;
Name: S1897\OPTION2; Description: "Вариант №2"; Types: custom; Flags: exclusive;
Name: UZI; Description: UZI(Micro SMG):; Types: full; Flags: fixed;
Name: UZI\OPTION1; Description: "Вариант №1"; Types: full; Flags: exclusive;
Name: UZI\OPTION2; Description: "Вариант №2"; Types: custom; Flags: exclusive;
Name: UZI\OPTION3; Description: "Вариант №3"; Types: custom; Flags: exclusive;
Name: UZI\OPTION4; Description: "Вариант №4"; Types: custom; Flags: exclusive;
[Files]
Source: "files\other\tool.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "files\other\temp.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "files\other\tool.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "files\other\img.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "files\textures\akm\option 1\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: AKM\OPTION1;
Source: "files\textures\akm\option 2\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: AKM\OPTION2;
Source: "files\textures\akm\option 3\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: AKM\OPTION3;
Source: "files\textures\akm\option 4\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: AKM\OPTION4;
Source: "files\textures\colt45\option 1\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: COLT45\OPTION1;
Source: "files\textures\colt45\option 2\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: COLT45\OPTION2;
Source: "files\textures\colt45\option 3\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: COLT45\OPTION3;
Source: "files\textures\colt45\option 4\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: COLT45\OPTION4;
Source: "files\textures\kar98k\option 1\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: KAR98K\OPTION1;
Source: "files\textures\kar98k\option 2\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: KAR98K\OPTION2;
Source: "files\textures\kar98k\option 3\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: KAR98K\OPTION3;
Source: "files\textures\m16a4\option 1\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: M16A4\OPTION1;
Source: "files\textures\m16a4\option 2\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: M16A4\OPTION2;
Source: "files\textures\m16a4\option 3\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: M16A4\OPTION3;
Source: "files\textures\m16a4\option 4\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: M16A4\OPTION4;
Source: "files\textures\ump9\option 1\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: UMP9\OPTION1;
Source: "files\textures\ump9\option 2\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: UMP9\OPTION2;
Source: "files\textures\s1897\option 1\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: S1897\OPTION1;
Source: "files\textures\s1897\option 2\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: S1897\OPTION2;
Source: "files\textures\uzi\option 1\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: UZI\OPTION1;
Source: "files\textures\uzi\option 2\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: UZI\OPTION2;
Source: "files\textures\uzi\OPTION 3\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: UZI\OPTION3;
Source: "files\textures\uzi\OPTION 4\*"; DestDir: "{app}\Textures"; Flags: ignoreversion; Components: UZI\OPTION4;
Source: "images\textures\*"; DestDir: {tmp}; Flags: dontcopy;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
case CurPageID of
wpSelectDir:
if not FileExists(ExpandConstant('{app}\gta_sa.exe')) then begin
MsgBox('Ошибка! Вы должны указать путь к папке Grand Theft Auto - San Andreas(к файлу gta_sa.exe).', mbError, MB_OK);
Result := False;
end;
end;
end;
procedure SomeProc;
begin
end;
var
DelTmp: TNewCheckBox;
function DelTmpCheck(): boolean;
begin
result := DelTmp.Checked;
end;
var
ImagePanel: TPanel;
ComponentsInfoImage: TBitmapImage;
procedure ComponentsListClickCheck(Sender: TObject);
begin
If IsComponentSelected('AKM\OPTION1') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\akm_1.bmp')) else
If IsComponentSelected('AKM\OPTION2') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\akm_2.bmp')) else
If IsComponentSelected('AKM\OPTION3') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\akm_3.bmp')) else
If IsComponentSelected('AKM\OPTION4') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\akm_4.bmp')) else
If IsComponentSelected('COLT45\OPTION1') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\colt45_1.bmp')) else
If IsComponentSelected('COLT45\OPTION2') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\colt45_2.bmp')) else
If IsComponentSelected('COLT45\OPTION3') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\colt45_3.bmp')) else
If IsComponentSelected('COLT45\OPTION4') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\colt45_4.bmp')) else
If IsComponentSelected('KAR98K\OPTION1') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\kar98k_1.bmp')) else
If IsComponentSelected('KAR98K\OPTION2') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\kar98k_2.bmp')) else
If IsComponentSelected('KAR98K\OPTION3') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\kar98k_3.bmp')) else
If IsComponentSelected('M16A4\OPTION1') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\m4a16_1.bmp')) else
If IsComponentSelected('M16A4\OPTION2') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\m4a16_2.bmp')) else
If IsComponentSelected('M16A4\OPTION3') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\m4a16_3.bmp')) else
If IsComponentSelected('M16A4\OPTION4') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\m4a16_4.bmp')) else
If IsComponentSelected('UMP9\OPTION1') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\ump9_1.bmp')) else
If IsComponentSelected('UMP9\OPTION2') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\ump9_2.bmp')) else
If IsComponentSelected('S1897\OPTION1') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\s1897_1.bmp')) else
If IsComponentSelected('S1897\OPTION2') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\s1897_2.bmp')) else
If IsComponentSelected('S1897\OPTION3') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\uzi_1.bmp')) else
If IsComponentSelected('UZI\OPTION2') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\uzi_2.bmp')) else
If IsComponentSelected('UZI\OPTION3') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\uzi_3.bmp')) else
If IsComponentSelected('UZI\OPTION4') then
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\uzi_4.bmp'));
end;
procedure InitializeWizard();
begin
WizardForm.TYPESCOMBO.Visible:= false;
WizardForm.ComponentsList.Visible := True;
WizardForm.ComponentsList.Height := ScaleX(150);
WizardForm.ComponentsList.Top := ScaleX(47);
WizardForm.ComponentsList.Width := ScaleX(232);
WizardForm.ComponentsDiskSpaceLabel.Visible := True;
ImagePanel := TPanel.Create(WizardForm);
ImagePanel.Parent := WizardForm.SelectComponentsPage;
ImagePanel.Caption := '';
ImagePanel.Top := ScaleX(47);
ImagePanel.Left := ScaleX(240);
ImagePanel.Width := ScaleX(177);
ImagePanel.Height := ScaleX(151);
ImagePanel.BevelInner := bvRaised;
ImagePanel.BevelOuter := bvLowered;
ExtractTemporaryFile('akm_1.bmp');
ExtractTemporaryFile('akm_2.bmp');
ExtractTemporaryFile('akm_3.bmp');
ExtractTemporaryFile('akm_4.bmp');
ExtractTemporaryFile('colt45_1.bmp');
ExtractTemporaryFile('colt45_2.bmp');
ExtractTemporaryFile('colt45_3.bmp');
ExtractTemporaryFile('colt45_4.bmp');
ExtractTemporaryFile('kar98k_1.bmp');
ExtractTemporaryFile('kar98k_2.bmp');
ExtractTemporaryFile('kar98k_3.bmp');
ExtractTemporaryFile('m4a16_1.bmp');
ExtractTemporaryFile('m4a16_2.bmp');
ExtractTemporaryFile('m4a16_3.bmp');
ExtractTemporaryFile('m4a16_4.bmp');
ExtractTemporaryFile('ump9_1.bmp');
ExtractTemporaryFile('ump9_2.bmp');
ExtractTemporaryFile('s1897_1.bmp');
ExtractTemporaryFile('s1897_2.bmp');
ExtractTemporaryFile('uzi_1.bmp');
ExtractTemporaryFile('uzi_2.bmp');
ExtractTemporaryFile('uzi_3.bmp');
ExtractTemporaryFile('uzi_4.bmp');
WizardForm.ComponentsList.OnClickCheck:= @ComponentsListClickCheck;
ComponentsInfoImage:= TBitmapImage.Create(WizardForm);
ComponentsInfoImage.Parent:= ImagePanel;
ComponentsInfoImage.Top:= ScaleY(4);
ComponentsInfoImage.Left:= ScaleX(4);
ComponentsInfoImage.Width:= ScaleX(168);
ComponentsInfoImage.Height:= ScaleY(142);
ComponentsInfoImage.Stretch:= True;
ComponentsInfoImage.BringToFront;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
case CurPageID of
wpSelectComponents: ComponentsListClickCheck(nil);
end;
end;
El Sanchez
05-12-2017, 09:07
Нужна помощь, отображаются только первые четыре картинки. »
TheLeon, в ComponentsListClickCheck после выбора одного из компонентов AKM\OPTION* будет выход из условия, все остальные компоненты не проверятся никогда. В этих строках вместо else поставьте ;, вместо S1897\OPTION3 должно быть UZI\OPTION1 (опечатка?)
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\akm_4.bmp'));
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\colt45_4.bmp'));
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\kar98k_3.bmp'));
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\m4a16_4.bmp'));
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\ump9_2.bmp'));
ComponentsInfoImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\s1897_2.bmp'));
El Sanchez, также вопрос, как во вкладке выбора компонентов убрать размерность для следующих пунктов?
Name: MAIN; Description: Основное оружие:; Types: full; Flags: fixed; <----- убрать размерность
Name: MAIN\AKM; Description: AKM(AK-47):; Types: full; Flags: fixed; <----- убрать размерность
Name: MAIN\AKM\OPTION1; Description: "Вариант №1"; Flags: exclusive;
Name: MAIN\AKM\OPTION2; Description: "Вариант №2"; Flags: exclusive;
Name: MAIN\AKM\OPTION3; Description: "Вариант №3"; Flags: exclusive;
Name: MAIN\AKM\OPTION4; Description: "Вариант №4"; Flags: exclusive;
Name: MAIN\KAR98K; Description: Kar98k(Rifle):; Types: full; Flags: fixed; <----- убрать размерность
Name: MAIN\KAR98K\OPTION1; Description: "Вариант №1"; Flags: exclusive;
Name: MAIN\KAR98K\OPTION2; Description: "Вариант №2"; Flags: exclusive;
Name: MAIN\KAR98K\OPTION3; Description: "Вариант №3"; Flags: exclusive;
Name: MAIN\M16A4; Description: M16A4(M4):; Types: full; Flags: fixed; <----- убрать размерность
Name: MAIN\M16A4\OPTION1; Description: "Вариант №1";Flags: exclusive;
Name: MAIN\M16A4\OPTION2; Description: "Вариант №2";Flags: exclusive;
Name: MAIN\M16A4\OPTION3; Description: "Вариант №3";Flags: exclusive;
Name: MAIN\M16A4\OPTION4; Description: "Вариант №4";Flags: exclusive;
Name: MAIN\UMP9; Description: UMP9(MP5):; Types: full; Flags: fixed; <----- убрать размерность
Name: MAIN\UMP9\OPTION1; Description: "Вариант №1";Flags: exclusive;
Name: MAIN\UMP9\OPTION2; Description: "Вариант №2";Flags: exclusive;
Name: MAIN\S1897; Description: S1897(ShotGun):; Types: full; Flags: fixed; <----- убрать размерность
Name: MAIN\S1897\OPTION1; Description: "Вариант №1";Flags: exclusive;
Name: MAIN\S1897\OPTION2; Description: "Вариант №2";Flags: exclusive;
Name: MAIN\UZI; Description: UZI(Micro SMG):; Types: full; Flags: fixed; <----- убрать размерность
Name: MAIN\UZI\OPTION1; Description: "Вариант №1";Flags: exclusive;
Name: MAIN\UZI\OPTION2; Description: "Вариант №2";Flags: exclusive;
Name: MAIN\UZI\OPTION3; Description: "Вариант №3";Flags: exclusive;
Name: MAIN\UZI\OPTION4; Description: "Вариант №4";Flags: exclusive;
Name: ADD; Description: Дополнительное оружие:; Types: full; Flags: fixed; <----- убрать размерность
Name: ADD\COLT45; Description: Colt.45(Pistol):; Types: full; Flags: fixed; <----- убрать размерность
Name: ADD\COLT45\OPTION1; Description: "Вариант №1";Flags: exclusive;
Name: ADD\COLT45\OPTION2; Description: "Вариант №2";Flags: exclusive;
Name: ADD\COLT45\OPTION3; Description: "Вариант №3";Flags: exclusive;
Name: ADD\COLT45\OPTION4; Description: "Вариант №4";Flags: exclusive;
El Sanchez, действительно, была опечатка с UZI, за это спасибо. Проблема опять с отображением, показывает только COLT45 из компонентов. Я тебя понял неправильно.
kreotodr
05-12-2017, 13:53
Добрый день всем!
Подскажите, как решается подобное?
http://s018.radikal.ru/i500/1712/ac/9b9bdcdcf4d8t.jpg (http://radikal.ru/big/983erk0kp4i8d)
kreotodr
05-12-2017, 14:45
Речь идет про повышение привилегий до уровня Администратора..
установка PrivilegesRequired=admin
эффекта не дает...
То есть, если инсталятор запущен без прав админа, восполнение инструкций требующих права Администратора закончатся сбоем. Даже при наличии PrivilegesRequired=admin
El Sanchez
06-12-2017, 10:23
Я тебя понял неправильно. »
TheLeon, да я тоже неправильно подсказал. Вот так можно:
[Components]
Name: MAIN; Description: {code:CompHelper|Основное оружие:}; Types: full; Flags: fixed
Name: MAIN\AKM; Description: {code:CompHelper|AKM(AK-47):}; Types: full; Flags: fixed
Name: MAIN\AKM\OPTION1; Description: {code:CompHelper|Вариант №1|akm_1.bmp}; Flags: exclusive
Name: MAIN\AKM\OPTION2; Description: {code:CompHelper|Вариант №2|akm_2.bmp}; Flags: exclusive
Name: MAIN\AKM\OPTION3; Description: {code:CompHelper|Вариант №3|akm_3.bmp}; Flags: exclusive
Name: MAIN\AKM\OPTION4; Description: {code:CompHelper|Вариант №4|akm_4.bmp}; Flags: exclusive
Name: MAIN\KAR98K; Description: {code:CompHelper|Kar98k(Rifle):}; Types: full; Flags: fixed
Name: MAIN\KAR98K\OPTION1; Description: {code:CompHelper|Вариант №1|kar98k_1.bmp}; Flags: exclusive
Name: MAIN\KAR98K\OPTION2; Description: {code:CompHelper|Вариант №2|kar98k_2.bmp}; Flags: exclusive
Name: MAIN\KAR98K\OPTION3; Description: {code:CompHelper|Вариант №3|kar98k_3.bmp}; Flags: exclusive
Name: MAIN\M16A4; Description: {code:CompHelper|M16A4(M4):}; Types: full; Flags: fixed
Name: MAIN\M16A4\OPTION1; Description: {code:CompHelper|Вариант №1|m4a16_1.bmp}; Flags: exclusive
Name: MAIN\M16A4\OPTION2; Description: {code:CompHelper|Вариант №2|m4a16_2.bmp}; Flags: exclusive
Name: MAIN\M16A4\OPTION3; Description: {code:CompHelper|Вариант №3|m4a16_3.bmp}; Flags: exclusive
Name: MAIN\M16A4\OPTION4; Description: {code:CompHelper|Вариант №4|m4a16_4.bmp}; Flags: exclusive
Name: MAIN\UMP9; Description: {code:CompHelper|UMP9(MP5):}; Types: full; Flags: fixed
Name: MAIN\UMP9\OPTION1; Description: {code:CompHelper|Вариант №1|ump9_1.bmp}; Flags: exclusive
Name: MAIN\UMP9\OPTION2; Description: {code:CompHelper|Вариант №2|ump9_2.bmp}; Flags: exclusive
Name: MAIN\S1897; Description: {code:CompHelper|S1897(ShotGun):}; Types: full; Flags: fixed
Name: MAIN\S1897\OPTION1; Description: {code:CompHelper|Вариант №1|s1897_1.bmp}; Flags: exclusive
Name: MAIN\S1897\OPTION2; Description: {code:CompHelper|Вариант №2|s1897_2.bmp}; Flags: exclusive
Name: MAIN\UZI; Description: {code:CompHelper|UZI(Micro SMG):}; Types: full; Flags: fixed
Name: MAIN\UZI\OPTION1; Description: {code:CompHelper|Вариант №1|uzi_1.bmp}; Flags: exclusive
Name: MAIN\UZI\OPTION2; Description: {code:CompHelper|Вариант №2|uzi_2.bmp}; Flags: exclusive
Name: MAIN\UZI\OPTION3; Description: {code:CompHelper|Вариант №3|uzi_3.bmp}; Flags: exclusive
Name: MAIN\UZI\OPTION4; Description: {code:CompHelper|Вариант №4|uzi_4.bmp}; Flags: exclusive
Name: ADD; Description: {code:CompHelper|Дополнительное оружие:}; Types: full; Flags: fixed
Name: ADD\COLT45; Description: {code:CompHelper|Colt.45(Pistol):}; Types: full; Flags: fixed
Name: ADD\COLT45\OPTION1; Description: {code:CompHelper|Вариант №1|colt45_1.bmp}; Flags: exclusive
Name: ADD\COLT45\OPTION2; Description: {code:CompHelper|Вариант №2|colt45_2.bmp}; Flags: exclusive
Name: ADD\COLT45\OPTION3; Description: {code:CompHelper|Вариант №3|colt45_3.bmp}; Flags: exclusive
Name: ADD\COLT45\OPTION4; Description: {code:CompHelper|Вариант №4|colt45_4.bmp}; Flags: exclusive
[Code]
var
ImagePanel: TPanel;
ComponentsInfoImage: TBitmapImage;
ComponentHelper: TStringList;
function CompHelper(Param: string): string;
var
Image: TBitmap;
Index: Integer;
begin
Result := '';
with TStringList.Create do
try
StringChangeEx(Param, '|', #13#10, True);
Text := Param;
if Count = 0 then Exit;
if Count > 0 then // description
Index := ComponentHelper.Add(Strings[0]);
if Count > 1 then // image
begin
if not FileExists(ExpandConstant('{tmp}\') + Strings[1]) then
ExtractTemporaryFile(Strings[1]);
Image := TBitmap.Create;
Image.LoadFromFile(ExpandConstant('{tmp}\') + Strings[1]);
ComponentHelper.Objects[Index] := Image;
end;
Result := ComponentHelper[Index];
finally
Free;
end;
end;
procedure ComponentsListClickCheck(Sender: TObject);
begin
if not Assigned(Sender) or (TNewCheckListBox(Sender).ItemIndex = -1) then Exit;
ComponentsInfoImage.Bitmap.Assign(TBitmap(ComponentHelper.Objects[TNewCheckListBox(Sender).ItemIndex]));
end;
function InitializeSetup(): Boolean;
begin
Result := True;
ComponentHelper := TStringList.Create;
ComponentHelper.Duplicates := dupIgnore;
end;
также вопрос, как во вкладке выбора компонентов убрать размерность для следующих пунктов? »
TheLeon, где-нибудь в InitializeWizard:
for i := 0 to WizardForm.ComponentsList.ItemCount - 1 do
if not WizardForm.ComponentsList.ItemEnabled[i] then
WizardForm.ComponentsList.ItemSubItem[i] := '';
El Sanchez
06-12-2017, 11:31
Поставил в конец InitializeWizard. Пишет, что "Неизвестный идентификатор i" »
TheLeon, ну и объявите ее в начале InitializeWizard.
El Sanchez, извините, но все равно не получается запихнуть ваши строки, вечно на что-то жалуется.(
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
case CurPageID of
wpSelectDir:
if not FileExists(ExpandConstant('{app}\gta_sa.exe')) then begin
MsgBox('Ошибка! Вы должны указать путь к папке Grand Theft Auto - San Andreas', mbError, MB_OK);
Result := False;
end;
end;
end;
var
ImagePanel: TPanel;
ComponentsInfoImage: TBitmapImage;
ComponentHelper: TStringList;
function CompHelper(Param: string): string;
var
Image: TBitmap;
Index: Integer;
begin
Result := '';
with TStringList.Create do
try
StringChangeEx(Param, '|', #13#10, True);
Text := Param;
if Count = 0 then Exit;
if Count > 0 then // description
Index := ComponentHelper.Add(Strings[0]);
if Count > 1 then // image
begin
if not FileExists(ExpandConstant('{tmp}\') + Strings[1]) then
ExtractTemporaryFile(Strings[1]);
Image := TBitmap.Create;
Image.LoadFromFile(ExpandConstant('{tmp}\') + Strings[1]);
ComponentHelper.Objects[Index] := Image;
end;
Result := ComponentHelper[Index];
finally
Free;
end;
end;
procedure ComponentsListClickCheck(Sender: TObject);
begin
if not Assigned(Sender) or (TNewCheckListBox(Sender).ItemIndex = -1) then Exit;
ComponentsInfoImage.Bitmap.Assign(TBitmap(ComponentHelper.Objects[TNewCheckListBox(Sender).ItemIndex]));
end;
function InitializeSetup(): Boolean;
begin
Result := True;
ComponentHelper := TStringList.Create;
ComponentHelper.Duplicates := dupIgnore;
end;
procedure InitializeWizard();
begin
WizardForm.TYPESCOMBO.Visible:= false;
WizardForm.ComponentsList.Visible := True;
WizardForm.ComponentsList.Height := ScaleX(150);
WizardForm.ComponentsList.Top := ScaleX(47);
WizardForm.ComponentsList.Width := ScaleX(232);
WizardForm.ComponentsDiskSpaceLabel.Visible := True;
ImagePanel := TPanel.Create(WizardForm);
ImagePanel.Parent := WizardForm.SelectComponentsPage;
ImagePanel.Caption := '';
ImagePanel.Top := ScaleX(47);
ImagePanel.Left := ScaleX(240);
ImagePanel.Width := ScaleX(177);
ImagePanel.Height := ScaleX(151);
ImagePanel.BevelInner := bvRaised;
ImagePanel.BevelOuter := bvLowered;
ExtractTemporaryFile('akm_1.bmp');
ExtractTemporaryFile('akm_2.bmp');
ExtractTemporaryFile('akm_3.bmp');
ExtractTemporaryFile('akm_4.bmp');
ExtractTemporaryFile('kar98k_1.bmp');
ExtractTemporaryFile('kar98k_2.bmp');
ExtractTemporaryFile('kar98k_3.bmp');
ExtractTemporaryFile('ump9_1.bmp');
ExtractTemporaryFile('ump9_2.bmp');
ExtractTemporaryFile('s1897_1.bmp');
ExtractTemporaryFile('s1897_2.bmp');
ExtractTemporaryFile('uzi_1.bmp');
ExtractTemporaryFile('uzi_2.bmp');
ExtractTemporaryFile('uzi_3.bmp');
ExtractTemporaryFile('uzi_4.bmp');
ExtractTemporaryFile('colt45_1.bmp');
ExtractTemporaryFile('colt45_2.bmp');
ExtractTemporaryFile('colt45_3.bmp');
ExtractTemporaryFile('colt45_4.bmp');
ExtractTemporaryFile('molotov_1.bmp');
ExtractTemporaryFile('molotov_2.bmp');
ExtractTemporaryFile('molotov_3.bmp');
ExtractTemporaryFile('grenade_1.bmp');
ExtractTemporaryFile('grenade_2.bmp');
WizardForm.ComponentsList.OnClickCheck:= @ComponentsListClickCheck;
ComponentsInfoImage:= TBitmapImage.Create(WizardForm);
ComponentsInfoImage.Parent:= ImagePanel;
ComponentsInfoImage.Top:= ScaleY(4);
ComponentsInfoImage.Left:= ScaleX(4);
ComponentsInfoImage.Width:= ScaleX(168);
ComponentsInfoImage.Height:= ScaleY(142);
ComponentsInfoImage.Stretch:= True;
ComponentsInfoImage.BringToFront;
end;
Iska, поможете правильно запихнуть следующий код: »
TheLeon, нет, не помогу запихнуть.
El Sanchez
06-12-2017, 14:45
но все равно не получается запихнуть ваши строки, вечно на что-то жалуется.( »
TheLeon, копировать-вставить:
[Code]
var
ImagePanel: TPanel;
ComponentsInfoImage: TBitmapImage;
ComponentHelper: TStringList;
function CompHelper(Param: string): string;
var
Image: TBitmap;
Index: Integer;
begin
Result := '';
with TStringList.Create do
try
StringChangeEx(Param, '|', #13#10, True);
Text := Param;
if Count = 0 then Exit;
if Count > 0 then // description
Index := ComponentHelper.Add(Strings[0]);
if Count > 1 then // image
begin
if not FileExists(ExpandConstant('{tmp}\') + Strings[1]) then
ExtractTemporaryFile(Strings[1]);
Image := TBitmap.Create;
Image.LoadFromFile(ExpandConstant('{tmp}\') + Strings[1]);
ComponentHelper.Objects[Index] := Image;
end;
Result := ComponentHelper[Index];
finally
Free;
end;
end;
procedure ComponentsListClickCheck(Sender: TObject);
begin
if not Assigned(Sender) or (TNewCheckListBox(Sender).ItemIndex = -1) then Exit;
ComponentsInfoImage.Bitmap.Assign(TBitmap(ComponentHelper.Objects[TNewCheckListBox(Sender).ItemIndex]));
end;
function InitializeSetup(): Boolean;
begin
Result := True;
ComponentHelper := TStringList.Create;
ComponentHelper.Duplicates := dupIgnore;
end;
procedure InitializeWizard();
var
i: Integer;
begin
WizardForm.TypesCombo.Visible := False;
WizardForm.ComponentsList.Visible := True;
WizardForm.ComponentsList.Height := ScaleX(150);
WizardForm.ComponentsList.Top := ScaleX(47);
WizardForm.ComponentsList.Width := ScaleX(232);
for i := 0 to WizardForm.ComponentsList.ItemCount - 1 do
if not WizardForm.ComponentsList.ItemEnabled[i] then
WizardForm.ComponentsList.ItemSubItem[i] := '';
WizardForm.ComponentsDiskSpaceLabel.Visible := True;
ImagePanel := TPanel.Create(WizardForm);
ImagePanel.Parent := WizardForm.SelectComponentsPage;
ImagePanel.Caption := '';
ImagePanel.Top := ScaleX(47);
ImagePanel.Left := ScaleX(240);
ImagePanel.Width := ScaleX(177);
ImagePanel.Height := ScaleX(151);
ImagePanel.BevelInner := bvRaised;
ImagePanel.BevelOuter := bvLowered;
WizardForm.ComponentsList.OnClickCheck:= @ComponentsListClickCheck;
ComponentsInfoImage:= TBitmapImage.Create(WizardForm);
ComponentsInfoImage.Parent:= ImagePanel;
ComponentsInfoImage.Top:= ScaleY(4);
ComponentsInfoImage.Left:= ScaleX(4);
ComponentsInfoImage.Width:= ScaleX(168);
ComponentsInfoImage.Height:= ScaleY(142);
ComponentsInfoImage.Stretch:= True;
ComponentsInfoImage.BringToFront;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
case CurPageID of
wpSelectComponents: ComponentsListClickCheck(nil);
end;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
case CurPageID of
wpSelectDir:
if not FileExists(ExpandConstant('{app}\gta_sa.exe')) then begin
MsgBox('Ошибка! Вы должны указать путь к папке Grand Theft Auto - San Andreas', mbError, MB_OK);
Result := False;
end;
end;
end;
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.