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

Ответить
 • Просмотры: 45
Аватара пользователя
kotyarko@fb

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

Сообщение kotyarko@fb »

Okta_333,

Можешь скинуть скрины, какие галочки ставишь в FreeArc?
Аватара пользователя
NewMix

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

Сообщение NewMix »

Здравствуйте. Делаю модпак для танков и столкнулся с такой проблемой. В общем прописываю путь из реестра в скрипт мол чтобы определить установлена ли игра или нет, проверить версию патча и т.д но он не может найти игру. В чем проблема? Вот часть скрипта и скрин. Сразу говорю что использовал исходник от какого то мода для сталкера где была вбита проверка на игру и версию патча.

Изображение

PHP код:

Код: Выделить всё

//Ищем в реестре место расположения игры

function GetAppDir(Path: String): String;

begin

  if RegKeyExists(HKEY_LOCAL_MACHINE, 'Software\Wargaming.net\wot') then begin

    RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Wargaming.net\wot', 'InstallPath', Path);

    Result := Path end else

  Result := ExpandConstant('{pf}\Software\Wargaming.net\wot')

end;

//Выполняем проверку системы на соответсвтвие моду

procedure CheckRequirements(CurPageID: Integer);

var

  Path, Vers: String;

begin

  if CurPageID=SystemPage.ID then

  begin

    //Ищем папку с игрой

    if RegValueExists(HKLM, 'Software\Wargaming.net\wot', 'InstallPath') then

    begin

      RegQueryStringValue(HKLM, 'Software\Wargaming.net\wot', 'InstallPath', Path)

      GamePathFindMemo.Caption := ExpandConstant('{cm:GameDetected}');

    end else

    begin

      GamePathFindMemo.Caption := ExpandConstant('{cm:GameNotDetected}');

      GamePathFindMemo.Color := clRed;

      ReqSatisfy.Caption := ExpandConstant('{cm:NotReqSatisfy}');

    end;

    //Ищем и проверяем версию игры

    if RegValueExists(HKLM, 'Software\Wargaming.net\wot', 'InstallVers') then

    begin

      RegQueryStringValue(HKLM, 'Software\Wargaming.net\wot', 'InstallVers', Vers)

      if Vers = ExpandConstant('{#NeedVers}') then

        GameVersFindMemo.Caption := ExpandConstant('{cm:GameVersDetected} ') + Vers

      else begin

        GameVersFindMemo.Caption := ExpandConstant('{cm:GameVers} ') + Vers + ExpandConstant(' {cm:GameVersNotSatisfy}');

        GameVersFindMemo.Color := clRed;

        ReqSatisfy.Caption := ExpandConstant('{cm:NotReqSatisfy}');

      end

    end else

    begin

      GameVersFindMemo.Caption := ExpandConstant('{cm:GameVersNotDetected}');

      GameVersFindMemo.Color := clRed;

      ReqSatisfy.Caption := ExpandConstant('{cm:NotReqSatisfy}');

    end;

    //Ищем наличие модов в папке с игрой

    if RegValueExists(HKLM, 'Software\Wargaming.net\wot', 'InstallPath') then

    begin

      if DirExists(Path+'\res_mods\0.9.6') then

      begin

        GameModFindMemo.Caption := ExpandConstant('{cm:ModDetected}');

        GameModFindMemo.Color := clRed;

        ReqSatisfy.Caption := ExpandConstant('{cm:NotReqSatisfy}');

        RenameCheckBox.Show;

      end else

        GameModFindMemo.Caption := ExpandConstant('{cm:ModNotDetected}');

      end else

    begin

      GameModFindMemo.Caption := ExpandConstant('{cm:GameNotDetected}');

      GameModFindMemo.Color := clRed;

      ReqSatisfy.Caption := ExpandConstant('{cm:NotReqSatisfy}');

    end;

  end;

end; 

Аватара пользователя
NewMix

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

Сообщение NewMix »

MogilShik2007



Нет, скрины скинуть не смогу, сижу с телефона.

