Setup Factry打包PB9.0+ASA8.0程序安装包
(1)注册odbc.ini信息
Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\mrgl2006");
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\mrgl2006", "DatabaseFile", SessionVar.Get("%AppFolder%").."\\test1\\DB\\mrgl2006.db", REG_SZ);
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\mrgl2006", "Start", SessionVar.Get("%AppFolder%").."\\test1\\ -Q", REG_SZ);
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\mrgl2006", "KeysInSQLStatistics", "1", REG_SZ);
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\mrgl2006", "PWD", "sql", REG_SZ);
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\mrgl2006", "UID", "dba", REG_SZ);
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\mrgl2006", "Driver", SessionVar.Get("%AppFolder%").."\\test1\\dbodbc8.dll", REG_SZ);
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\mrgl2006", "DatabaseName", "mrgl2006", REG_SZ);
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\mrgl2006", "EngineName", "mrgl2006", REG_SZ);
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\mrgl2006", "AutoStop", "YES", REG_SZ);
adaptive–(2)注册ODBCINST.INI信息
Registry.CreateKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 8.0");
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 8.0", "Driver", SessionVar.Get("%AppFolder%").."\\test1\\dbodbc8.dll", REG_SZ);
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 8.0", "Setup", SessionVar.Get("%AppFolder%").."\\test1\\dbodbc8.dll", REG_SZ);
–(3)注册ODBC Data Sources信息
Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\ODBC Data Sources");
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBC.INI\\ODBC Data Sources", "mrgl2006", "Adaptive Server Anywhere 8.0", REG_SZ);
–(4)注册App Paths信息
Registry.SetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\", "", SessionVar.Get("%AppFolder%").."\\test1\\", REG_SZ);
Registry.SetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\", "Path", SessionVar.Get("%AppFolder%").."\\test1", REG_SZ);
************************************************************************************************************************
下面是我在Installsheild中配置ODBC的代码(ASA70),你稍作修改即可使用。
function SetupRegistry()
NUMBER nResult;
begin
RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
if(RegDBKeyExist ( "Software\\ODBC ") < 0) then
RegDBCreateKeyEx ( "Software\\ODBC\\ " , " ");
RegDBCreateKeyEx ( "Software\\ODBC\\ODBC.INI " , " ");
RegDBCreateKeyEx ( "Software\\ODBC\\ODBCI
NST.INI " , " ");
RegDBCreateKeyEx ( "Software\\ODBC\\ODBCINST.INI\\ODBC Drivers " , " ");
RegDBCreateKeyEx ( "Software\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 7.0 " , " ");
endif;
//Adaptive Server Anywhere 7.0
if (RegDBKeyExist( "Software\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 7.0 ") < 0) then
RegDBCreateKeyEx ( "Software\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 7.0 " , " ");
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 7.0 " , "Driver " , REGDB_STRING ,TARGETDIR ^ "\\Asa70\\WIN32\\dbodbc7.dll ", -1); // TARGETDIR + "\dbodbc7.dll ", -1);
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 7.0 " , "Setup " , REGDB_STRING ,TARGETDIR ^ "\\Asa70\\WIN32\\dbodbc7.dll ", -1); //TARGETDIR + "\dbodbc7.dll ", -1);
endif;
//Adaptive Server Anywhere 7.0 Translator
if (RegDBKeyExist( "Software\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 7.0 Translator ") < 0) then
RegDBCreateKeyEx ( "Software\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 7.0 Translator " , " ");
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 7.0 Translator " , "Setup " , REGDB_STRING ,TARGETDIR ^ "\\Asa70\\WIN32\\dbodtr7.dll ", -1);
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBCINST.INI\\Adaptive Server Anywhere 7.0 Translator " , "Translator " , REGDB_STRING ,TARGETDIR ^ "\\Asa70\\WIN32\\dbodtr7.dll ", -1);
endif;
///////
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBCINST.INI\\ODBC Drivers " , "Adaptive Server Anywhere 7.0 " , REGDB_STRING , "Installed " , -1);
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBCINST.INI\\ODBC Translators " , "Adaptive Server Anywhere 7.0 Translator " , REGDB_STRING , "Installed " , -1);
RegDBSetDefaultRoot ( HKEY_CURRENT_USER );
if(RegDBKeyExist( "Software\\ODBC\\ODBC.INI\\TEST ") < 0) then
if(RegDBKeyExist( "Software\\ODBC\\ODBC.INI ") < 0) then
if(RegDBKeyExist( "Software\\ODBC ") < 0) then
RegDBCreateKeyEx ( "Software\\ODBC ", " ");
endif;
RegDBCreateKeyEx ( "Software\\ODBC\\ODBC.INI ", " ");
endif;
RegDBCreateKeyEx ( "Software\\ODBC\\ODBC.INI\\TEST ", " ");
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBC.INI\\TEST ", "AutoStop " , REGDB_STRING , "YES " , -1); //AutoStop
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBC.INI\\TEST ", "Driver " , REGDB_STRING ,TARGETDIR ^ "\\Asa70\\WIN32\\dbodbc7.dll " , -1); //Driver
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBC.INI\\TEST
", "Integrated " , REGDB_STRING , "NO " , -1); //Integrated
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBC.INI\\TEST ", "PWD " , REGDB_STRING , "sql " , -1); //PWD
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBC.INI\\TEST ", "UID " , REGDB_STRING , "dba " , -1); //UID
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBC.INI\\TEST ", "Start " , REGDB_STRING , TARGETDIR ^ "\\Asa70\\WIN32\\ -c 16m " , -1);
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBC.INI\\TEST ", "DatabaseFile " , REGDB_STRING , TARGETDIR ^ "\\DataBase\\TEST.db " , -1);
//RegDBSetKeyValueEx ( "Software\\ODBC\\ODBC.INI\\TEST ", "Start " ,REGDB_STRING ,TARGETDIR ^ "Asa70\\win32\\ -c 16m " , -1);//Start
//else
// RegDBDeleteKey ( "Software\\ODBC\\ODBC.INI\\TEST ");
// RegDBCreateKeyEx ( "Software\\ODBC\\ODBC.INI\\TEST ", " ");
endif;
if(RegDBKeyExist( "Software\\ODBC\\ODBC.INI\\ODBC Data Sources ") < 0) then
RegDBCreateKeyEx ( "Software\\ODBC\\ODBC.INI\\ODBC Data Sources ", " ");
endif;
RegDBSetKeyValueEx ( "Software\\ODBC\\ODBC.INI\\ODBC Data Sources ", "TEST " , REGDB
_STRING , "Adaptive Server Anywhere 7.0 " , -1);
// TODO : Add all your registry entry keys here
// RegDBCreateKeyEx,
return 0;
//nResult=CreateRegistrySet( " ");
//return nResult;
end;
我用过PB90+ASA70,成功。
祝你好运!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论