Como testar se o firebird esta instalado no inno setup.doc

2
Como testar se o firebird esta instalado no inno setup Crie um tarefa chamada installFB. Nesta tarefa use o parametro check e chame um método criado dentro da sessão CODE que verifica se o FB está instalado. No arquivo de instalação do FB use esta sua tarefa. Veja: Código: [Tasks] Name: installFB; Description: Instalar Firebird; Check: not FbExists [Files] Source: installFb.exe; DestDir: {app}; Flags: ignoreversion; Tasks: installFB [code] function FbExists(): Boolean; var DefaultInstance: String; begin if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Firebird Project\Firebird Server\ Instances','DefaultInstance', DefaultInstance) then begin //verifica se o arquivo do FB existe, normalmente //C:\Arquivos de programas\Firebird\bin\ fb_inet_server.exe Result := DirExists(DefaultInstance + '\bin\'); end else begin Result := false; end; end; [/code]

Transcript of Como testar se o firebird esta instalado no inno setup.doc

Page 1: Como testar se o firebird esta instalado no inno setup.doc

Como testar se o firebird esta instalado no inno setup

Crie um tarefa chamada installFB. Nesta tarefa use o parametro check e chame um método criado dentro da sessão CODE que verifica se o FB está instalado. No arquivo de instalação do FB use esta sua tarefa.

Veja:

Código:

[Tasks] Name: installFB; Description: Instalar Firebird; Check: not FbExists

[Files] Source: installFb.exe; DestDir: {app}; Flags: ignoreversion; Tasks: installFB

[code] function FbExists(): Boolean; var   DefaultInstance: String; begin   if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Firebird Project\Firebird Server\Instances','DefaultInstance', DefaultInstance) then   begin    //verifica se o arquivo do FB existe, normalmente    //C:\Arquivos de programas\Firebird\bin\fb_inet_server.exe    Result :=   DirExists(DefaultInstance + '\bin\');   end else   begin       Result := false;   end; end; [/code]

neste caso a rotina apenas verifica se a pasta bin existe.