Но по памяти скажу, как сама делала. Заходишь во вкладку Шифрование, указываешь пароль. Далее возвращаешься на первую вкладку и ставишь галочку на Шифрование (алгоритм стандартный, в нем как раз отмечена команда -hp, сокрытие каталогов). Далее архиваруешь.



Nik1967



Вот научиться бы ими пользоваться!!! Я новичок!!!



CLS для меня пока что китайские иероглифы!!! Стараюсь учиться.....



А распаковка этим CLS пошустрее проходит? Или это для простоты использования?
Аватара пользователя
svs23

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

Сообщение svs23 »

возможно сделать несколько страниц выбора компонентов? при этом с сохранением Components: в [Files], т.е. без Check: как в этом примере

Скрытый текст

[spoiler]

Код: Выделить всё

[Setup]

AppName=Моя программа

AppVersion=1.5

DefaultDirName={pf}\Моя программа

DirExistsWarning=no

AppendDefaultDirName=no

[CustomMessages]

CompName1=Компонент 1

CompName2=Компонент 2

CompSubtitlesLng=Язык субтитров

CompVoiceLng=Язык озвучки

CompRussian=Русский

CompEnglish=Английский

[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}";

[Files]

//===========================ПЕРВАЯ СТРАНИЦА ПОСЛЕ КОМПОНЕНТОВ================================\\

Source: "compiler:Languages\Russian.isl"; DestDir: "{app}"; DestName: "TextRussian.isl"; Check: IsComponentsForm1(1)

Source: "compiler:Default.isl"; DestDir: "{app}"; DestName: "TextEnglish.isl"; Check: IsComponentsForm1(2)

Source: "compiler:Languages\Russian.isl"; DestDir: "{app}"; DestName: "VoiceRussian.isl"; Check: IsComponentsForm1(4)

Source: "compiler:Default.isl"; DestDir: "{app}"; DestName: "VoiceEnglish.isl"; Check: IsComponentsForm1(5)

//===========================ВТОРАЯ СТРАНИЦА ПОСЛЕ КОМПОНЕНТОВ================================\\

Source: "compiler:Languages\Russian.isl"; DestDir: "{app}"; DestName: "TextRussian.isl"; Check: IsComponentsForm2(1)

Source: "compiler:Default.isl"; DestDir: "{app}"; DestName: "TextEnglish.isl"; Check: IsComponentsForm2(2)

Source: "compiler:Languages\Russian.isl"; DestDir: "{app}"; DestName: "VoiceRussian.isl"; Check: IsComponentsForm2(4)

Source: "compiler:Default.isl"; DestDir: "{app}"; DestName: "VoiceEnglish.isl"; Check: IsComponentsForm2(5)

//===========================ТРЕТЬЯ СТРАНИЦА ПОСЛЕ КОМПОНЕНТОВ================================\\

Source: "compiler:Languages\Russian.isl"; DestDir: "{app}"; DestName: "TextRussian.isl"; Check: IsComponentsForm3(1)

Source: "compiler:Default.isl"; DestDir: "{app}"; DestName: "TextEnglish.isl"; Check: IsComponentsForm3(2)

Source: "compiler:Languages\Russian.isl"; DestDir: "{app}"; DestName: "VoiceRussian.isl"; Check: IsComponentsForm3(4)

Source: "compiler:Default.isl"; DestDir: "{app}"; DestName: "VoiceEnglish.isl"; Check: IsComponentsForm3(5)

[code]var
  ComponentsPage1,ComponentsPage2,ComponentsPage3: TWizardPage;
  SelectComponentsLabel1,SelectComponentsLabel2,SelectComponentsLabel3: TNewStaticText;
  ComponentsList1,ComponentsList2,ComponentsList3: TNewCheckListBox;
procedure ComponentsForm1;
begin
  ComponentsPage1 := CreateCustomPage(wpSelectComponents, 'ПЕРВАЯ СТРАНИЦА ПОСЛЕ КОМПОНЕНТОВ', SetupMessage(msgSelectComponentsDesc));
