[firebase-br] Instalando o Firebird w/ Inno By Inprise !
Laudelino
laudelino em pobox.com
Qua Ago 3 02:04:11 -03 2005
Bom pessoal, encontrei isso na Net, em um arquivo zipado, o que me
impediu de colocar um link.
Já vi várias mnsagens aqui sobre instalações FB e creio que o script
abaixo do Inno Setup, será de grande valia para muitos, não só para se
instalar os FB, mas de como se pode fazer algumas coisas como parar o IB
instalado durante a instalação nova e outras coisitas...
(nem sei se posso mandar mensagens grandes assim... me avisem... :) )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; for You from Michal MiP Prokopec (mip em algo-hk.cz) ;
; ;
; using Inno Setup Extensions (www.wintax.nl/isx) ;
; ISTool (www.bhenden.org/istool) ;
; Inno Setup Preprocessor (yackimoff.cjb.net) ;
; ;
#define fb_dir_src "FireBird-1.0.0-RC2-Win32"
#define fb_appname "FireBird Database Server"
#define fb_version "1.0.0.679 RC2"
#define fb_vername fb_appname+" "+fb_version
#define output "FireBird-1-00-RC2"
[_ISTool]
EnableISX=true
UseAbsolutePaths=true
[Setup]
AppName={#= fb_appname}
AppVerName={#= fb_vername}
AppCopyright=Portions created by Inprise Corporation are Copyright (C)
2000, Inprise Corporation. Portions created by others are Copyright (C)
2000-2002, Firebird Project.
DefaultDirName={pf}\FireBird
DefaultGroupName={#= fb_appname}
CompressLevel=9
OutputBaseFilename={#= output}
MessagesFile=compiler:Default.isl
WindowResizable=false
AlwaysCreateUninstallIcon=true
UninstallIconName=Uninstall
UninstallLogMode=overwrite
WizardImageFile=FireBirdLogo.bmp
WizardSmallImageFile=SmallLogo.bmp
AllowNoIcons=true
UsePreviousSetupType=false
UsePreviousTasks=false
DisableReadyPage=false
ShowComponentSizes=false
InfoBeforeFile={#= fb_dir_src}\Readme.txt
AlwaysShowDirOnReadyPage=true
AlwaysShowGroupOnReadyPage=true
[Types]
Name: _ClientMini; Description: Compact installation of FireBird client
Name: _Client; Description: Installation of FireBird client
Name: _ServerMini; Description: Compact installation of FireBird server
Name: _Server; Description: Installation of FireBird server
Name: _Custom; Description: Custom installation of FireBird; Flags: iscustom
[Components]
Name: Client; Description: FireBird client; Types: _ClientMini _Client
_ServerMini _Server _Custom; Flags: fixed
Name: Server; Description: FireBird database server; Types: _ServerMini
_Server _Custom
Name: Tools; Description: Administration tools; Types: _Server _Custom
Name: Document; Description: Documentation and exapmles; Types: _Server
_Client _Custom
Name: Develop; Description: Software development support; Types: _Server
_Client _Custom
[Dirs]
Name: {app}\bin
Name: {app}\doc; Components: Document
Name: {app}\examples; Components: Document
Name: {app}\help; Components: Document
Name: {app}\include; Components: Develop
Name: {app}\intl; Components: Server
Name: {app}\lib; Components: Develop
Name: {app}\udf; Components: Server
[Files]
Source: {#= fb_dir_src}\Readme.txt; DestDir: {app}; CopyMode: normal
Source: {#= fb_dir_src}\Copy of isc4.gdb; DestDir: {app}; DestName:
isc4.gdb; CopyMode: onlyifdoesntexist; Flags: uninsneveruninstall;
Components: Server
Source: {#= fb_dir_src}\isc4.gbk; DestDir: {app}; CopyMode:
onlyifdoesntexist; Flags: uninsneveruninstall; Components: Server
Source: {#= fb_dir_src}\ibconfig; DestDir: {app}; CopyMode: normal;
Components: Server
Source: {#= fb_dir_src}\interbase.msg; DestDir: {app}; CopyMode: normal;
Flags: sharedfile
Source: {#= fb_dir_src}\Set3050.exe; DestDir: {tmp}; Flags:
deleteafterinstall
Source: {#= fb_dir_src}\bin\gbak.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; Components: Tools
Source: {#= fb_dir_src}\bin\gdef.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; Components: Tools
Source: {#= fb_dir_src}\bin\gfix.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; Components: Tools
Source: {#= fb_dir_src}\bin\gpre.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; Components: Tools
Source: {#= fb_dir_src}\bin\gsec.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; Components: Tools
Source: {#= fb_dir_src}\bin\gstat.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; Components: Tools
Source: {#= fb_dir_src}\bin\ibguard.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; Components: Server; Flags: sharedfile
Source: {#= fb_dir_src}\bin\iblockpr.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; Components: Tools
Source: {#= fb_dir_src}\bin\ibserver.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; Components: Server; Flags: sharedfile
Source: {#= fb_dir_src}\bin\instreg.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder
Source: {#= fb_dir_src}\bin\isql.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; Components: Tools
Source: {#= fb_dir_src}\bin\qli.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; Components: Tools
Source: {#= fb_dir_src}\doc\*.*; DestDir: {app}\doc; Components: Document
Source: {#= fb_dir_src}\examples\*.*; DestDir: {app}\examples;
Components: Document
Source: {#= fb_dir_src}\help\*.*; DestDir: {app}\help; Components: Document
Source: {#= fb_dir_src}\include\*.*; DestDir: {app}\include; Components:
Develop
Source: {#= fb_dir_src}\intl\gdsintl.dll; DestDir: {app}\intl;
Components: Server; Flags: sharedfile
Source: {#= fb_dir_src}\lib\*.*; DestDir: {app}\lib; Components: Develop
Source: {#= fb_dir_src}\udf\*.*; DestDir: {app}\udf; Components: Server
Source: {#= fb_dir_src}\System\gds32.dll; DestDir: {sys}; CopyMode:
alwaysskipifsameorolder; Flags: sharedfile
Source: {#= fb_dir_src}\System\msvcrt.dll; DestDir: {sys}; CopyMode:
onlyifdoesntexist; Flags: uninsneveruninstall sharedfile
; only on Win9x/Me ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Source: {#= fb_dir_src}\bin\stopsrv.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; MinVersion: 4.0,0; Components: Server
; only on NT/2000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Source: {#= fb_dir_src}\bin\instsvc.exe; DestDir: {app}\bin; CopyMode:
alwaysskipifsameorolder; MinVersion: 0,4.0; Components: Server
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Registry]
; only on Win9x/Me ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Root: HKLM; Subkey: Software\Microsoft\Windows\CurrentVersion\Run;
ValueType: string; ValueName: InterBaseGuardian; ValueData:
{app}\bin\ibguard.exe; MinVersion: 4.0,0; Flags: uninsdeletevalue;
Components: Server
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Root: HKLM; Subkey: Software\Firebird Database Server\CurrentVersion;
ValueType: string; ValueName: Version; ValueData: {#= fb_version};
Flags: uninsdeletevalue; Components: Server
Root: HKLM; Subkey: Software\Firebird Database Server\CurrentVersion;
ValueType: string; ValueName: ServerDirectory; ValueData: {app}\bin\;
Flags: uninsdeletevalue; Components: Server
Root: HKLM; Subkey: Software\Firebird Database Server\CurrentVersion;
Flags: uninsdeletekeyifempty; Components: Server
Root: HKLM; Subkey: Software\Firebird Database Server; Flags:
uninsdeletekeyifempty; Components: Server
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; FOR BACKWARD COMPATIBILITY
;Root: HKLM; Subkey: Software\Borland\InterBase; ValueType: DWord;
ValueName: UseCount; ValueData: {reg:HKLM\Software\Borland\InterBase,
UseCount|0} + 1
;Root: HKLM; Subkey: Software\Borland\InterBase\CurrentVersion;
ValueType: DWord; ValueName: UseCount; ValueData:
{reg:HKLM\Software\Borland\InterBase\CurrentVersion, UseCount|0} + 1
; obsolete - Root: HKLM; Subkey:
Software\Borland\InterBase\CurrentVersion; ValueType: string; ValueName:
DefaultMode; ValueData: -r; Components: Server
Root: HKLM; Subkey: Software\Borland\InterBase\CurrentVersion;
ValueType: string; ValueName: GuardianOptions; ValueData: 1; Components:
Server
Root: HKLM; Subkey: Software\Borland\InterBase\CurrentVersion;
ValueType: string; ValueName: ServerDirectory; ValueData: {app}\bin\;
Components: Server
; Software\Borland\InterBase\CurrentVersion\RootDirectory
; &
; Software\Borland\InterBase\CurrentVersion\Version
; are setted by instreg.exe,
; delete of empty key Software\Borland\InterBase is work of instreg.exe too
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Icons]
Name: {group}\Firebird Guard; Filename: {app}\bin\ibguard.exe;
WorkingDir: {app}\bin; Components: Server
Name: {group}\Release Notes; Filename: {app}\doc\FB1_ReleaseNotes.pdf;
WorkingDir: {app}\doc; Components: Document
Name: {group}\Readme; Filename: {app}\readme.txt; WorkingDir: {app}
Name: {group}\Bugs Closed; Filename: {app}\doc\FirebirdBugsClosed.html;
WorkingDir: {app}\doc; Components: Document
Name: {group}\Bugs Open; Filename: {app}\doc\FirebirdBugsOpen.html;
WorkingDir: {app}\doc; Components: Document
Name: {group}\Feature Request Closed; Filename:
{app}\doc\FirebirdFeatureRequestClosed.html; WorkingDir: {app}\doc;
Components: Document
Name: {group}\Feature Request Open; Filename:
{app}\doc\FirebirdFeatureRequestOpen.html; WorkingDir: {app}\doc;
Components: Document
Name: {group}\Release Candidate 2 FAQ; Filename: {app}\doc\RC2_FAQ.htm;
WorkingDir: {app}\doc; Components: Document
[Run]
Filename: {tmp}\Set3050.exe; Flags: runminimized
Filename: {app}\bin\instreg.exe; Parameters: "install ""{app}"""; Flags:
nowait runminimized
; only on NT/2000 - installation of service ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Filename: {app}\bin\instsvc.exe; Parameters: "install ""{app}"" -auto
-z"; Flags: runminimized; MinVersion: 0,4.0; Components: Server
Filename: {app}\bin\instsvc.exe; Parameters: start; Flags: nowait
runminimized; MinVersion: 0,4.0; Components: Server
; only on Win9x/Me ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Filename: {app}\bin\ibguard.exe; Flags: nowait; MinVersion: 4.0,0;
Components: Server
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[UninstallRun]
; only on Win9x/Me ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Filename: {app}\bin\stopsrv.exe; Parameters: stop; Flags: runminimized;
MinVersion: 4.0,0; Components: Server
; only on NT/2000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Filename: {app}\bin\instsvc.exe; Parameters: stop; Flags: runminimized;
MinVersion: 0,4.0; Components: Server
Filename: {app}\bin\instsvc.exe; Parameters: remove; Flags: nowait
runminimized; MinVersion: 0,4.0; Components: Server
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Filename: {app}\bin\instreg.exe; Parameters: remove; Flags: runminimized
[UninstallDelete]
Name: {app}\*.lck; Type: files
Name: {app}\*.log; Type: files
################# 3050.DPR ###################
{ for You from Michal MiP Prokopec (mip em algo-hk.cz) }
program Set3050;
uses Windows, SysUtils, Classes, ShlObj;
type
DirectoryType = (_WINDOWS, _SYSTEM{, _TEMP, _CURRENT});
function GetDirectory(Dir: DirectoryType): string;
var Path: array [0..MAX_PATH] of Char;
begin
case Dir of
_WINDOWS: GetWindowsDirectory(Path, Sizeof(Path));
_SYSTEM : GetSystemDirectory(Path, Sizeof(Path));
// _TEMP : GetTempPath(Sizeof(Path), Path);
// _CURRENT: GetCurrentDirectory(Sizeof(Path), Path);
end;
Result := StrPas(Path)+'\';
end;
function ExtractWord(N: Integer; const S: string; const WordDelims:
TSysCharSet): string;
var C, I, X: Integer;
begin
C := 0;
I := 1;
X := 0;
while (I <= Length(S)) and (C <> N) do begin
while (I <= Length(S)) and (S[I] in WordDelims) do Inc(I);
if I <= Length(S) then Inc(C);
if C <> N then
while (I <= Length(S)) and not (S[I] in WordDelims) do Inc(I)
else X := I;
end;
I := X;
C := 0;
if I <> 0 then
while (I <= Length(S)) and not(S[I] in WordDelims) do begin
Inc(C);
SetLength(Result, C);
Result[C] := S[I];
Inc(I);
end;
SetLength(Result, C);
end;
const ServFile = 'Services';
NtServFile = 'Drivers\Etc\'+ServFile;
gds_db = 'gds_db';
ServRow = gds_db+' 3050/tcp';
var FilePth: String;
Lst: TStrings;
i: Integer;
begin
FilePth := GetDirectory(_SYSTEM)+NtServFile;
if not FileExists(FilePth) then begin
FilePth := GetDirectory(_WINDOWS)+ServFile;
if not FileExists(FilePth) then begin
// throw Exeption - TCP/IP not installed! You must install TCP/IP
support as first.
Exit;
end;
end;
Lst := TStringList.Create;
try
Lst.LoadFromFile(FilePth);
for i:=Lst.Count-1 downto 0 do
if LowerCase(ExtractWord(1,Lst.Strings[i],[' ',#9]))=gds_db then Exit;
Lst.Add(ServRow);
Lst.SaveToFile(FilePth);
finally
Lst.Free;
end;
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH, PChar(FilePth), nil);
SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH or SHCNF_FLUSH,
PChar(ExtractFilePath(FilePth)), nil);
end.
################ stopsrv.dpr #############################
{ for You from Michal MiP Prokopec (mip em algo-hk.cz) }
program StopSrv;
uses Windows, Messages, SysUtils;
var Wnd: HWND;
ProcId: DWORD;
hProcess: THandle;
begin
if LowerCase(ParamStr(1))<>'stop' then Exit;
Wnd := FindWindow(PChar('IB_Guard'), nil {PChar('InterBase Guardian')});
if Wnd<>0 then begin
GetWindowThreadProcessId(Wnd, @ProcId);
hProcess := OpenProcess(PROCESS_TERMINATE,false,ProcId);
PostMessage(Wnd, WM_QUIT, 0, 0);
// if not TerminateProcess(hProcess,0) then Err -> is not clean
WaitForSingleObject(hProcess, INFINITE);
end;
Wnd := FindWindow(PChar('IB_Server'), nil {PChar('InterBase Server')});
if Wnd<>0 then begin
GetWindowThreadProcessId(Wnd, @ProcId);
hProcess := OpenProcess(PROCESS_TERMINATE,false,ProcId);
PostMessage(Wnd, WM_QUIT, 0, 0);
// if not TerminateProcess(hProcess,0) then Err -> is not clean
WaitForSingleObject(hProcess, INFINITE);
end;
end.
Mais detalhes sobre a lista de discussão lista