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

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

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


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

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


El Sanchez:
Полный скрипт
Код: Выделить весь код
[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: "Главные файлы Quake Live"; Types: full custom; Flags: fixed
Name: "main2"; Description: "Главные файлы Quake Live Premium"; Types: full custom; Flags: fixed
Name: "browser2"; Description: "Портативный Firefox под Quake Live Premium"; Types: full custom
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: "pk3standart\*"; Components: main; DestDir: "{code:DetectWindows}"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension nocompression
Source: "pk3Premium\*"; 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

[cоde]
function GetModuleHandle(lpModuleName: LongInt): LongInt;
 external 'GetModuleHandleA@kernel32.dll stdcall';
function ExtractIcon(hInst: LongInt; lpszExeFileName: AnsiString; nIconIndex: LongInt): LongInt;
 external 'ExtractIconA@shell32.dll stdcall';
function DrawIconEx(hdc: LongInt; xLeft, yTop: Integer; hIcon: LongInt; cxWidth,
       cyWidth: Integer; istepIfAniCur: LongInt; hbrFlickerFreeDraw, diFlags: LongInt): LongInt;
 external 'DrawIconEx@user32.dll stdcall';
function DestroyIcon(hIcon: LongInt): LongInt;
 external 'DestroyIcon@user32.dll stdcall';

const
   DI_NORMAL = 3;

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_1.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;


в Стандарт должны входить такие компоненты:
Код: Выделить весь код
Name: "main"; 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
а в Премиум
Код: Выделить весь код
Name: "main2"; Description: "Главные файлы Quake Live Premium"; Types: full custom; Flags: fixed
Name: "plug"; Description: "Плагин Quake Live"; Types: full custom
Name: "browser2"; Description: "Портативный Firefox под Quake Live Premium"; Types: full custom
Name: "manual"; Description: "Руководство и Награды"; Types: full custom
Name: "anti"; Description: "Античит PunkBuster"; Types: full custom
(так как у меня в премиуме устанавливаться должны и стандартные файлы то рk3standart папка должна быть и там и там (т.е. и в Стандарт и в Премиум должна быть строчка Главные файлы Quake Live с флагом fixed но в стандарте в ней pk3standart, а в премиуме pk3standart и pk3premium)

Последний раз редактировалось lmiol, 18-05-2011 в 22:40.


Отправлено: 22:29, 18-05-2011 | #1644