0

I am trying to install Fox Pro Database drivers from below link using Inno setup script as part of my installation file. To do that I have to check if its already installed or not. If not installed,then the script of installing the db driver should run.

Can some one please help me how to check if Foxpro db driver is installed or not using innosetup script? I checked the Registry and there is no key related to this driver.

Installation Code:

if not ShellExec('', ExpandConstant('{app}\{#MyAppFoxProDbDriverName}'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode)
    then 
        begin
            MsgBox('Foxpro DB installer failed to run!' + #13#10 + SysErrorMessage(ResultCode), mbError, MB_OK);
            Result:= false;
        end
    else
        begin 
            Result:= true;
        end;
NSR
  • 51
  • 1
  • 5
  • So check for some FoxPro file. – Martin Prikryl Sep 19 '17 at 11:01
  • Martin, Can you please let me know where(path) should I check the FoxPro file? – NSR Sep 19 '17 at 11:48
  • I do not know anything about FoxPro. But surely it installs somewhere (to `C:\Program Files (x86)` probably). And there's for sure some significant file, like `foxpro.exe`. I.e. `C:\Program Files (x86)\FoxPro\foxpro.exe`. So check for that. – Martin Prikryl Sep 19 '17 at 11:54
  • 1
    What do you mean by 'FoxPro Database Driver' ? Do you mean the ODBC driver to allow connection to DBF files? The OLE DB driver? Or the Visual FoxPro runtimes to allow a compiled EXE to run? Please clarify. – Alan B Sep 20 '17 at 09:03
  • Alan B This is the provider(Microsoft OLE DB Provider for Visual FoxPro 9.0) I am explaining about in the ticket. https://www.microsoft.com/en-au/download/details.aspx?id=14839 – NSR Sep 20 '17 at 12:13
  • I wouldn't bother checking. It hasn't changed since 2008 and it won't going forward. Just reinstall over it. – Alan B Sep 20 '17 at 15:21
  • I agree, just reinstall over it. But if you did want to check you should look at: https://stackoverflow.com/questions/12951327/inno-setup-check-if-file-exist-in-destination-or-else-if-doesnt-abort-the-ins – Dhugalmac Sep 20 '17 at 20:50

0 Answers0