InstallShield 安装程序判断用户是否已安装Microsoft SQL Server或MSDE!
2008-06-09 14:57
381 查看
这个例子是判断用户是否已安装Microsoft SQL Server或MSDE!如果没有安装则给出提示,提示用户必须要先安装并退出安装程序!
//---------------------------------------------------------------------------
// OnBegin
//
// The OnBegin event is called directly by the framework after the setup
// initializes.
//---------------------------------------------------------------------------
function OnBegin()
STRING szMsg;
STRING sKey, sValue, sData;
NUMBER nType, nSize;
NUMBER nResult;
begin
// TO DO: you may change default non-UI setting, for example
//
// You may also perform your custom initialization steps, check requirements, etc.
if !MAINTENANCE then
// 判断系统是否安装Microsoft SQL Server或MSDE
sKey = "Software\\Microsoft\\Microsoft SQL Server";
sValue = "InstalledInstances";
szMsg = "Micorsoft SQL Server or MSDE was not found on this machine. This installation was designed to run only on the server machine.";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
nResult = RegDBGetKeyValueEx ( sKey, sValue, nType, sData, nSize );
if ( nResult < 0 )then
// SQL Server registry key is missing
SetDialogTitle ( DLG_MSG_INFORMATION, "Information" );
MessageBox (szMsg,INFORMATION);
abort;
endif;
endif;
end;
//---------------------------------------------------------------------------
// OnBegin
//
// The OnBegin event is called directly by the framework after the setup
// initializes.
//---------------------------------------------------------------------------
function OnBegin()
STRING szMsg;
STRING sKey, sValue, sData;
NUMBER nType, nSize;
NUMBER nResult;
begin
// TO DO: you may change default non-UI setting, for example
//
// You may also perform your custom initialization steps, check requirements, etc.
if !MAINTENANCE then
// 判断系统是否安装Microsoft SQL Server或MSDE
sKey = "Software\\Microsoft\\Microsoft SQL Server";
sValue = "InstalledInstances";
szMsg = "Micorsoft SQL Server or MSDE was not found on this machine. This installation was designed to run only on the server machine.";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
nResult = RegDBGetKeyValueEx ( sKey, sValue, nType, sData, nSize );
if ( nResult < 0 )then
// SQL Server registry key is missing
SetDialogTitle ( DLG_MSG_INFORMATION, "Information" );
MessageBox (szMsg,INFORMATION);
abort;
endif;
endif;
end;
相关文章推荐
- 用Installshield 12 检测是否安装MS SQL Server或MSDE
- Microsoft SQL Server 2005 安装程序时 WMI配置错误
- 在windows7 64位旗舰版中安装SQL2005时遇到“无法找到产品Microsoft SQL Server Native Client的安装程序包”的问题
- Microsoft Dynamics CRM 2013 安装 报表服务出现“ SQL Server Reporting Services 帐户是本地用户且不受支持 ”错误的解决方法
- Installshield 在安装或者卸载过程中,判断某一程序是否正在运行
- 无法找到产品Microsoft SQL Server Native Client的安装程序包
- SQL SERVER 2005开发版 安装错误:无法找到产品Microsoft SQL Server Native Client的安装程序包,尝试再次使用的安装包 ' Sqlncli.msi ' 有效副本安装。
- 2-解决“无法找到产品Microsoft SQL Server 2005 向后兼容的安装程序包”
- java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver Eclipse3.1 数据库连接测试程序(SQL Server 2000 Driver for JDBC Service Pack 3 安装测试)
- 无法找到产品 microsoft sql server native client 的安装程序包
- InstallShield安装包制作笔记:判断安装时需要重写或者删除的程序是否打开并处理
- Microsoft SQL Server 2005 安装程序 错误解决
- 卸载Microsoft SQL Server 2008 R2 安装程序
- Microsoft SQL Server Native Client(sqlncli.msi)的安装程序包
- (win7)SQL SERVER 2005开发版 安装错误:无法找到产品Microsoft SQL Server Native Client的安装程序包,尝试再次使用的安装包 ' Sqlncli.ms
- 无法找到产品Microsoft SQL Server Native Client的安装程序包
- WIN8安装SQL SERVER2008:出现创建userSettings/Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings 的配置节处理程序时出错的解决办法。
- 无法找到产品 microsoft sql server native client 的安装程序包
- Microsoft SQL Server 2005 安装程序错误解疑
- 解决办法:无法找到产品Microsoft SQL Server Native Client的安装程序包