Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  | Правила  

Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » Скрипты Inno Setup. Помощь и советы [часть 8]

Закрытая тема
Настройки темы
Скрипты Inno Setup. Помощь и советы [часть 8]

Аватара для El Sanchez

Ветеран


Contributor


Сообщения: 1274
Благодарности: 1030


Конфигурация

Профиль | Отправить PM | Цитировать


Изменения
Автор: El Sanchez
Дата: 22-10-2015
Внимание! Данная тема предназначена только для обсуждения написания скриптов !
Остальные вопросы, а также последние версии компилятора в теме
Inno Setup. Прочие вопросы.


Показать/скрыть: Справка, руководство, примеры:

Показать/скрыть: Ссылки на примеры скриптов:

Показать/скрыть: Дополнительные программы для Inno Setup:
  • ISTool - неплохой редактор скриптов Inno Setup.
    Последняя версия: 5.3.0.1 [29.09.2009] - Скачать | зеркало;

  • Inno Script Generator - генератор скриптов Inno Setup. Обладает некоторыми полезными функциями, которых нет ни у самого Inno Setup, ни у ISTool.
    Последняя версия: 1.0.3.1 [23.03.2008] - Скачать | зеркало на русифицированную программу;
    Примечание: Родной сайт www.hisoft2000.de более недоступен, поэтому здесь расположены сторонние ссылки.

  • Inno Setup Form Designer - редактор страниц Inno Setup, можно создавать свои страницы.
    Последняя версия: 2.0.8 [12.11.2006] - Скачать;
    Примечание: Родной сайт http://isfd.kaju74.de/index.php?isfd более недоступен, поэтому здесь расположены сторонние ссылки.

  • Inno Setup GameScript Generator - программа генерирует скрипты для Inno Setup . С помощью GameScript Generator и Inno Setup вы сможете быстро создать простенький инсталляционный пакет для любой игры. В инсталлятор можно встроить музыку, слайдшоу и фоновый рисунок. Для специалистов созданный скрипт, возможно, будет неплохой заготовкой для дальнейшей модернизации;

  • ISSkin - Программа для создания и добавления в инсталлятор скинов. Инструкция.
    Последняя версия: 3.0.0.0 [19.01.2010] - Скачать;

  • ISSJoiner - Программа для объединения нескольких скриптов InnoSetup в один.
    Последняя версия: 3.0 [23.07.2009]

  • Converter - Программа конвертирует reg-файлы в формат *.iss (формат скриптов Inno Setup).
    Последняя версия: 0.1.4 [13.03.2010] - Скачать;

  • RegExporter - Фриварная утилита для экспорта реестра и конвертации файлов *.reg и *.ini в инсталляционные скрипты Inno Setup и NSIS.
    Последняя версия: 1.2.0 [23.09.2014] - Скачать;



Предыдущие ветки обсуждения по ссылкам ниже и в прикреплённых архивах:

Скрипты Inno Setup. Помощь и советы [часть 6]
Скрипты Inno Setup. Помощь и советы [часть 7]

Отправлено: 08:52, 02-02-2015

 

Аватара для TheLeon

Пользователь


Сообщения: 50
Благодарности: 0

Профиль | Отправить PM | Цитировать


Нужна помощь, отображаются только первые четыре картинки.
Components

Код: Выделить весь код
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;

Code

Код: Выделить весь код
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;

Последний раз редактировалось TheLeon, 05-12-2017 в 13:14.


Отправлено: 16:10, 04-12-2017 | #2291



Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети.

Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля.


Аватара для El Sanchez

Ветеран


Contributor


Сообщения: 1274
Благодарности: 1030

Профиль | Отправить PM | Цитировать


Цитата TheLeon:
Нужна помощь, отображаются только первые четыре картинки. »
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'));
Это сообщение посчитали полезным следующие участники:

Отправлено: 09:07, 05-12-2017 | #2292


Аватара для TheLeon

Пользователь


Сообщения: 50
Благодарности: 0

Профиль | Отправить PM | Цитировать


El Sanchez, также вопрос, как во вкладке выбора компонентов убрать размерность для следующих пунктов?
Components

Код: Выделить весь код
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 из компонентов. Я тебя понял неправильно.

