Имя пользователя:
Пароль:
 

Показать сообщение отдельно

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


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

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


доброго времени суток, у меня проблема, как сделать так как на картинке??? (картинку оформлял я http://i29.fastpic.ru/big/2012/0130/...3500a70a12.jpg )

смысл заключается в том что у пользователя перед компонентами вылетает выбор режима установки для Standart пользователя и для Premium пользователя
Для обоих вариантов вылетает список компонентов которые он не может выбрать (но может увидеть что они устанавливаются) и те которые может выбрать
Они идентичны только в разделе Premium устанавливается еще одна строчка

вот ниже код который я использовал для написания такого скрипта но не знаю как дальше писать
читать дальше »

[code]
[Setup]
AppName=Quake Live
AppVerName="Quake Live"
AppPublisher=Mio Dark Project
CreateAppDir=no
DefaultGroupName=Mio Dark Project\Quake Live
AllowNoIcons=yes
OutputDir=Output
OutputBaseFilename=Quake Live
SetupIconFile=setup.ico
Compression=lzma/ultra
SolidCompression=yes
ShowTasksTreeLines=yes
DisableProgramGroupPage=yes
WizardImageFile=Big.bmp
WizardSmallImageFile=Small.bmp
UninstallDisplayIcon={app}\Uninstall\uninstall.ico
UninstallFilesDir={app}\Uninstall
WizardImageStretch=no
AlwaysShowComponentsList=no

[Languages]
Name: ru; MessagesFile: compiler:Languages\Russian.isl;

[Types]
Name: "full"; Description: "Все компоненты";
Name: "custom"; Description: "Выбрать компоненты"; Flags: iscustom

[Components]
Name: "main"; Description: "Cтандартные файлы Quake Live"; Types: full custom; Flags: fixed
Name: "main2"; Description: "Премиум файлы Quake Live"; Types: full custom; Flags: fixed
Name: "plug"; Description: "Плагин Quake Live"; Types: full custom
Name: "browser"; Description: "Портативный Firefox под Quake Live"; Types: full custom
Name: "manual"; Description: "Руководство и Награды"; Types: full custom
Name: "anti"; Description: "Античит PunkBuster"; Types: full custom

[CustomMessages]
HeaderLabelPage=Выберите тип вашего аккаунта
MyRadioCaption_1=Standart
MyRadioCaption_2=Premium / Pro
PageTextHeader=На этой странице Вы можете выбрать тип вашего аккаунта, который вы используете в игре.
MyText_1=Будут установлены файлы которые доступны для игроков без подписки.
MyText_2=Будут установлены файлы которые доступны для игроков с Premium/Pro подпиской.


[Tasks]
Name: "desktopicon"; Description: "Создать ярлык на Рабочем Столе"; GroupDescription: "{cm:AdditionalIcons}"

[Files]
;source: "uninstall.ico"; Components: main; DestDir: "{code:DetectWindows}\uninstall"; Flags: ignoreversion
;Source: "usercur\*"; Components: main; DestDir: "{code:DetectWindows}"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension
;Source: "usercur2\*"; Components: manual; DestDir: "{code:DetectWindows}"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension
;Source: "programfiles\*"; Components: browser; DestDir: "{pf}\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension
Source: "pk31\*"; Components: main; DestDir: "{code:DetectWindows}"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension nocompression
;Source: "pbsvc.exe" ;Components: anti;DestDir: "{tmp}"; Flags: ignoreversion
;Source: "QuakeLiveNP_433.msi" ;Components: plug;DestDir: "{tmp}"; Flags: ignoreversion

Код: Выделить весь код
var
  MyNewPage: TWizardPage;
  Rect: TRect;
  HIcon: LongInt;
  AIconFileName: String;
  MyRadioBtn_1, MyRadioBtn_2: TNewRadioButton;

procedure GetInstTypePage();
begin
  MyNewPage := CreateCustomPage(wpWelcome,
    ExpandConstant('{cm:HeaderLabelPage}'), '');



  with TNewStaticText.Create(WizardForm) do
  begin
    Width := WizardForm.InnerNotebook.Width;
    Height := ScaleY(26);
    WordWrap := True;
    Caption := ExpandConstant('{cm:PageTextHeader}');
    Parent := MyNewPage.Surface;
  end;

  MyRadioBtn_1 := TNewRadioButton.Create(WizardForm);
  with MyRadioBtn_1 do
  begin
    Top := ScaleY(50);
    Width := ScaleX(150);
    Caption := ExpandConstant('{cm:MyRadioCaption_1}');
    Checked := True;
    Parent := MyNewPage.Surface;
  end;

  with TNewStaticText.Create(WizardForm) do
  begin
    Left := ScaleX(16);
    Top := ScaleY(68);
    Width := WizardForm.InnerNotebook.Width - ScaleX(60);
    Height := ScaleY(26);
    WordWrap := True;
    Caption := ExpandConstant('{cm:MyText_1}');
    Parent := MyNewPage.Surface;
  end;

  MyRadioBtn_2 := TNewRadioButton.Create(WizardForm);
  with MyRadioBtn_2 do
  begin
    Top := ScaleY(120);
    Width := ScaleX(150);
    Caption := ExpandConstant('{cm:MyRadioCaption_2}');
    Parent := MyNewPage.Surface;
  end;

  with TNewStaticText.Create(WizardForm) do
  begin
    Left := ScaleX(16);
    Top := ScaleY(138);
    Width := WizardForm.InnerNotebook.Width - ScaleX(60);
    Height := ScaleY(26);
    WordWrap := True;
    Caption := ExpandConstant('{cm:MyText_2}');
    Parent := MyNewPage.Surface;
  end;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID <= wpSelectDir) and (PageID = wpReady) and (MyRadioBtn_2.Checked) then
     Result := True;
end;

procedure InitializeWizard();
begin
  GetInstTypePage();
end;
function DetectWindows(s: string): string;
var
  SubKeyName, ResultStr: string;
begin
  SubKeyName:= 'Software\Microsoft\Windows NT\CurrentVersion';
  RegQueryStringValue(HKLM, SubKeyName, 'ProductName', ResultStr);
  if Pos('XP', ResultStr) > 0 then
    Result:= ExpandConstant('{%APPDATA}\id Software')
  else
  if Pos('Vista', ResultStr) > 0 then
    // не знаю, будет ли это C:\Users\Ваше_имя_пользователя\AppData\LocalLow\id Software
    // проверить не где
    Result:= ExpandConstant('{%APPDATA}\LocalLow\id Software')
  else Result:= '{%APPDATA}\LocalLow\id Software'; // сюда нужно вписать путь по дефолту, т.е. если не XP или Vista
end;

Отправлено: 13:13, 30-01-2012 | #705