Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 3]
Gnom_aka_Lexander
30-03-2011, 17:14
insombia, procedure InitializeWizard();
begin
WizardForm.TasksList.Left := ScaleX(40);
WizardForm.TasksList.Top := ScaleY(117);
WizardForm.TasksList.Parent := WizardForm;
WizardForm.TasksList.Hide;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
WizardForm.TasksList.Hide;
case CurPageID of
wpSelectTasks:
begin
WizardForm.TasksList.Show;
end;
end;
end;
Както так...
Или хотя бы подскажите как сделать разделитель граф,при вводе серийного номера?
LordSP, [Setup]
AppName=My Program
AppVerName=My Program v.1.2
DefaultDirName={pf}\My Program
LicenseFile=compiler:License.txt
[Files]
Source: compiler:InnoCallback.dll; Flags: dontcopy
[_Code]
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);
const
EM_GETFIRSTVISIBLELINE = $CE; TestLine = 5;
var
TimerID: LongWord;
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';
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
var
CurrLine: integer;
begin
CurrLine:= SendMessage(WizardForm.LicenseMemo.Handle, EM_GETFIRSTVISIBLELINE, 0, 0);
If CurrLine >= TestLine then
begin
WizardForm.LicenseAcceptedRadio.Enabled:= True;
KillTimer(0, TimerID);
end;
end;
procedure InitializeWizard();
begin
WizardForm.LicenseAcceptedRadio.Enabled:= False;
end;
procedure CurPageChanged(CurPageID: Integer);
var
pfunc: LongWord;
begin
if CurPageID = wpLicense then
begin
pfunc:= WrapTimerProc(@OnTimer, 4);
TimerID:= SetTimer(0, 0, 500, pfunc);
end else
KillTimer(0, TimerID);
end;
procedure DeinitializeSetup();
begin
KillTimer(0, TimerID);
end;
nik1967
Все также,кнопка далее не активна пока не установишь чебокс,а не после прокрутки скролла.
Как к MsgBox добавить не только кнопку ОК , а и кнопочку "Отмена"?
Gnom_aka_Lexander
30-03-2011, 19:30
R3Pa4eK, mbConfirmation, MB_YESNO) если тебе это о чемто говорит.
если тебе это о чемто говорит. »
Конечно говорит, спасибо! Только я чуть-чуть переделал и сделал вот так: MsgBox(Capt, mbConfirmation, MB_OKCancel); . Теперь мне надо реализовать такое: что-бы при нажатии на кнопку "Отмена" удалялась папка {app} и закрывался инсталл. Поможешь?
Gnom_aka_Lexander
30-03-2011, 19:53
R3Pa4eK, if MsgBox(Capt, mbConfirmation, MB_OKCANCEL)= IDCANCEL then - нужное тебе действие - чего хоть сложного?
В моем ренегаде реализовано так:
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode:integer;
begin
if CurStep = ssDone then
if FileExists('{#AppExe}') then \\ - проверка на наличие файла
if MsgBox('{#SetupSetting("AppName")}' +' успешно ' + ' установлена!' + #10#10#13 + 'Запустить ' + '{#SetupSetting("AppName")}' + '?' , mbInformation, MB_OKCANCEL) = IDOK then
Exec(ExpandConstant('{#AppExe}'), '', '', SW_SHOW, ewNoWait, ResultCode); \\нужное действие на нажатие заявленной кнопки.
end;
end;
Все также,кнопка далее не активна пока не установишь чебокс,а не после прокрутки скролла. »
неактивными кнопку "далее" и чебокс "принять..."
Как то уж определись, что тебе надо.
Ну а переделать скрипт, который я выкладывал, не судьба?[Setup]
AppName=My Program
AppVerName=My Program v.1.2
DefaultDirName={pf}\My Program
LicenseFile=compiler:License.txt
[Files]
Source: compiler:InnoCallback.dll; Flags: dontcopy
[_Code]
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);
const
EM_GETFIRSTVISIBLELINE = $CE; TestLine = 5;
var
TimerID: LongWord;
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';
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
var
CurrLine: integer;
begin
CurrLine:= SendMessage(WizardForm.LicenseMemo.Handle, EM_GETFIRSTVISIBLELINE, 0, 0);
If CurrLine >= TestLine then
begin
WizardForm.NextButton.Enabled:= True;
KillTimer(0, TimerID);
end;
end;
procedure InitializeWizard();
begin
WizardForm.LicenseAcceptedRadio.Hide;
WizardForm.LicenseNotAcceptedRadio.Hide;
end;
procedure CurPageChanged(CurPageID: Integer);
var
pfunc: LongWord;
begin
if CurPageID = wpLicense then
begin
pfunc:= WrapTimerProc(@OnTimer, 4);
TimerID:= SetTimer(0, 0, 500, pfunc);
end else
KillTimer(0, TimerID);
end;
procedure DeinitializeSetup();
begin
KillTimer(0, TimerID);
end;
Все также,кнопка далее не активна пока не установишь чебокс »
Ну вообще-то для этого и есть страница с Лицензией, если он не согласен, то не сможет установить программу, т.е. моё мнение - RadioButton'ы должны быть всегда.
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
LicenseFile=compiler:License.txt
OutputDir=.
Compression=lzma2/ultra
InternalCompressLevel=ultra
SolidCompression=yes
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[Files]
Source: compiler:Libraries\InnoCallback.dll; Flags: dontcopy
[Code]
type
TTextMetric = record
tmHeight: Longint;
tmAscent: Longint;
tmDescent: Longint;
tmInternalLeading: Longint;
tmExternalLeading: Longint;
tmAveCharWidth: Longint;
tmMaxCharWidth: Longint;
tmWeight: Longint;
tmOverhang: Longint;
tmDigitizedAspectX: Longint;
tmDigitizedAspectY: Longint;
tmFirstChar: Char;
tmLastChar: Char;
tmDefaultChar: Char;
tmBreakChar: Char;
tmItalic: Byte;
tmUnderlined: Byte;
tmStruckOut: Byte;
tmPitchAndFamily: Byte;
tmCharSet: Byte;
end;
Pointer = procedure(Sender: TObject);
function GetDC(hWnd: HWND): LongWord; external 'GetDC@user32.dll stdcall';
function SelectObject(DC: LongWord; p2: LongWord): LongWord; external 'SelectObject@gdi32.dll stdcall';
function GetWindowRect(hWnd: HWND; var lpRect: TRect): BOOL; external 'GetWindowRect@user32.dll stdcall';
function GetTextMetrics(DC: LongWord; var TM: TTextMetric): BOOL; external 'GetTextMetricsA@gdi32.dll stdcall';
function ReleaseDC(hWnd: HWND; hDC: LongWord): Integer; external 'ReleaseDC@user32.dll stdcall';
function WrapTimerProc(callback: Pointer; 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';
const
EM_GETRECT = $00B2;
EM_GETFIRSTVISIBLELINE = $00CE;
var
TimerID: LongWord;
IsReadLicense: Boolean;
function GetFirstVisibleLine(const Memo: TMemo): Integer;
begin
Result := SendMessage(Memo.Handle, EM_GETFIRSTVISIBLELINE, 0, 0);
end;
function GetCountVisibleLines(const Memo: TMemo): Integer;
var
OldFont: LongWord;
Hand: THandle;
TM: TTextMetric;
Rect: TRect;
begin
Hand := GetDC(Memo.Handle);
try
OldFont := SelectObject(Hand, Memo.Font.Handle);
GetTextMetrics(Hand, TM);
GetWindowRect(Memo.Handle, Rect);
Result := ((Rect.Bottom - Rect.Top) div (TM.tmHeight + TM.tmExternalLeading));
finally
ReleaseDC(Memo.Handle, SelectObject(Hand, OldFont));
end;
end;
function GetLastVisibleLine(const Memo: TMemo): Boolean;
begin
Result := (GetFirstVisibleLine(Memo) + GetCountVisibleLines(Memo)) >= (Memo.Lines.Count-1);
end;
procedure TimerProc(Sender: TObject);
begin
if not IsReadLicense and GetLastVisibleLine(WizardForm.LicenseMemo) then
begin
WizardForm.LicenseAcceptedRadio.Enabled := True;
// WizardForm.LicenseAcceptedRadio.Checked := True;
IsReadLicense := True;
end;
end;
procedure InitializeWizard();
begin
TimerID := 0;
IsReadLicense := False;
WizardForm.LicenseAcceptedRadio.Enabled := False;
// WizardForm.LicenseAcceptedRadio.Hide;
// WizardForm.LicenseNotAcceptedRadio.Hide;
// WizardForm.LicenseMemo.Height := WizardForm.LicenseMemo.Height + ScaleY(35);
end;
procedure CurPageChanged(CurPageID: Integer);
begin
case CurPageID of
wpLicense:
if not IsReadLicense then
TimerID := SetTimer(0, 0, 50, WrapTimerProc(@TimerProc, 0));
else
if TimerID > 0 then
begin
KillTimer(0, TimerID);
TimerID := 0;
end;
end;
end;
Если вы всё же хотите сделать без RadioButton'ов, просто раскоментируйте строки.
P.S.
nik1967, этот пример из сборника скриптов, не совсем корректен, т.к. не определяет, прокрутил ли пользователь скролбар до конца.
Ну и по хорошему ещё сюда нужно прикрутить хинт или лэйбл какой-нибудь сделать, чтоб если пользователь резко прокрутил скролбар, то значит не читал и об этом написать ему, что мол читать надо вдумчиво... :)
newmangor
31-03-2011, 08:32
Доброго все времени суток ! Помогите с вопросом ! факи читал нефига не понял !
[Tasks]
Name: additional; Description: "Дополнительное ПО";
Name: additional\dx; Description: "Обновить DirectX"; Flags: unchecked
Name: additional\vcr86; Description: "Обновить библиотеки С++ х86"; Flags: unchecked;
Name: additional\vcr64; Description: "Обновить библиотеки С++ х64"; Flags: unchecked;
[Run]
Filename: {src}\Redist\vcredist_x86.exe; Flags: nowait; Tasks: additional\vcr86; Parameters: /q;
Filename: {src}\Redist\vcredist_x64.exe; Flags: nowait; Tasks: additional\vcr64; Parameters: /q;
Filename: {src}\Redist\DirectX\dxsetup.exe; Flags: nowait; Tasks: additional\dx; Parameters: /silent;
Вопрос заключается в следующем:
Как сделать, чтобы файлы в секции [Run] запускались по очереди? Т.е. инсталляция второго файла начиналась только после того, как инсталляция первого файла закончилась или отменилась, желательно на данном примере !
Спасибо Огромное !!!
Gnom_aka_Lexander
31-03-2011, 11:00
newmangor, удали флаг nowait - он заставляет не ожидать окончания предидущего запуска. И внимательно читаем справку - даже в русской это есть.
newmangor
31-03-2011, 12:37
мб я не ту справку читаю ? ссылку мона или докум ? спс еще раз выручил !
Gnom_aka_Lexander
31-03-2011, 13:43
Не знаю, насколько актуально, минимизация инсталла на странице инсталляции в правый нижний угол с корректным отображением на любом мониторе, с отключенным задним фоном.
[Setup]
AppName=Avengerz
AppVerName=Avengerz
AppVersion=Avengerz
DefaultDirName={pf}\Avengerz
DefaultGroupName=Avengerz
[Files]
Source: {sys}\*.dll; DestDir: {app}; Flags: external deleteafterinstall
[code]
function GetSystemMetrics(nIndex:Integer):integer; external 'GetSystemMetrics@user32.dll stdcall delayload';
procedure InitializeWizard();
begin
WizardForm.CancelButton.BringToFront;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpInstalling then
begin
WizardForm.Bevel.Hide;
WizardForm.Bevel1.Hide;
WizardForm.BorderStyle:=bsDialog;
WizardForm.MainPanel.Visible:=False;
WizardForm.Width:=ScaleX(320);
WizardForm.Height:=ScaleY(127);
WizardForm.InnerNotebook.Left:=ScaleX(7);
WizardForm.InnerNotebook.Top:=ScaleY(7);
WizardForm.InnerNotebook.Width:=ScaleX(300);
WizardForm.StatusLabel.Left:=ScaleX(0);
WizardForm.StatusLabel.Top:=ScaleY(0);
WizardForm.StatusLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.FileNameLabel.Left:=ScaleX(0);
WizardForm.FileNameLabel.Top:=ScaleY(17);
WizardForm.FileNameLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.ProgressGauge.Top:=ScaleY(37);
WizardForm.ProgressGauge.Left:=ScaleX(0);
WizardForm.ProgressGauge.Width:=WizardForm.InnerNotebook.Width;
WizardForm.CancelButton.Left:=ScaleX(122);
WizardForm.CancelButton.Top:=ScaleY(70);
WizardForm.Left:=GetSystemMetrics(16)-GetSystemMetrics(16)+ ScaleX(5);
WizardForm.Top:=GetSystemMetrics(17)-ScaleX(110);
end;
if CurPageID=wpFinished
then
begin
WizardForm.Width:=502;
WizardForm.Height:=392;
WizardForm.Position:=poScreenCenter;
end
end; На базе примера от Avengerz
необходимо соединение с интернетом »
А если нет интернета, то нет и внешнего IP :)
Здравствуйте, накидал скрипт, как можно узнать IP адрес машины, на которой запущен инсталлятор (необходимо соединение с интернетом):
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputDir=.
Compression=lzma2/ultra
InternalCompressLevel=ultra
SolidCompression=yes
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[Code]
{===============================================================================}
{ Script name: GetMyIP.iss }
{ Script version: 1.0 }
{ Author: Serega, http://forum.oszone.net/member.php?userid=88670 }
{ }
{ This script shows how to learn your IP }
{ Этот скрипт показывает, как узнать свой IP }
{===============================================================================}
var
pnl: TPanel;
lbl: TLabel;
Memo: TMemo;
Button: TButton;
function GetHtmlSource(const url: string): string;
var
vHttp: Variant;
begin
try
vHttp := CreateOleObject('Microsoft.XMLHTTP');
vHttp.open('GET', url, False);
vHttp.send;
Result := vHttp.responseText;
except
Result := 'Возникла ошибка при обращении к серверу, проверьте настройки соединения.';
end;
end;
procedure ButtonClick(Sender: TObject);
var
strHtml: string;
begin
try
Memo.Clear;
lbl.Caption := '';
strHtml := GetHtmlSource('http://2ip.ru/');
Memo.Lines.Text := strHtml;
if (strHtml <> '') and (Pos('ошибка', Copy(strHtml, 1, 20)) = 0) then
begin
Delete(strHtml, 1, Pos('class="ip"', strHtml));
Delete(strHtml, 1, Pos('<big', strHtml));
Delete(strHtml, 1, Pos('>', strHtml));
SetLength(strHtml, Pos('<', strHtml)-1);
lbl.Caption := 'Ваш IP адрес: ' + Trim(strHtml);
end;
finally
SetLength(strHtml, 0);
end;
end;
procedure InitializeWizard();
begin
pnl := TPanel.Create(WizardForm);
with pnl do
begin
Parent := WizardForm;
Left := 0;
Top := 0;
Align := alClient;
end;
WizardForm.CancelButton.Parent := pnl;
with TLabel.Create(WizardForm) do
begin
Parent := pnl;
AutoSize := True;
Left := ScaleX(15);
Top := ScaleY(10);
Caption := 'Исходный код страницы (http://2ip.ru/):';
end;
Memo := TMemo.Create(WizardForm);
with Memo do
begin
Parent := pnl;
SetBounds(ScaleX(15), ScaleY(30), WizardForm.ClientWidth - ScaleX(30), ScaleY(285));
ReadOnly := True;
ScrollBars := ssBoth;
Text := '';
end;
Button := TButton.Create(WizardForm);
with Button do
begin
Parent := pnl;
SetBounds(ScaleX(300), WizardForm.CancelButton.Top, ScaleX(85), ScaleY(23));
Caption := 'Узнать IP';
OnClick := @ButtonClick;
end;
lbl := TLabel.Create(WizardForm);
with lbl do
begin
Parent := pnl;
AutoSize := True;
Left := ScaleX(25);
Top := ScaleY(328);
Font.Size := 12;
end;
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm := False;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
WizardForm.CancelButton.Caption := 'Закрыть';
end;
Здравствуйте, возникла сегодня у меня такая задача, как создать точку восстановления перед установкой программы.
Для этого можно конечно воспользоваться скриптом .vbs, смущает одно, сохраняем лишний файл на диск, затем запускаем...
Одним словом решил это дело реализовать без сохранения на диск:
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma2/ultra
InternalCompressLevel=ultra
SolidCompression=yes
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[CustomMessages]
rus.otherGroup=Прочее:
rus.pointDesc=Создать системную контрольную точку (рекомендуется)
rus.pointMsg=Создание контрольной точки...
[Tasks]
Name: restorepoint; Description: {cm:pointDesc}; GroupDescription: {cm:otherGroup}; MinVersion: 0,5.1
[Files]
Source: compiler:Examples\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
[Code]
{===============================================================================}
{ Script name: SetRestorePoint.iss }
{ Script version: 1.0 }
{ Author: Serega, http://forum.oszone.net/member.php?userid=88670 }
{ }
{ This script shows how to create restore point before install }
{ Этот скрипт показывает, как создать контрольную точку перед установкой }
{ }
{ function SetRestorePoint(const PointName: string): Boolean; }
{===============================================================================}
const
// Description http://msdn.microsoft.com/en-us/library/aa378847%28VS.85%29.aspx
// Restore point type
APPLICATION_INSTALL = 0;
APPLICATION_UNINSTALL = 1;
DEVICE_DRIVER_INSTALL = 10;
MODIFY_SETTINGS = 12;
CANCELLED_OPERATION = 13;
// Event type
BEGIN_SYSTEM_CHANGE = 100;
END_SYSTEM_CHANGE = 101;
BEGIN_NESTED_SYSTEM_CHANGE = 102;
END_NESTED_SYSTEM_CHANGE = 103;
function SetRestorePoint(const PointName: string): Boolean;
var
vObj, SR: Variant;
begin
vObj := CreateOleObject('ScriptControl');
vObj.Language := 'VBScript';
SR := vObj.eval('GetObject("winmgmts:\\.\root\default:SystemRestore")');
Result := SR.CreateRestorePoint(PointName, APPLICATION_INSTALL, BEGIN_SYSTEM_CHANGE) = 0;
end;
procedure CurPageChanged(CurPageID: Integer);
var
msg: string;
begin
if (CurPageID = wpInstalling) and IsTaskSelected('restorepoint') then
try
msg := WizardForm.StatusLabel.Caption;
WizardForm.StatusLabel.Caption := ExpandConstant('{cm:pointMsg}');
WizardForm.Repaint;
// создаём контрольную точку
SetRestorePoint('Установка {#SetupSetting("AppName")}');
WizardForm.StatusLabel.Caption := msg;
finally
SetLength(msg, 0);
end;
end;
mariolast
01-04-2011, 09:56
На руборде отвечали, там можно и айпи взять, если я правильно понял.вот Там вроде сохраняется ини с параметрами сетевухи и из него считывается нужная информация.
Есть засада, если стоит роутер, то получим ip, который выдает роутер. Обойти можно подключившись к какому-нибудь сайту, например 2ip.ru, и считать ip с него.
Чуть позже:
Простенький инсталл, без претензий на высокие оценки, но достаточно симпатичный »
Тяжеловато выходит.
Если у меня виртуальная машина то появляется как минимкм еще 2 сетевых адаптера. А мне нужно мой физический вычислить.
Пробовал так
function GetMACAddress(): string;
var
ResultCode: Integer;
strArray: TArrayOfString;
Temp: string;
strMAC: string;
strLen: integer;
i: integer;
begin
Result:= '';
Exec('cmd.exe', '/c ipconfig /all >> ' + ExpandConstant('{tmp}\adapter.info'), '', SW_HIDE,
ewWaitUntilTerminated, ResultCode);
LoadStringsFromFile(ExpandConstant('{tmp}\adapter.info'), strArray);
for i := 1 to GetArrayLength(strArray)-1 do begin
strLen:= Length(strArray[i]);
Temp:=strArray[i-1];
if strLen > 16 then
begin
// MsgBox(IntToStr(Pos('VMware', Temp)), mbInformation, MB_OK);
MsgBox(Temp, mbInformation, MB_OK);
if (CompareStr('-', strArray[i][strLen-2] ) = 0) and
(CompareStr('-', strArray[i][strLen-5] ) = 0) and
(CompareStr('-', strArray[i][strLen-8] ) = 0) and
(CompareStr('-', strArray[i][strLen-11]) = 0) and
(CompareStr('-', strArray[i][strLen-14]) = 0) and
(Pos('VMware', Temp) = 0) and
(Pos('Hamachi', Temp) = 0) then
Result:= Result + #10#13 + Copy(strArray[i], strLen-16, 17);
end;
end;
end;
В результате, на 7-ке как то работает, на XP нет. Для информации отладки смотрю переменную Temp, в 7-ке все что русскими выводится на экран крякозябрами (можно ли это поправить не знаю). На XP ее значение вообще пустое....
mariolast
01-04-2011, 10:27
скрипт, как можно узнать IP адрес машины, на которой запущен инсталлятор »
Я для этого использую библиотеку IPUtils.dll
(можно ли это поправить не знаю) »
Можно, используйте конвертирование strArray[i] := DosToAnsi(strArray[i]), чуть поправил ваш пример:
#include "ConvertString.iss"
function GetMACAddress(): string;
var
ResultCode: Integer;
strArray: TArrayOfString;
Temp: string;
strMAC: string;
strLen: integer;
i: integer;
begin
Result := '';
Exec('cmd.exe', '/c ipconfig /all >"' + ExpandConstant('{tmp}\adapter.info') + '"', '', SW_HIDE,
ewWaitUntilTerminated, ResultCode);
LoadStringsFromFile(ExpandConstant('{tmp}\adapter.info'), strArray);
for i := 0 to GetArrayLength(strArray)-1 do
if Length(strArray[i]) > 16 then
begin
strArray[i] := DosToAnsi(strArray[i]);
strLen := Length(strArray[i]);
MsgBox(strArray[i], mbInformation, MB_OK);
if (CompareStr('-', strArray[i][strLen-2] ) = 0) and
(CompareStr('-', strArray[i][strLen-5] ) = 0) and
(CompareStr('-', strArray[i][strLen-8] ) = 0) and
(CompareStr('-', strArray[i][strLen-11]) = 0) and
(CompareStr('-', strArray[i][strLen-14]) = 0) and
(Pos('VMware', strArray[i]) = 0) and
(Pos('Hamachi', strArray[i]) = 0) then
Result := Result + #10#13 + Copy(strArray[i], strLen-16, 17);
end;
end;
Сам скрипт ConvertString.iss - здесь (http://forum.oszone.net/post-1643707-1138.html)
Я для этого использую библиотеку IPUtils.dll »
А вы думаете как она проверяет IP? Смысл один и тот же, только не нужно доп. библиотек.
mariolast
01-04-2011, 11:45
Serega,
Ну это уже что то, уже читает под ХП текстовый файл, хоть и русские буквы крякозябрами все равно, но пока это не столь важно. Спасибо.
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.