Новый участник
Сообщения: 5
Благодарности: 0
|
Профиль
|
Отправить PM
| Цитировать
Помогите пожалуйста, не могу это осуществить, несколько форумов обрыл, но ответа не нашел  .
1. При переходе на страницу Выбора компонентов автоматически выбераются Классические модели в 2-х группах, как отключить автоматический выбор компонентов?
2. Как убрать ячейки и оставить только надпись?
3. Как убрать размер компонентов?
4. И как сделать кнопку Далее активной только при выборе 2-х компонентов (1 компонент оружия и 1 компонент игроков), а то у меня получается так, что выбераешь только компонент оружия или компонент игроков и кнопка Далее становится активной?
5. И еще как на странице "Приветствие установки программы" и "Завершение установки" упорядочить текст по центру.
Вот мой скрипт
читать дальше »
Код: 
[Setup]
[Setup]
SourceDir=.
OutputDir=Setup
AppName=Counter-Strike HD
AppVerName=Counter-Strike HD
AppVersion=1.6.0.0
VersionInfoVersion=4.5.5.4
AppPublisher=Created by C783RPnuk
AppCopyright=C783RPnuk
AppPublisherURL=http://forum.ipcom.lg.ua/
AppSupportURL=http://forum.ipcom.lg.ua/
AppUpdatesURL=http://forum.ipcom.lg.ua/
DefaultDirName=C:\Games\Counter-Strike HD
DefaultGroupName=Counter-Strike HD
InfoBeforeFile=C:\Users\C783RPunk\Desktop\Prog\about.txt
InfoAfterFile=C:\Users\C783RPunk\Desktop\Prog\README.txt
OutputBaseFilename=Counter-Strike HD
WizardImageFile=C:\Users\C783RPunk\Desktop\ICO\big.bmp
WizardSmallImageFile=C:\Users\C783RPunk\Desktop\ICO\small.bmp
SetupIconFile=C:\Users\C783RPunk\Desktop\ICO\install.ico
AllowNoIcons=yes
DisableProgramGroupPage=yes
AlwaysShowGroupOnReadyPage=yes
DisableReadyMemo=yes
DisableReadyPage=yes
WindowVisible=no
WindowShowCaption=no
WindowResizable=no
Compression=lzma/normal
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[CustomMessages]
russian.FreeSpace=Доступно места на диске:
russian.NeedSpace=Требуется места на диске:
russian.hour= часов
russian.min= мин
russian.sec= сек
[Types]
Name: "full"; Description: "Полная установка"; Flags: iscustom
[Components]
Name: g0; Description: "МОДЕЛИ ОРУЖИЯ"; Types: full; Flags: disablenouninstallwarning checkablealone fixed
Name: g0\c1; Description: HD; Types: full; Flags: exclusive
Name: g0\c2; Description: Next Generation; Types: full; Flags: exclusive
Name: g0\c3; Description: New Era; Types: full; Flags: exclusive
Name: g0\c4; Description: "Классические"; Types: full; Flags: exclusive
Name: g1; Description: "МОДЕЛИ ИГРОКОВ"; Types: full; Flags: disablenouninstallwarning checkablealone fixed
Name: g1\c1; Description: HD; Types: full; Flags: exclusive
Name: g1\c2; Description: Source; Types: full; Flags: exclusive
Name: g1\c3; Description: Steam; Types: full; Flags: exclusive
Name: g1\c4; Description: "Классические"; Types: full; Flags: exclusive
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
[Files]
Source: C:\Users\C783RPunk\Desktop\ICO\papka.bmp; DestDir: {tmp}; Flags: dontcopy
Source: ISSkin.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
Source: steam.cjstyles; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
Source: compiler:innocallback.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "C:\Users\C783RPunk\Desktop\Prog\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension external
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Weapons\HD\*"; DestDir: "{app}\cstrike\models\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g0\c1
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Weapons\Next Generation\*"; DestDir: "{app}\cstrike\models\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g0\c2
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Sound\Weapons\Next Generation\*"; DestDir: "{app}\cstrike\sound\weapons\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g0\c2
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Weapons\New Era\*"; DestDir: "{app}\cstrike\models\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g0\c3
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Weapons\Classic\*"; DestDir: "{app}\cstrike\models\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g0\c4
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Players\HD\*"; DestDir: "{app}\cstrike\models\player\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g1\c1
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Players\Source\*"; DestDir: "{app}\cstrike\models\player\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g1\c2
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Players\Steam\*"; DestDir: "{app}\cstrike\models\player\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g1\c3
Source: "C:\Users\C783RPunk\Desktop\Prog\BONUS\Players\Classic\*"; DestDir: "{app}\cstrike\models\player\"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: g1\c4
[Icons]
Name: "{group}\{cm:LaunchProgram,Counter-Strike HD}"; Filename: "{app}\CSHD.exe"; WorkingDir: "{app}";
Name: "{userdesktop}\Counter-Strike HD"; Filename: "{app}\CSHD.exe"; WorkingDir: "{app}"; Tasks: desktopicon;
Name: "{group}\{cm:UninstallProgram,Counter-Strike HD}"; Filename: "{uninstallexe}"
[UninstallDelete]
Type: filesandordirs; Name: "{app}"
(Code)
const
dURL=2;
MF_DELETE = $200;
var
URLLabel,URLLabelShadow:TLabel;
function GetSystemMetrics(nIndex: Integer): Integer; external 'GetSystemMetrics@user32.dll stdcall';
procedure LoadSkin(lpszPath: String; lpszIniFileName: String ); external 'LoadSkin@files:isskin.dll stdcall delayload setuponly';
procedure LoadSkinA(lpszPath: String; lpszIniFileName: String ); external 'LoadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall';
function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';
function AppendMenu(hMenu: HMENU; uFlags, uIDNewItem: UINT; lpNewItem: PChar): BOOL; external 'AppendMenuA@user32.dll stdcall';
function GetSystemMenu(hWnd: HWND; bRevert: BOOL): HMENU; external 'GetSystemMenu@user32.dll stdcall';
procedure URLLabelClick(Sender: TObject);
var
ErrorCode:integer;
begin
ShellExec('open','Created by C783RPnuk','','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
end;
procedure URLLabelMouseDown(Sender:TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
begin
URLLabel.Top:=URLLabel.Top+dURL;
URLLabel.Left:=URLLabel.Left+dURL;
URLLabel.Font.Style:=URLLabel.Font.Style-[fsUnderline];
URLLabel.Font.Color:=$50B5C4;
URLLabelShadow.Visible:=False;
end;
procedure URLLabelMouseUp(Sender:TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
begin
URLLabel.Top:=URLLabel.Top-dURL;
URLLabel.Left:=URLLabel.Left-dURL;
URLLabel.Font.Style:=URLLabel.Font.Style-[fsUnderline];
URLLabel.Font.Color:=$708A7A;
URLLabelShadow.Visible:=True;
end;
var
RestoreDir: TButton;
procedure ButtonOnClick(Sender: TObject);
begin
WizardForm.DirEdit.Text:= ExpandConstant('C:\Games\Counter-Strike HD');
end;
type
TTimerProc = procedure(HandleW, Msg, idEvent, TimeSys: LongWord);
var
StartInstall: Integer;
TimeLabel: TLabel;
TimerID: Longword;
function GetTickCount: DWord; external 'GetTickCount@kernel32';
function WrapTimerProc(callback: TTimerProc; Paramcount: Integer): longword; external 'wrapcallback@files:innocallback.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): longword; external 'SetTimer@user32';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32 stdcall delayload';
Function cm(Message: String): String; Begin Result:= ExpandConstant('{cm:'+ Message +'}') End;
Function TicksToTime(Ticks: DWord; h,m,s: String; detail: Boolean): String;
Begin
if detail then {hh: mm:ss format}
Result:= PADZ(IntToStr(Ticks/3600000), 2) +':'+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +':'+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2)
else if Ticks/3600 >= 1000 then {more than hour}
Result:= IntToStr(Ticks/3600000) +h+' '+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +m
else if Ticks/60 >= 1000 then {1..60 minutes}
Result:= IntToStr(Ticks/60000) +m+' '+ IntToStr(Ticks/1000 - Ticks/1000/60*60) +s
else Result:= Format('%.1n', [Abs(Ticks/1000)]) +s {less than one minute}
End;
procedure GetTime(HandleW, Msg, idEvent, TimeSys: LongWord);
var Remaining: Integer;
begin
with WizardForm.ProgressGauge do begin
if position > 0 then Remaining:= trunc((GetTickCount - StartInstall) * Abs((max - position)/position))
TimeLabel.Caption:= 'Подождите... ' + TicksToTime(Remaining, cm('hour'), cm('min'), cm('sec'), false)
if (Remaining = 0) then TimeLabel.Caption:= 'Подождите... '
end;
end;
var
NeedSpaceLabel,FreeSpaceLabel: TLabel;
FreeMB, TotalMB: Cardinal;
SizeStr: String;
SizeInt: Integer;
SymbolNumber: Integer;
Function NumToStr(Float: Extended): String ;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
function GetSize(): Integer;
begin
SizeStr:= WizardForm.DiskSpaceLabel.Caption;
for SymbolNumber:= 97 to 122 do begin
while (Pos(Chr(SymbolNumber), SizeStr) > 0) do Delete(SizeStr, Pos(Chr(SymbolNumber), SizeStr),1);
while (Pos( AnsiUppercase(Chr(SymbolNumber)), SizeStr) > 0) do Delete(SizeStr, Pos( AnsiUppercase(Chr(SymbolNumber)), SizeStr),1); end ;
for SymbolNumber:= 192 to 255 do begin
while (Pos(Chr(SymbolNumber), SizeStr) > 0) do Delete(SizeStr, Pos(Chr(SymbolNumber), SizeStr),1); end;
while (Pos('.', SizeStr) > 0) do Delete(SizeStr, Pos('.', SizeStr), 1)
Delete(SizeStr, Pos(',', SizeStr), 5)
Result:= StrToInt(Trim(SizeStr));
end;
function CompareNum(FirstNum, SecondNum: Integer): Boolean;
begin
if FirstNum < SecondNum then Result:= False else Result:= True;
end;
Function MbOrTb( Byte: Extended): String ;
begin
if Byte < 1024 then Result:= NumToStr(Byte) + ' Мб else
if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' Гб else
Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' Тб
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
FreeSpaceLabel.Caption:= ExpandConstant('{cm:FreeSpace} ') + MbOrTb(FreeMB)
NeedSpaceLabel.Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTb(SizeInt)
if WizardForm.CurPageID = wpSelectDir then begin
WizardForm.NextButton.Enabled:= CompareNum(FreeMB, SizeInt)
end;
end;
procedure ComponentOnClick(Sender: TObject);
begin
if WizardSelectedComponents(False) = '' then
WizardForm.NextButton.Enabled:= False
else WizardForm.NextButton.Enabled:= True;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
If CurStep = ssInstall then
begin
StartInstall:= GetTickCount
TimerID:= SetTimer(0,0, 500, WrapTimerProc(@GetTime, 4))
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpSelectDir then begin
GetFreeSpaceCaption(nil)
end;
end;
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('steam.cjstyles');
LoadSkin(ExpandConstant('{tmp}\steam.cjstyles'), '');
Result:= true
end;
function InitializeUninstall(): Boolean;
begin
FileCopy(ExpandConstant('{app}\isskin.dll'), ExpandConstant('{tmp}\isskin.dll'), False);
FileCopy(ExpandConstant('{app}\steam.cjstyles'), ExpandConstant('{tmp}\steam.cjstyles'), False);
LoadSkinA(ExpandConstant('{tmp}\steam.cjstyles'), '');
Result:=True;
end;
procedure InitializeWizard();
begin
URLLabelShadow:=TLabel.Create(WizardForm);
with URLLabelShadow do begin
Top:=ScaleY(331);
Left:=ScaleX(25);
Caption:='Created by C783RPnuk';
AutoSize:=True;
Parent:=WizardForm;
Transparent:=True;
Font.Color:=$041207;
Font.Size:=9;
Font.Style:=Font.Style+[fsBold];
end;
URLLabel:=TLabel.Create(WizardForm);
with URLLabel do begin
Top:=ScaleY(331)-dURL;
Left:=ScaleX(25)-dURL;
Caption:='Created by C783RPnuk';
AutoSize:=True;
Parent:=WizardForm;
Cursor:=crHand;
Transparent:=True;
Font.Color:=$708A7A;
Font.Size:=9;
Font.Style:=Font.Style+[fsBold];
BringToFront;
OnClick:=@URLLabelClick;
OnMouseDown:=@URLLabelMouseDown;
OnMouseUp:=@URLLabelMouseUp;
end;
begin
RestoreDir:= TButton.Create(WizardForm);
RestoreDir.Width := WizardForm.DirBrowseButton.Width;
RestoreDir.Height := WizardForm.DirBrowseButton.Height;
RestoreDir.Top := WizardForm.DirBrowseButton.Top + RestoreDir.Height + ScaleX(10);
RestoreDir.Left := WizardForm.DirBrowseButton.Left;
RestoreDir.OnClick := @ButtonOnClick;
RestoreDir.Parent := WizardForm.SelectDirPage;
RestoreDir.Visible:= True;
RestoreDir.Caption := 'Сбросить';
end;
begin
TimeLabel:= TLabel.Create(WizardForm)
TimeLabel.SetBounds(ScaleX(0), ScaleY(80), ScaleX(457), ScaleY(20));
TimeLabel.AutoSize:= False
TimeLabel.Transparent:= True;
TimeLabel.Parent:= WizardForm.InstallingPage;
end;
begin
AppendMenu(GetSystemMenu(Wizardform.Handle, True), MF_DELETE, 0, SetupMessage(msgAboutSetupMenuItem));
end;
begin
WizardForm.DiskSpaceLabel.Hide;
#ifdef NeedSize
SizeInt:= {#NeedSize}
#else
SizeInt:= GetSize;
#endif
NeedSpaceLabel := TLabel.Create(WizardForm);
NeedSpaceLabel.SetBounds(ScaleX(0), ScaleY(198), ScaleX(209), ScaleY(13))
NeedSpaceLabel.Parent := WizardForm.SelectDirPage;
NeedSpaceLabel.Transparent:=true;
FreeSpaceLabel := TLabel.Create(WizardForm);
FreeSpaceLabel.SetBounds(ScaleX(0), ScaleY(216), ScaleX(209), ScaleY(13))
FreeSpaceLabel.Parent := WizardForm.SelectDirPage;
FreeSpaceLabel.Transparent:=true;
WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
end;
begin
ExtractTemporaryFile('papka.bmp');
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectDirBitmapImage.AutoSize:=true;
WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectGroupBitmapImage.AutoSize:=true;
end;
begin
WizardForm.BorderStyle := bsDialog;
end;
begin
WizardForm.FileNameLabel.Visible:= False;
end;
begin
WizardForm.ComponentsList.OnClick := @ComponentOnClick;
end;
WizardForm.TypesCombo.ItemIndex:=0;
WizardForm.BeveledLabel.Enabled:=True;
WizardForm.BeveledLabel.visible:=False;
WizardForm.Bevel.visible:=False;
WizardForm.Bevel1.visible:=False;
end;
procedure DeinitializeSetup;
begin
ShowWindow(WizardForm.Handle,0);
KillTimer(0, TimerID);
UnloadSkin();
end;
Сделайте кто-нибудь пожалуйста или дайте скрипт на кажый вопрос я сам вставлю в свой скрипт. Это мой первый и последний инсталлятор, я больше ничего не попрошу.
|