如何检查SQLCMD.EXE如果是安装在客户机中Inno Setup的
问题描述:
我写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
谢谢
答
sqlcmd.exe
路径由SQL Server安装程序放入搜索路径(PATH
)。 You yourself rely on this in your code。
所以,仅仅搜索sqlcmd.exe
在PATH
:
if FileSearch('sqlcmd.exe', GetEnv('PATH')) = '' then
begin
if MsgBox('Install SQL server?', mbConfirmation, MB_YESNO) = IDYES then
begin
{ Install here }
end;
end;
* “不起作用” *意味着什么? –