Inno Setup - Verificando Se Existe Determinada Chave No Registro Do Windows

Post on 14-Apr-2016

13 views 0 download

description

Dicas Inno Setup

Transcript of Inno Setup - Verificando Se Existe Determinada Chave No Registro Do Windows

Inno Setup - Verificando se existe determinada Chave no Registro do Windows 

O Inno Setup é o instalador oficial do nosso site. Aqui trazemos mais uma dica deste fantástico gerador de instalações, onde demonstramos como verificar se uma determinada chave existe no registro do Windows:

[Setup]AppName=VerificaChaveAppVerName=VerificaChaveDefaultDirName={pf}\VerificaChaveDisableStartupPrompt=trueUninstallable=falseDisableDirPage=trueOutputBaseFilename=VerificaChave

[Code]function InitializeSetup(): Boolean;begin if RegKeyExists(HKEY_LOCAL_MACHINE, ‘SOFTWARE\Firebird Project\FirebirdServer’) then begin MsgBox(‘ Não posso instalar! ‘,mbInformation, MB_OK ); Result := false; End Else Result := true;end;

Isso é muito interessante, por exemplo, para verificar se uma determinada aplicação já existe no computador do cliente