//========================================================================\\
  SelectComponentsLabel1 := TNewStaticText.Create(WizardForm);
  with SelectComponentsLabel1 do
  begin
    Parent := ComponentsPage1.Surface;
    SetBounds(ScaleX(0), ScaleY(0), ScaleX(417), ScaleY(42));
    AutoSize := False;
    WordWrap := True;
    Caption := SetupMessage(msgSelectComponentsLabel2);
  end;
//========================================================================\\
  ComponentsList1 := TNewCheckListBox.Create(WizardForm);
  with ComponentsList1 do
  begin
    Parent := ComponentsPage1.Surface;
    SetBounds(ScaleX(0), ScaleY(61), ScaleX(417), ScaleY(169));
    AddCheckBox(CustomMessage('CompSubtitlesLng'), '', 0, True, False, False, True, nil);  //0
      AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil);                //1
      AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil);               //2
    AddCheckBox(CustomMessage('CompVoiceLng'), '', 0, True, False, False, True, nil);      //3
      AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil);                //4
      AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil);               //5
  end;
end;
procedure ComponentsForm2;
begin
  ComponentsPage2 := CreateCustomPage(ComponentsPage1.ID, 'ВТОРАЯ СТРАНИЦА ПОСЛЕ КОМПОНЕНТОВ', SetupMessage(msgSelectComponentsDesc));
//========================================================================\\
  SelectComponentsLabel2 := TNewStaticText.Create(WizardForm);
  with SelectComponentsLabel2 do
  begin
    Parent := ComponentsPage2.Surface;
    SetBounds(ScaleX(0), ScaleY(0), ScaleX(417), ScaleY(42));
    AutoSize := False;
    WordWrap := True;
    Caption := SetupMessage(msgSelectComponentsLabel2);
  end;
//========================================================================\\
  ComponentsList2 := TNewCheckListBox.Create(WizardForm);
  with ComponentsList2 do
  begin
    Parent := ComponentsPage2.Surface;
    SetBounds(ScaleX(0), ScaleY(61), ScaleX(417), ScaleY(169));
    AddCheckBox(CustomMessage('CompSubtitlesLng'), '', 0, True, False, False, True, nil);  //0
      AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil);                //1
      AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil);               //2
    AddCheckBox(CustomMessage('CompVoiceLng'), '', 0, True, False, False, True, nil);      //3
      AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil);                //4
      AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil);               //5
  end;
end;
procedure ComponentsForm3;
begin
  ComponentsPage3 := CreateCustomPage(ComponentsPage2.ID, 'ТРЕТЬЯ СТРАНИЦА ПОСЛЕ КОМПОНЕНТОВ', SetupMessage(msgSelectComponentsDesc));
//========================================================================\\
  SelectComponentsLabel3 := TNewStaticText.Create(WizardForm);
  with SelectComponentsLabel3 do
  begin
    Parent := ComponentsPage3.Surface;
    SetBounds(ScaleX(0), ScaleY(0), ScaleX(417), ScaleY(42));
    AutoSize := False;
    WordWrap := True;
    Caption := SetupMessage(msgSelectComponentsLabel2);
  end;
//========================================================================\\
  ComponentsList3 := TNewCheckListBox.Create(WizardForm);
  with ComponentsList3 do
  begin
    Parent := ComponentsPage3.Surface;
    SetBounds(ScaleX(0), ScaleY(61), ScaleX(417), ScaleY(169));
    AddCheckBox(CustomMessage('CompSubtitlesLng'), '', 0, True, False, False, True, nil);  //0
      AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil);                //1
      AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil);               //2
    AddCheckBox(CustomMessage('CompVoiceLng'), '', 0, True, False, False, True, nil);      //3
      AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil);                //4
      AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil);               //5
  end;
end;
function IsComponentsForm1(CompIndex: Integer): Boolean;
var
  i: Integer;
begin
  Result := False;
  for i := 0 to ComponentsList1.ItemCount - 1 do
  begin
    if CompIndex <= (ComponentsList1.ItemCount - 1) then
      Result := ComponentsList1.Checked[CompIndex];
  end;
end;
//========================================================================\\
function IsComponentsForm2(CompIndex: Integer): Boolean;
var
  i: Integer;
