InstallShield中注册SQL Anywhere 7.0 ODBC的完整脚本

function SetupRegistry()
STRING svDBprofile,svDB,szDriver,szDriver1,szSetup,svDBFile;
STRING svAccess,svAsa70;
STRING svMStranslator,svMStransdriver;
STRING szXbdagl,svStart,svAsa70app;
STRING szCommand, szCmdLine,svMsg;
begin
svMsg=”正在更新注册表……”;
SdShowMsg(svMsg,TRUE);
szXbdagl=”SOFTWARE\”+@COMPANY_NAME+”\”+@PRODUCT_NAME+”\”+@PRODUCT_VERSION;
//MessageBox(szXbdagl,INFORMATION);
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
//注册ASA70数据库
if (ComponentIsItemSelected(MEDIA,”asa70”) ) then
svAsa70app=”SOFTWARE\Sybase\Adaptive Server Anywhere\7.0”;
svDBprofile=”kykq”;
svDB=”SOFTWARE\ODBC\ODBC.INI\”+svDBprofile;
svDBFile = TARGETDIR+”\database\kykq.db”;//kykq.db的全名
szDriver = TARGETDIR+”\asa70\dbodbc7.dll”;
szDriver1=TARGETDIR+”\asa70\dbodtr7.dll”;
svAccess=”Adaptive Server Anywhere 7.0”;
svAsa70=”Adaptive Server Anywhere 7.0 Translator”;
svStart= TARGETDIR+”\asa70\dbeng7.exe -c 8m”;
RegDBSetDefaultRoot ( HKEY_CURRENT_USER );
RegDBSetKeyValueEx ( svDB , “AutoStop” , REGDB_STRING , “YES” , -1 );
RegDBSetKeyValueEx ( svDB , “DatabaseFile” , REGDB_STRING , svDBFile , -1 );
RegDBSetKeyValueEx ( svDB , “Debug” , REGDB_STRING , “NO” , -1 );
RegDBSetKeyValueEx ( svDB , “DisableMultiRowFetch” , REGDB_STRING , “NO” , -1 );
RegDBSetKeyValueEx ( svDB , “Driver” , REGDB_STRING , szDriver , -1 );
RegDBSetKeyValueEx ( svDB , “Integrated” , REGDB_STRING , “NO” , -1 );
RegDBSetKeyValueEx ( svDB , “PWD” , REGDB_STRING , “sql” , -1 );
RegDBSetKeyValueEx ( svDB , “UID” , REGDB_STRING , “dba” , -1 );
RegDBSetKeyValueEx ( svDB , “Start” , REGDB_STRING , svStart, -1 );

//注册ASA70 ODBC Driver
RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
RegDBSetKeyValueEx ( “SOFTWARE\ODBC\ODBCINST.INI\”+svAccess , “Driver” , REGDB_STRING , szDriver , -1 );//不用改
RegDBSetKeyValueEx ( “SOFTWARE\ODBC\ODBCINST.INI\”+svAccess , “Setup” , REGDB_STRING , szDriver , -1 );//不用改

RegDBSetKeyValueEx ( “SOFTWARE\ODBC\ODBCINST.INI\”+svAsa70 , “Driver” , REGDB_STRING , szDriver1 , -1 );//不用改
RegDBSetKeyValueEx ( “SOFTWARE\ODBC\ODBCINST.INI\”+svAsa70 , “Setup” , REGDB_STRING , szDriver1 , -1 );//不用改
RegDBSetKeyValueEx ( “SOFTWARE\ODBC\ODBCINST.INI\”+svAsa70 , “Translator” , REGDB_STRING , szDriver1 , -1 );//不用改

RegDBSetKeyValueEx ( “SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers” , svAccess , REGDB_STRING , “Installed” , -1 );//不用改
RegDBSetKeyValueEx ( “SOFTWARE\ODBC\ODBCINST.INI\ODBC Translators” , svAsa70 , REGDB_STRING , “Installed” , -1 );//不用改
//注册ASA7的应用,主要是设成中文版本
RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
RegDBSetKeyValueEx ( svAsa70app , “Language” , REGDB_STRING , “ZH” , -1 );
RegDBSetKeyValueEx ( svAsa70app , “Location” , REGDB_STRING , TARGETDIR+”\asa70” ,-1 );
RegDBSetKeyValueEx ( svAsa70app , “Shared Location” , REGDB_STRING ,TARGETDIR+”\asa70” , -1 );
endif;
SdShowMsg(svMsg,FALSE);
return 0;
end;

你可能感兴趣的:(odbc)