2016-09-27 72 views
0

我寫Inno Setup的安裝程序,我想看看我的劇本,如果客戶有工具「SQLCMD.EXE」腳本或不。如何檢查SQLCMD.EXE如果是安裝在客戶機中Inno Setup的

我不知道該怎麼做,是否有任何腳本來檢查例如註冊表,並告訴客戶端它沒有安裝; msgBox'你想從微軟網站安裝嗎?'

我發現這可是不行的

if RegQueryStringValue(HKLM, 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn'. 
  • 我的SQL版本爲2014年5 & 微軟SQL Server Management Studio中12.0.2000.8

我在這裏找到:https://www.microsoft.com/en-us/download/details.aspx?id=36433

謝謝

+0

* 「不起作用」 *意味着什麼? –

回答

1

sqlcmd.exe路徑由SQL Server安裝程序放入搜索路徑(PATH)。 You yourself rely on this in your code

所以,僅僅搜索sqlcmd.exePATH

if FileSearch('sqlcmd.exe', GetEnv('PATH')) = '' then 
begin 
    if MsgBox('Install SQL server?', mbConfirmation, MB_YESNO) = IDYES then 
    begin 
    { Install here } 
    end; 
end; 
相關問題