begin
  Result := False;
  for i := 0 to ComponentsList2.ItemCount - 1 do
  begin
    if CompIndex <= (ComponentsList2.ItemCount - 1) then
      Result := ComponentsList2.Checked[CompIndex];
  end;
end;
//========================================================================\\
function IsComponentsForm3(CompIndex: Integer): Boolean;
var
  i: Integer;
begin
  Result := False;
  for i := 0 to ComponentsList3.ItemCount - 1 do
  begin
    if CompIndex <= (ComponentsList3.ItemCount - 1) then
      Result := ComponentsList3.Checked[CompIndex];
  end;
end;
procedure InitializeWizard();
begin
  ComponentsForm1;
  ComponentsForm2;
  ComponentsForm3;
end;
[/spoiler]

это вариант для меня сложноват...
Аватара пользователя
svs23

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

Сообщение svs23 »

Цитата Okta_333:

Но по памяти скажу, как сама делала. Заходишь во вкладку Шифрование, указываешь пароль. Далее возвращаешься на первую вкладку и ставишь галочку на Шифрование (алгоритм стандартный, в нем как раз отмечена команда -hp, сокрытие каталогов). Далее архиваруешь.
Скрипты Inno Setup. Помощь и советы [часть 8]




Так на вкладке шифрование ты галочки не ставила - Зашифровать каталог архива и Использовать пароль?

Мда, хотя толку все-равно нет, нужно переделывать под IsDone 0.6
Аватара пользователя
NewMix

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

Сообщение NewMix »

MogilShik2007

У меня в алгоритме шифрования стоит -hp



Выглядит это кажется так: aes256 -p? -hp?



Пишу по памяти, так что в алгоритме могу ошибиться, пусть меня поправят знающие люди.
Аватара пользователя
PleaseTryAgain

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

Сообщение PleaseTryAgain »

Цитата Okta_333:

У меня в алгоритме шифрования стоит -hp

Выглядит это кажется так: aes256 -p? -hp?

Пишу по памяти, так что в алгоритме могу ошибиться, пусть меня поправят знающие люди.
Скрипты Inno Setup. Помощь и советы [часть 8]




Да я уже по разному пробовал, ни в какую - исдон 0.5 бунтует)))

Рискнул просто заменил 0.5 на 0.6, ехе собирается, но при запуске кричит, что не может выгрузить исдон во временную папку)))
Аватара пользователя
бювет

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

Сообщение бювет »

Nordek, спасибо за ответ.

Я так понял, что всё что я "натягал" из реестра в сценарий скрипту и даром не нунжно?

Удалил всё, что шло ниже [Registry]. Сделал инсталлятор и установил с него игру. При попытке удаления выскакивает та же ошибка.
Аватара пользователя
OldGamer

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

Сообщение OldGamer »

Цитата deathid@vk:



не, никаких изменений.
Скрипты Inno Setup. Помощь и советы [часть 8]




Ну уж, батенька, ищи проблему у себя в системе. Либо внимательнее при задании параметров распаковки (может нужно, например, задать пароль - параметр

;Пароль для распаковки архивов

#define Password "").

Я этот скрипт перелопатил, много чего поменял - работает 100%! По крайней мере на win 7 x64.


Пруфф


Изображение







Цитата Okta_333:



А распаковка этим CLS пошустрее проходит?
Скрипты Inno Setup. Помощь и советы [часть 8]




Ну сама прикинь - или распаковка сначала арк, затем среп, прекомп, 7зип, или в один проход всё сразу.




Цитата MogilShik2007:



Может кто наскоряк переделать скрипт под IsDone 0.6
Скрипты Inno Setup. Помощь и советы [часть 8]




Наскоряк не выйдет, а так лень - и так 2 скрипта за последнее время переделал - а это всё время. Хочется уже и поиграть, ну и что, что уже почти 48 лет Изображение. Да и ещё что-нибудь для R.G. Catalyst сделать, как никак, пока, что я там состою.

Может воспользоваться уже готовыми скриптами с исдон'ом 6-ым?
Ответить

Вернуться в «Автоматическая установка приложений»