Последний раз редактировалось TheLeon, 06-12-2017 в 11:23.


Отправлено: 13:05, 05-12-2017 | #2293


Новый участник


Сообщения: 4
Благодарности: 0

Профиль | Отправить PM | Цитировать


Добрый день всем!
Подскажите, как решается подобное?

Отправлено: 13:53, 05-12-2017 | #2294


Новый участник


Сообщения: 4
Благодарности: 0

Профиль | Отправить PM | Цитировать


Речь идет про повышение привилегий до уровня Администратора..
установка PrivilegesRequired=admin
эффекта не дает...
То есть, если инсталятор запущен без прав админа, восполнение инструкций требующих права Администратора закончатся сбоем. Даже при наличии PrivilegesRequired=admin

Отправлено: 14:45, 05-12-2017 | #2295


Аватара для El Sanchez

Ветеран


Contributor


Сообщения: 1274
Благодарности: 1030

Профиль | Отправить PM | Цитировать


Цитата TheLeon:
Я тебя понял неправильно. »
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:
также вопрос, как во вкладке выбора компонентов убрать размерность для следующих пунктов? »
TheLeon, где-нибудь в InitializeWizard:
Скрытый текст

Код: Выделить весь код
for i := 0 to WizardForm.ComponentsList.ItemCount - 1 do
  if not WizardForm.ComponentsList.ItemEnabled[i] then
    WizardForm.ComponentsList.ItemSubItem[i] := '';
Это сообщение посчитали полезным следующие участники:

Отправлено: 10:23, 06-12-2017 | #2296


Аватара для El Sanchez

Ветеран


Contributor


Сообщения: 1274
Благодарности: 1030

Профиль | Отправить PM | Цитировать


Цитата TheLeon:
Поставил в конец InitializeWizard. Пишет, что "Неизвестный идентификатор i" »
TheLeon, ну и объявите ее в начале InitializeWizard.
Это сообщение посчитали полезным следующие участники:

Отправлено: 11:31, 06-12-2017 | #2297


Аватара для TheLeon

Пользователь


Сообщения: 50
Благодарности: 0

Профиль | Отправить PM | Цитировать


El Sanchez, извините, но все равно не получается запихнуть ваши строки, вечно на что-то жалуется.(
Code

Код: Выделить весь код
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;

Последний раз редактировалось TheLeon, 06-12-2017 в 14:56.


Отправлено: 13:18, 06-12-2017 | #2298


Ветеран


Сообщения: 27449
Благодарности: 8088

Профиль | Отправить PM | Цитировать


Цитата TheLeon:
Iska, поможете правильно запихнуть следующий код: »
TheLeon, нет, не помогу запихнуть.

Отправлено: 13:57, 06-12-2017 | #2299


Аватара для El Sanchez

Ветеран


Contributor


Сообщения: 1274
Благодарности: 1030

Профиль | Отправить PM | Цитировать


Цитата TheLeon:
но все равно не получается запихнуть ваши строки, вечно на что-то жалуется.( »
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;
Это сообщение посчитали полезным следующие участники:

Отправлено: 14:45, 06-12-2017 | #2300



Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » Скрипты Inno Setup. Помощь и советы [часть 8]

Участник сейчас на форуме Участник сейчас на форуме Участник вне форума Участник вне форума Автор темы Автор темы Шапка темы Сообщение прикреплено

Похожие темы
Название темы Автор Информация о форуме Ответов Последнее сообщение
Скрипты Inno Setup. Помощь и советы [часть 7] El Sanchez Автоматическая установка приложений 2499 02-02-2015 08:59
Скрипты Inno Setup. Помощь и советы [часть 6] El Sanchez Автоматическая установка приложений 2494 10-03-2014 11:51
Скрипты Inno Setup. Помощь и советы [часть 5] El Sanchez Автоматическая установка приложений 1999 28-03-2013 19:09
Скрипты Inno Setup. Помощь и советы [часть 4] El Sanchez Автоматическая установка приложений 2099 22-05-2012 23:16
Скрипты Inno Setup. Помощь и советы [часть 3] Serega Автоматическая установка приложений 3755 26-10-2011 17:58




 
Переход