Показать полную графическую версию : [архив] Скрипты Inno Setup. Помощь и советы [часть 2]
всё не получается »
Ну извините, за вас никто писать не будет...
Делается (внешний вид) так:
1. Изменяете размер окна инсталлятора WizardForm.ClientHeight и WizardForm.ClientWidth;
2. Создаёте панель, задаёте ей свойство Align:= alClient;
3. Создаёте на панели картинку (TBitmapImage), с такимм же свойством TBitmapImage.Align:= alClient, затем загружаете из файла картинку;
4. Делаете кнопки видимыми WizardForm.кнопка.Parent:= панель;
Ну и т.д. и т.п.
Serega, всё путём ))) Ещё раз спасибо!
STRELOK, всё-таки классный у Black'a скриптец )))
Serega, вопрос к Вам как к человеку знающему! Как реализовать "Список жестких дисков и свободного места" через get_hw_caps.dll . Самую новую версию get_hw_caps.dll 1.0.0.3 прикрепляю.
P.S. Кстати, заметил в инсталле Зова Припяти файлик get_hw_caps.exe. Не знаете для чего он?
Как реализовать "Список жестких дисков и свободного места" через get_hw_caps.dll »
Вот простой пример использования функций:
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[Files]
Source: compiler:Libraries\get_hw_caps.dll; Flags: dontcopy
[Code]
function GetHardDriveFreeSpace(hdd: integer): Integer;
external 'hwc_GetHardDriveFreeSpace@files:get_hw_caps.dll stdcall';
function GetHardDriveName(hdd: integer): PChar;
external 'hwc_GetHardDriveName@files:get_hw_caps.dll stdcall';
function GetHardDriveTotalSpace(hdd: integer): Integer;
external 'hwc_GetHardDriveTotalSpace@files:get_hw_caps.dll stdcall';
function GetHardDrivesCount(): Integer; external 'hwc_GetHardDrivesCount@files:get_hw_caps.dll stdcall';
function InitializeSetup(): Boolean;
var
i, count: Integer;
msg: string;
begin
count:= GetHardDrivesCount();
msg:= 'Количество дисков: ' + IntToStr(count) + #13;
for i:= 0 to count - 1 do
msg:= msg + 'Размер: ' + GetHardDriveName(i) + ' - ' +
IntToStr(GetHardDriveTotalSpace(i)) + ' Мб' +
', своб.: ' + IntToStr(GetHardDriveFreeSpace(i)) + ' Мб' +#13;
MsgBox(msg, mbInformation, MB_OK);
end;
Не знаете для чего он? »
Нет.
Serega, спасибо! И еще 2 небольших вопросика:
1. Выводить инфу в Гб, до трех заков после зяпятой (если можно с предидущим примером)
2. Как сделать проверку версии пиксельных шейдеров у видеокарты
Вот второе действительно очечь интересует, в инно еще не встречал
Заранее благодарю за помощь!
МИШАНЧИК
26-11-2009, 08:38
A1EXXX, подскажите пожалуйста по поводу:
всё-таки классный у Black'a скриптец »
А что за скрипт, можно глянуть?
МИШАНЧИК, он на скрине реализован )) Исходники у автора :)
Raf-9600
26-11-2009, 15:11
Ктонить может объединить эти скрипты? http://forum.oszone.net/post-1279125.html#post1279125
Через ISS Joiner пробовал, но он создает некорректный скрипт.
Всем привет, у кого есть Inno Setup Form Designer 2.0.8 ?
Raf-9600, соединил, только "Запрет установки в папку Windows" здесь отсутствует (там ошибка в самом коде есть; MessageBox изменил на MsgBox и появилась другая ошибка :() [Code]
const
n=21; //количество слайдов
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);
TRandNumbers = array[1..N] of byte;
function WrapTimerProc(callback:TProc; paramcount:integer):longword;
external 'wrapcallback@files:InnoCallback.dll stdcall';
function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord;
external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord;
external 'KillTimer@user32.dll stdcall';
function get_unique_random_number(X:byte):TRandNumbers;
var
A,b,c: string;
i,j,k:byte;
begin
For i:=1 to X do A:=A+chr(i);
B:='';
For i:=1 to X do begin
j:=Random(Length(A)-1)+1;
C:='';
B:=B + A[j];
for k:=1 to Length(A) do
if k<>j then C:=C+A[k];
A:=C;
end;
for i:=1 to X do Result[i]:=ord(B[i]);
end;
var
TimerID: LongWord;
currTime: Integer;
SplashImage: TBitmapImage;
bmp: TRandNumbers;
z:byte;
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
currTime := currTime + 1;
if (currTime mod {#20} = 0) // здесь, вместо TIME_FOR_VIEW ввести время показа слайда (в секундах)
then begin
SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_'+inttostr(bmp[currTime/{#20}])+'.bmp')); // здесь тоже
if (currTime/{#20} = N) then currTime:=0 ; // и здесь :)
end;
end;
procedure InitializeWizard1;
begin
bmp:=get_unique_random_number(N);
ExtractTemporaryFile('Image_'+inttostr(bmp[1])+'.bmp');
currTime := 0;
WizardForm.ProgressGauge.Parent := WizardForm;
WizardForm.ProgressGauge.Top := WizardForm.CancelButton.Top + ScaleY(12);
WizardForm.ProgressGauge.Left := ScaleX(10);
WizardForm.ProgressGauge.Width := WizardForm.MainPanel.Width - ScaleX(20);
WizardForm.ProgressGauge.Height := 16;
WizardForm.ProgressGauge.Hide;
WizardForm.StatusLabel.Parent := WizardForm;
WizardForm.StatusLabel.Top := WizardForm.ProgressGauge.Top - ScaleY(18);
WizardForm.StatusLabel.Left := ScaleX(10);
WizardForm.StatusLabel.Width := ScaleX(397);
WizardForm.StatusLabel.Hide;
SplashImage := TBitmapImage.Create(WizardForm);
SplashImage.Top := 0;
SplashImage.Left := 0;
SplashImage.Width := WizardForm.MainPanel.Width;
SplashImage.Height := WizardForm.Bevel.Top;
SplashImage.Parent := WizardForm.InnerPage;
SplashImage.Stretch := True;
SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_'+inttostr(bmp[1])+'.bmp'));
SplashImage.Hide;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
WizardForm.StatusLabel.Caption := 'Распаковка слайдов ...';
for z:=2 to N do ExtractTemporaryFile('Image_'+inttostr(bmp[z])+'.bmp');
end;
end;
procedure CurPageChanged1(CurPageID: Integer);
var
pfunc: LongWord;
begin
if (CurPageID = wpInstalling) then
begin
pfunc := WrapTimerProc(@OnTimer, 5);
TimerID := SetTimer(0, 0, 1000, pfunc);
WizardForm.PageNameLabel.Visible := False;
WizardForm.PageDescriptionLabel.Visible := False;
WizardForm.InnerNotebook.Hide;
WizardForm.Bevel1.Hide;
WizardForm.MainPanel.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.ProgressGauge.Show;
WizardForm.StatusLabel.Show;
SplashImage.Show;
WizardForm.CancelButton.Enabled := True;
WizardForm.CancelButton.Top := WizardForm.Bevel.Top + ScaleY(100);
end else
begin
WizardForm.ProgressGauge.Hide;
SplashImage.Hide;
WizardForm.FileNameLabel.Hide;
WizardForm.StatusLabel.Hide;
if (CurPageID > wpInstalling) and (CurPageID < wpFinished) then
begin
WizardForm.InnerNotebook.Show;
WizardForm.Bevel1.Show;
WizardForm.MainPanel.Show;
WizardForm.PageNameLabel.Show;
WizardForm.PageDescriptionLabel.Show;
end;
If CurPageID = wpFinished then
end;
end;
procedure DeInitializeSetup1();
begin
KillTimer(0, TimerID);
end;
function ShouldSkipPage(CurPage: Integer): Boolean;
begin
if Pos('/SP-', UpperCase(GetCmdTail)) > 0 then
case CurPage of
wpLicense, wpPassword, wpInfoBefore, wpUserInfo,
wpSelectDir, wpSelectProgramGroup, wpInfoAfter:
Result := True;
end;
end;
const
WM_LBUTTONDOWN = 513;
WM_LBUTTONUP = 514;
procedure InitializeWizard2();
begin
if (Pos('/SP-', UpperCase(GetCmdTail)) > 0) then
begin
PostMessage(WizardForm.NextButton.Handle,WM_LBUTTONDOWN,0,0);
PostMessage(WizardForm.NextButton.Handle,WM_LBUTTONUP,0,0);
end;
end;
procedure CurPageChanged2(CurPageID: Integer);
begin
if (Pos('/SP-', UpperCase(GetCmdTail)) > 0) and
(CurPageID = wpSelectComponents) then
WizardForm.BackButton.Visible := False;
end;
//I?iaa?ea ia inoaaouany oaeeu
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
Res: Integer;
begin
case CurUninstallStep of
usPostUninstall:
begin
if DirExists(ExpandConstant('{app}')) then
if ExpandConstant('{language}') = 'ua' then
case MsgBox('Iaiea "' + ExpandConstant('{app}') + '" ia ii?i?iy.'#13#13 +
'"Oae" – iiaia aeaaeaiiy an?o oaee?a o iaio?, aee??a??e naio iaieo.' #13#13 +
'"I?" – a?ae?eoe iaieo a i?ia?aieeo, uia a?o?io aeaaeeoe oaeee.'#13#13 +
'"Neanoaaoe" – i??iai ia ?iaeoe, aeaaeeoe iaieo i?ci?oa naiino?eii.', mbInformation, MB_YESNOCANCEL) of
IDYES:
if not DelTree(ExpandConstant('{app}'), True, True, True) then
MsgBox('Iaiea ia aeaaeaia.' #13#13 'Iaiea aai iaei c oaee?a o i?e caa?yi? ?ioi? i?ia?aii?.', mbError, MB_OK);
IDNO:
if not ShellExec('open', ExpandConstant('{app}'), '', '', SW_SHOWMAXIMIZED, ewNoWait, Res) then
MsgBox('Iiieeea a?ae?eooy.' #13#13 'Iaiea ia ciaeaaia.', mbError, MB_OK);
IDCANCEL:;
end
else
if ExpandConstant('{language}') = 'ru' then
case MsgBox('Iaiea "' + ExpandConstant('{app}') + '" ia ionoa.'#13#13 +
'"Aa" – iieiia oaaeaiea anao oaeeia a iaiea, aee??ay naio iaieo.' #13#13 +
'"Iao" – ioe?uou iaieo a i?iaiaieea, ?oiau a?o?io? oaaeeou oaeeu.'#13#13 +
'"Ioiaia" – ie?aai ia aaeaou, oaaeeou iaieo iic?a naiinoiyoaeuii.', mbInformation, MB_YESNOCANCEL) of
IDYES:
if not DelTree(ExpandConstant('{app}'), True, True, True) then
MsgBox('Iaiea ia oaaeaia.' #13#13 'Iaiea eee iaei ec oaeeia a iae caaaenoaiaaiu a?oaei i?eei?aieai.', mbError, MB_OK);
IDNO:
if not ShellExec('open', ExpandConstant('{app}'), '', '', SW_SHOWMAXIMIZED, ewNoWait, Res) then
MsgBox('Ioeaea ioe?uoey.' #13#13 'Iaiea ia iaeaaia.', mbError, MB_OK);
IDCANCEL:;
end
else
case MsgBox('Directory "' + ExpandConstant('{app}') + '" is not empty.'#13#13 +
'"Yes" to delete all of the files in the directory, including the directory itself.' #13#13 +
'"No" to open the directory with explorer to delete the files manually.'#13#13 +
'"Cancel" to do nothing and delete the directory later manually.', mbInformation, MB_YESNOCANCEL) of
IDYES:
if not DelTree(ExpandConstant('{app}'), True, True, True) then
MsgBox('Directory is not deleted.' #13#13 'Directory or one of the files are used by the other application.', mbError, MB_OK);
IDNO:
if not ShellExec('open', ExpandConstant('{app}'), '', '', SW_SHOWMAXIMIZED, ewNoWait, Res) then
MsgBox('Error opening the directory.' #13#13 'Directory is not found.', mbError, MB_OK);
IDCANCEL:;
end
end
end
end;
procedure InitializeWizard3();
begin
with WizardForm do begin
with MainPanel do
Height := Height - 1;
with WizardSmallBitmapImage do begin
Left := 0;
Top := 0;
Height := 58; //Размер рисунка
Width := 497; //
end;
with PageNameLabel do begin
Width := Width - 497; //Поставьте здесь значения на 0, если хотите вернуть текст
Left := Left + 497; //
end;
with PageDescriptionLabel do begin
Width := Width - 497; //Поставьте здесь значения на 0, если хотите вернуть текст
Left := Left + 497; //
end;
end;
end;
function enabledesc(ComponentsListHandle: HWND; DescLabelHandle: HWND; DescStrings: PChar): BOOL; external 'enabledesc@files:descctrl.dll stdcall';
function disabledesc(): BOOL; external 'disabledesc@files:descctrl.dll stdcall';
var
Info: TNewStaticText;
InfoCaption: TNewStaticText;
InfoPanel: TPanel;
procedure DeinitializeSetup2();
begin
disabledesc();
end;
procedure InitializeWizard4();
begin
WizardForm.TYPESCOMBO.Visible:= false;
WizardForm.ComponentsList.Height := WizardForm.ComponentsList.Height + WizardForm.ComponentsList.Top - WizardForm.TYPESCOMBO.Top;
WizardForm.ComponentsList.Top := WizardForm.TYPESCOMBO.Top;
WizardForm.ComponentsList.Width := ScaleX(200);
InfoPanel := TPanel.Create(WizardForm);
InfoPanel.Parent := WizardForm.SelectComponentsPage;
InfoPanel.Caption := '';
InfoPanel.Top := WizardForm.ComponentsList.Top;
InfoPanel.Left := ScaleX(216);
InfoPanel.Width := ScaleX(200);
InfoPanel.Height := WizardForm.ComponentsList.Height;
InfoPanel.BevelInner := bvRaised;
InfoPanel.BevelOuter := bvLowered;
InfoCaption := TNewStaticText.Create(WizardForm);
InfoCaption.Parent := WizardForm.SelectComponentsPage;
InfoCaption.Caption := 'ГиКц';
InfoCaption.Left := ScaleX(224);
InfoCaption.Top := InfoPanel.Top - ScaleY(5);
InfoCaption.Font.Color := clActiveCaption;
Info := TNewStaticText.Create(WizardForm);
Info.Parent := InfoPanel;
Info.AutoSize := False;
Info.Left := ScaleX(6);
Info.Width := ScaleX(188);
Info.Top := ScaleY(12);
Info.Height := WizardForm.ComponentsList.Height - ScaleY(18);
Info.Caption := 'Переместите ваш указатель мыши на компоненты чтобы увидеть их описание.';
Info.WordWrap := true;
enabledesc(WizardForm.ComponentsList.Handle,Info.Handle,
'Английская озвучка;'+ // SoundUnit\eng
'Французская озвучка;'+ // SoundUnit\fra
'Немецкая озвучка;'+ // SoundUnit\deu
'Итальянская озвучка;'+ // SoundUnit\ita
'Испанская озвучка;' // SoundUnit\spa
);
end;
var
NeedSize:Integer;
FreeMB, TotalMB: Cardinal;
NeedSpaceLabel: TLabel;
n1: Integer;
VolumeName, FileSystemName: String;
VolumeSerialNo, MaxComponentLength, FileSystemFlags: Longint;
ListBox: TListBox;
StartMenuTreeView: TStartMenuFolderTreeView;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled := False else
WizardForm.NextButton.Enabled := True; end;
procedure GetNeedSpaceCaption;
begin
if NeedSize > 1024 then
NeedSpaceLabel.Caption := 'Требуется как минимум '+ FloatToStr(round(NeedSize/1024*100)/100) + ' Гб свободного дискового пространства.' else
NeedSpaceLabel.Caption := 'Требуется как минимум '+ IntToStr(NeedSize)+ ' Мб свободного дискового пространства.';end;
const oneMB= 1024*1024;
function GetLogicalDrives: DWord; external 'GetLogicalDrives@kernel32.dll stdcall';
function GetDriveType(nDrive: String): Longint; external 'GetDriveTypeA@kernel32.dll stdcall';
function GetVolumeInformation(PathName,VolumeName: PChar; VolumeNameSize,VolumeSerialNumber,MaxComponentLength,FileSystemFlags: Longint; FileSystemName: PChar; FileSystemNameSize: Longint): Longint; external 'GetVolumeInformationA@kernel32.dll stdcall';
function MessageBox(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal): Integer; external 'MessageBoxA@user32.dll stdcall';
Function ByteOrTB(Bytes: Extended; noMB: Boolean): String; { Перевод числа в значение бт/Кб/Мб/Гб/Тб (до 3х знаков после запятой)}
Begin
if not noMB then Result:= FloatToStr(Int(Bytes)) +' Мб' else
if Bytes < 1024 then Result:= FloatToStr(Int(Bytes)) +' Бт' else
if Bytes/1024 < 1024 then Result:= FloatToStr(round((Bytes/1024)*10)/10) +' Кб' else
If Bytes/oneMB < 1024 then Result:= FloatToStr(round(Bytes/oneMB*100)/100) +' Мб' else
If Bytes/oneMB/1000 < 1024 then Result:= FloatToStr(round(Bytes/oneMB/1024*1000)/1000) +' Гб' else
Result:= FloatToStr(round(Bytes/oneMB/oneMB*1000)/1000) +' Тб'
StringChange(Result, ',', '.')
End;
Function DelSP(String: String): String; { Удаление начальных, конечных и повторных пробелов }
Begin while (Pos(' ', String) > 0) do Delete(String, Pos(' ', String), 1); Result:= Trim(String); End;
Function CutString(String: String; MaxLength: Longint): String; { Обрезать строку до заданного кол-ва символов}
Begin
if Length(String) > MaxLength then Result:= Copy(String, 1, 6) +'...'+ Copy(String, Length(String) - MaxLength +9, MaxLength)
else Result:= String;
End;
Procedure GetDiskInfo(Disk: String);
Begin
FileSystemName:= StringOfChar(' ', 32); VolumeName:= StringOfChar(' ', 256);
GetVolumeInformation(Disk, VolumeName, 255, VolumeSerialNo, MaxComponentLength, FileSystemFlags, FileSystemName, 31);
FileSystemName:= DelSp(FileSystemName); VolumeName:= DelSp(VolumeName); if VolumeName='' then VolumeName:='без метки';
End;
Procedure ListBoxRefresh; var FreeB, TotalB: Cardinal; Path, String: string; Begin
ListBox.Items.Clear
for n1:= 1 to 31 do // диск 'А' пропустить
if (GetLogicalDrives and (1 shl n)) > 0 then
if (GetDriveType(Chr(ord('A') + n) +':\') = 2) or (GetDriveType(Chr(ord('A') + n) +':\') = 3) then
if GetSpaceOnDisk(Chr(ord('A') + n) +':\', True, FreeMB, TotalMB) then ListBox.Items.Add(Chr(ord('A') + n) +':');
for n1:= 0 to ListBox.Items.Count -1 do begin
Path:= Copy(ListBox.Items[n],1,2) +'\' { если в накопителе нет диска, пропустить обновление }
if GetSpaceOnDisk(Path, False, FreeB, TotalB) and GetSpaceOnDisk(Path, True, FreeMB, TotalMB) then begin GetDiskInfo(Path);
if FreeB >= $7FFFFFFF then String:= PadL(ByteOrTB(FreeMB*oneMB, true),10) else String:= PadL(ByteOrTB(FreeB, true),10);
if TotalB >= $7FFFFFFF then begin TotalB:= TotalMB; FreeB:= FreeMB; String:= PadL(ByteOrTB(TotalMB*oneMB, true),11) +' всего -'+ String end else String:= PadL(ByteOrTB(TotalB, true),11) +' всего| '+ String;
ListBox.Items[n]:= Copy(Path,1,2) + String + PadL(FloatToStr(round(FreeB/TotalB*100)),3)+ '% своб|'+ PadL(FileSystemName,5)+ '| '+ CutString(VolumeName,9); end; end;
End;
Procedure ObjectOnClick(Sender: TObject); Begin
Case TObject(Sender) of
ListBox: for n1:= 0 to ListBox.Items.Count-1 do if ListBox.Selected[n] then WizardForm.DirEdit.Text:= Copy(ListBox.Items[n],1,1) +Copy(WizardForm.DirEdit.Text, 2, Length(WizardForm.DirEdit.Text))
StartMenuTreeView: if StartMenuTreeView.Directory <> '' then WizardForm.GroupEdit.Text:= StartMenuTreeView.Directory else WizardForm.GroupEdit.Text:= '{#SetupSetting("DefaultGroupName")}'
WizardForm.NoIconsCheck: begin WizardForm.GroupEdit.Enabled:= not(WizardForm.GroupEdit.Enabled); StartMenuTreeView.Enabled:= WizardForm.GroupEdit.Enabled; WizardForm.GroupBrowseButton.Enabled:= WizardForm.GroupEdit.Enabled end;
end; End;
procedure InitializeWizard5();
begin
NeedSize := 6100; //Здесь указывается место для приложения
WizardForm.DiskSpaceLabel.Hide;
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(220);
Width := ScaleX(209);
Height := ScaleY(13);
end;
ListBox:= TListBox.Create(WizardForm)
ListBox.SetBounds(WizardForm.DirEdit.Left, WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + 8, WizardForm.DirBrowseButton.Left + WizardForm.DirBrowseButton.Width - WizardForm.DirEdit.Left, WizardForm.DiskSpaceLabel.Top - (WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + 12))
ListBox.Font.Size:= 9
ListBox.Font.Style:= []
ListBox.Font.Name:= 'Courier New';
ListBox.OnClick:= @ObjectOnClick;
ListBox.Parent:= WizardForm.SelectDirPage;
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
end;
procedure CurPageChanged3(CurPageID: Integer);
begin
if CurPageID=wpSelectDir then
begin
GetNeedSpaceCaption;
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled:=False
ListBoxRefresh
end;
end;
procedure InitializeWizard();
begin
InitializeWizard1();
InitializeWizard2();
InitializeWizard3();
InitializeWizard4();
InitializeWizard5();
end;
procedure CurPageChanged(CurPageID: Integer);
begin
CurPageChanged1(CurPageID);
CurPageChanged2(CurPageID);
CurPageChanged3(CurPageID);
end;
procedure DeinitializeSetup();
begin
DeinitializeSetup1();
DeinitializeSetup2();
end;
Скрипт проверял на IS от Restools...
З.Ы. Если где-то будут крякозяблины - твоя вина; возможно когда копировал скрипты (Слайд-шоу и Деинсталлятора), был включен английский язык, просто найдёшь и заменишь на строки из исходника :)
[hr]
RapMan, качай с зеркал (http://www.xdowns.com/soft/download.asp?softid=18567) :)
A1EXXX, Большое спасибо!
У меня Windows 7 и ISFD падает с ошибкой Runtime error 216 at 00404036 что можно с этим сделать?
RapMan, у меня на Windows 7 то же самое, режим совместимости не помогает :( На ХР нормально работает...
а есть какая-то версия что под семеркой работает? из последних?
RapMan, понятия не имею, я этой прогой не пользуюсь....
а какую можно программу использовать чтобы создать свои собственные окна (ну как в ISFD) ?
Доброго времени суток.
Люди, в программенге не особо забираюсь, но по работе очень много приходить собирать IS-ом. Сейчас мне требуется что бы после установки игры, т.е. перед экраном с вопросом "Вы хотите запустить ******", сделать тихую установку toolbar'a. Т.е. нужен экран на котором я уже доработаю 3 варианта установки, ссылки на сайт и т.д.
Кто поможет? Заранее благодарен!
1. Выводить инфу в Гб, до трех заков после зяпятой (если можно с предидущим примером) »
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[Files]
Source: compiler:Libraries\get_hw_caps.dll; Flags: dontcopy
[Code]
function GetHardDriveFreeSpace(hdd: integer): Integer;
external 'hwc_GetHardDriveFreeSpace@files:get_hw_caps.dll stdcall';
function GetHardDriveName(hdd: integer): PChar;
external 'hwc_GetHardDriveName@files:get_hw_caps.dll stdcall';
function GetHardDriveTotalSpace(hdd: integer): Integer;
external 'hwc_GetHardDriveTotalSpace@files:get_hw_caps.dll stdcall';
function GetHardDrivesCount(): Integer; external 'hwc_GetHardDrivesCount@files:get_hw_caps.dll stdcall';
const
TB = 1024 * 1024;
GB = 1024;
function TBorGBorMB(const FileSize: Extended): string;
// функция определения ТБ, ГБ или МБ
begin
if FileSize/TB > 1 then
Result:= Format('%.3f ТБ', [FileSize/TB])
else
if FileSize/GB > 1 then
Result:= Format('%.3f ГБ', [FileSize/GB])
else Result:= Format('%.3f MБ', [FileSize]);
end;
function InitializeSetup(): Boolean;
var
i, count: Integer;
msg: string;
begin
count:= GetHardDrivesCount();
msg:= 'Количество дисков: ' + IntToStr(count) + #13;
for i:= 0 to count - 1 do
msg:= msg + 'Размер: ' + GetHardDriveName(i) + ' - ' +
TBorGBorMB(GetHardDriveTotalSpace(i)) +
', своб.: ' + TBorGBorMB(GetHardDriveFreeSpace(i)) + #13;
MsgBox(msg, mbInformation, MB_OK);
end;
2. Как сделать проверку версии пиксельных шейдеров у видеокарты »
Не знаю.
Т.е. нужен экран на котором я уже доработаю 3 варианта установки, ссылки на сайт и т.д. »
Вы имеете ввиду, сделать свою дополнительную страницу? Если да, то:
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[Code]
var
Page: TWizardPage;
procedure InitializeWizard();
begin
Page:= CreateCustomPage(wpInstalling, 'Caption', 'Description');
end;
Народ если кому не сложно подредактируйте скрипт вот этот http://slil.ru/28258362 ( залил т.к не помещается в сообш )
Мне хотелось бы реализовать это:
Как тут сделать картинку по верх текста а не наоборот?
http://pic.ipicture.ru/uploads/091126/thumbs/1MyHKtW5OM.jpg (http://ipicture.ru/Gallery/Viewfull/27618275.html)
Как сделать чтобы тут чтобы картинка была из приветствия? Т.е не разные а одинаковые, и чтобы так же была растянута.
http://pic.ipicture.ru/uploads/091126/thumbs/8Tio1KRtpU.jpg (http://ipicture.ru/Gallery/Viewfull/27618341.html)
И ещё в моменте при выборе папки установки хотелось бы сделать "вывод данных о винтах"
как тут http://pic.ipicture.ru/uploads/091126/thumbs/3l5lGiL3lc.jpg (http://ipicture.ru/Gallery/Viewfull/27618628.html)
var
NeedSize:Integer;
FreeMB, TotalMB: Cardinal;
NeedSpaceLabel: TLabel;
n: Integer;
VolumeName, FileSystemName: String;
VolumeSerialNo, MaxComponentLength, FileSystemFlags: Longint;
ListBox: TListBox;
StartMenuTreeView: TStartMenuFolderTreeView;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled := False else
WizardForm.NextButton.Enabled := True; end;
procedure GetNeedSpaceCaption;
begin
if NeedSize > 1024 then
NeedSpaceLabel.Caption := 'Требуется как минимум '+ FloatToStr(round(NeedSize/1024*100)/100) + ' Гб свободного дискового пространства.' else
NeedSpaceLabel.Caption := 'Требуется как минимум '+ IntToStr(NeedSize)+ ' Мб свободного дискового пространства.';end;
const oneMB= 1024*1024;
function GetLogicalDrives: DWord; external 'GetLogicalDrives@kernel32.dll stdcall';
function GetDriveType(nDrive: String): Longint; external 'GetDriveTypeA@kernel32.dll stdcall';
function GetVolumeInformation(PathName,VolumeName: PChar; VolumeNameSize,VolumeSerialNumber,MaxComponentLength,FileSystemFlags: Longint; FileSystemName: PChar; FileSystemNameSize: Longint): Longint; external 'GetVolumeInformationA@kernel32.dll stdcall';
function MessageBox(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal): Integer; external 'MessageBoxA@user32.dll stdcall';
Function ByteOrTB(Bytes: Extended; noMB: Boolean): String; { Перевод числа в значение бт/Кб/Мб/Гб/Тб (до 3х знаков после запятой)}
Begin
if not noMB then Result:= FloatToStr(Int(Bytes)) +' Мб' else
if Bytes < 1024 then Result:= FloatToStr(Int(Bytes)) +' Бт' else
if Bytes/1024 < 1024 then Result:= FloatToStr(round((Bytes/1024)*10)/10) +' Кб' else
If Bytes/oneMB < 1024 then Result:= FloatToStr(round(Bytes/oneMB*100)/100) +' Мб' else
If Bytes/oneMB/1000 < 1024 then Result:= FloatToStr(round(Bytes/oneMB/1024*1000)/1000) +' Гб' else
Result:= FloatToStr(round(Bytes/oneMB/oneMB*1000)/1000) +' Тб'
StringChange(Result, ',', '.')
End;
Function DelSP(String: String): String; { Удаление начальных, конечных и повторных пробелов }
Begin while (Pos(' ', String) > 0) do Delete(String, Pos(' ', String), 1); Result:= Trim(String); End;
Function CutString(String: String; MaxLength: Longint): String; { Обрезать строку до заданного кол-ва символов}
Begin
if Length(String) > MaxLength then Result:= Copy(String, 1, 6) +'...'+ Copy(String, Length(String) - MaxLength +9, MaxLength)
else Result:= String;
End;
Procedure GetDiskInfo(Disk: String);
Begin
FileSystemName:= StringOfChar(' ', 32); VolumeName:= StringOfChar(' ', 256);
GetVolumeInformation(Disk, VolumeName, 255, VolumeSerialNo, MaxComponentLength, FileSystemFlags, FileSystemName, 31);
FileSystemName:= DelSp(FileSystemName); VolumeName:= DelSp(VolumeName); if VolumeName='' then VolumeName:='без метки';
End;
Procedure ListBoxRefresh; var FreeB, TotalB: Cardinal; Path, String: string; Begin
ListBox.Items.Clear
for n:= 1 to 31 do // диск 'А' пропустить
if (GetLogicalDrives and (1 shl n)) > 0 then
if (GetDriveType(Chr(ord('A') + n) +':\') = 2) or (GetDriveType(Chr(ord('A') + n) +':\') = 3) then
if GetSpaceOnDisk(Chr(ord('A') + n) +':\', True, FreeMB, TotalMB) then ListBox.Items.Add(Chr(ord('A') + n) +':');
for n:= 0 to ListBox.Items.Count -1 do begin
Path:= Copy(ListBox.Items[n],1,2) +'\' { если в накопителе нет диска, пропустить обновление }
if GetSpaceOnDisk(Path, False, FreeB, TotalB) and GetSpaceOnDisk(Path, True, FreeMB, TotalMB) then begin GetDiskInfo(Path);
if FreeB >= $7FFFFFFF then String:= PadL(ByteOrTB(FreeMB*oneMB, true),10) else String:= PadL(ByteOrTB(FreeB, true),10);
if TotalB >= $7FFFFFFF then begin TotalB:= TotalMB; FreeB:= FreeMB; String:= PadL(ByteOrTB(TotalMB*oneMB, true),11) +' всего -'+ String end else String:= PadL(ByteOrTB(TotalB, true),11) +' всего| '+ String;
ListBox.Items[n]:= Copy(Path,1,2) + String + PadL(FloatToStr(round(FreeB/TotalB*100)),3)+ '% своб|'+ PadL(FileSystemName,5)+ '| '+ CutString(VolumeName,9); end; end;
End;
Procedure ObjectOnClick(Sender: TObject); Begin
Case TObject(Sender) of
ListBox: for n:= 0 to ListBox.Items.Count-1 do if ListBox.Selected[n] then WizardForm.DirEdit.Text:= Copy(ListBox.Items[n],1,1) +Copy(WizardForm.DirEdit.Text, 2, Length(WizardForm.DirEdit.Text))
StartMenuTreeView: if StartMenuTreeView.Directory <> '' then WizardForm.GroupEdit.Text:= StartMenuTreeView.Directory else WizardForm.GroupEdit.Text:= '{#SetupSetting("DefaultGroupName")}'
WizardForm.NoIconsCheck: begin WizardForm.GroupEdit.Enabled:= not(WizardForm.GroupEdit.Enabled); StartMenuTreeView.Enabled:= WizardForm.GroupEdit.Enabled; WizardForm.GroupBrowseButton.Enabled:= WizardForm.GroupEdit.Enabled end;
end; End;
procedure InitializeWizard();
begin
NeedSize := 6100; //Здесь указывается место для приложения
WizardForm.DiskSpaceLabel.Hide;
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(220);
Width := ScaleX(209);
Height := ScaleY(13);
end;
ListBox:= TListBox.Create(WizardForm)
ListBox.SetBounds(WizardForm.DirEdit.Left, WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + 8, WizardForm.DirBrowseButton.Left + WizardForm.DirBrowseButton.Width - WizardForm.DirEdit.Left, WizardForm.DiskSpaceLabel.Top - (WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + 12))
ListBox.Font.Size:= 9
ListBox.Font.Style:= []
ListBox.Font.Name:= 'Courier New';
ListBox.OnClick:= @ObjectOnClick;
ListBox.Parent:= WizardForm.SelectDirPage;
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpSelectDir then
begin
GetNeedSpaceCaption;
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled:=False
ListBoxRefresh
end;
end;
ПОМОГИТЕ
За ранее огромное спасибо!
подскажите как поставить фон в инсталере ? »
Что вы имеете в виду под словом фон?
подскажите как поставить фон в инсталере ? »
В секцию [Setup] добавьте WindowVisible=yes
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.