#endif
sizeStrVec = mPackage_paths.size();
- for (iStrVec=0;iStrVec<sizeStrVec;iStrVec++){
+ for (iStrVec=0 ; iStrVec<sizeStrVec ; iStrVec++)
+ {
Utilities::replace( mPackage_paths[iStrVec] , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
- }
+ } // for iStrVec
GetHelp(2);
Utilities::replace( configXmlFullPathName , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
if ( Utilities::FileExists( configXmlFullPathName ))
- {
- bbtkMessage("config",1, "ConfigurationFile : [" << configXmlFullPathName <<
- "] found in current directory" << std::endl);
- //Read(configXmlFullPathName.c_str());
- // traiter le fichier local
- }
-
- // ==> Then we look for bbtk_config.xml in ".bbtk"
- else
- {
- configXmlFullPathName = Utilities::MakeUserSettingsFullFileName("bbtk_config.xml");
- if (!Utilities::FileExists( configXmlFullPathName ))
- {
- // ==> Nothing found, we create bbtk_config.xml in ".bbtk"
- InstallPath ();
- }
- }
+ {
+ bbtkMessage("config",1, "ConfigurationFile : [" << configXmlFullPathName <<
+ "] found in current directory" << std::endl);
+ //Read(configXmlFullPathName.c_str());
+ // traiter le fichier local
+ } else { // ==> Then we look for bbtk_config.xml in ".bbtk"
+ configXmlFullPathName = Utilities::MakeUserSettingsFullFileName("bbtk_config.xml");
+ if (!Utilities::FileExists( configXmlFullPathName ))
+ {
+ // ==> Nothing found, we create bbtk_config.xml in ".bbtk"
+ InstallPath ();
+ }
+ }
// In any case, deal with bbtk_config.xml!
Read(configXmlFullPathName.c_str());
//=========================================================================
void ConfigurationFile::InstallPath ()
{
-
/*--------------------------------------------------
New policy for bbtk_config.xml :
}
sprintf(copyFile,"copy %s\\bbtk_config.xml.tmp \"%s\"\\bbtk_config.xml ",bbtk_path,rootDirectory );
-
- int attribs = GetFileAttributes (rootDirectory);
+
+// EED 2021-12-12
+ WCHAR rootDirectory2[200];
+ MultiByteToWideChar( 0,0, rootDirectory, 200, rootDirectory2, 6);
+ LPCWSTR rootDirectory3 = rootDirectory2;
+ int attribs = GetFileAttributes (rootDirectory3);
+// int attribs = GetFileAttributes (rootDirectory);
+
+
bbtkMessage("config",1,std::hex << attribs << " " << FILE_ATTRIBUTE_DIRECTORY << std::endl);
if ( attribs != 0xFFFFFFFF)
{
if ((attribs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY ) /// \TODO : check !
{
- if ( GetFileAttributes( configPath ) == 0xFFFFFFFF)
+// EED 2021-12-12
+ WCHAR configPath2[200];
+ MultiByteToWideChar( 0,0, configPath, 200, configPath2, 6);
+ LPCWSTR configPath3 = configPath2;
+ if ( GetFileAttributes( configPath3 ) == 0xFFFFFFFF)
+// if ( GetFileAttributes( configPath ) == 0xFFFFFFFF)
{
system(copyFile);
}
char copyFile[250];
if (!Utilities::FileExists(configXmlTmp)) // bbtk_config.xml.tmp not found (not installed)
- {
- // if "bbtk_path/bbtk_config.xml.tmp" doesn't exist, hard-create a minimum version in .bbtk
- CreateConfigXML( rootDirectory );// create .bbtk
- }
- else
- {
- sprintf(copyFile,"cp %s %s/bbtk_config.xml ",configXmlTmp,rootDirectory );
- if (!Utilities::FileExists(configPath))
- {
- system(copyFile);
- }
- }
+ {
+ // if "bbtk_path/bbtk_config.xml.tmp" doesn't exist, hard-create a minimum version in .bbtk
+ CreateConfigXML( rootDirectory );// create .bbtk
+ } else {
+ sprintf(copyFile,"cp %s %s/bbtk_config.xml ",configXmlTmp,rootDirectory );
+ if (!Utilities::FileExists(configPath))
+ {
+ system(copyFile);
+ } // FileExists configPath
+ } // FileExists configXmlTmp
+
return;
// ------------------------------------------------------------------
XMLNode::parseFile((XMLCSTR)Get_config_xml_full_path().c_str(),
(XMLCSTR)"config",res);
- if ( res->error != eXMLErrorNone )
+ if ( res->error != eXMLErrorNone )
{
std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
delete res;
}
delete res;
+ std::string bbs_path;
#ifdef _WIN32
- std::string bbs_path = path + "/bbs";
+ bbs_path = path + "/bbs";
+ XMLNode BBSPATH = BB.addChild((XMLCSTR)"bbs_path");
+ BBSPATH.addText((XMLCSTR)bbs_path.c_str());
+ Utilities::replace(bbs_path, INVALID_FILE_SEPARATOR, VALID_FILE_SEPARATOR);
+ mBbs_paths.push_back(bbs_path);
#else
- std::string bbs_path = path + "/share/bbtk/bbs" ;
-#endif
+ bbs_path = path + "/share/bbtk/bbs" ;
XMLNode BBSPATH = BB.addChild((XMLCSTR)"bbs_path");
BBSPATH.addText((XMLCSTR)bbs_path.c_str());
Utilities::replace(bbs_path, INVALID_FILE_SEPARATOR, VALID_FILE_SEPARATOR);
mBbs_paths.push_back(bbs_path);
-#ifdef _WIN32
- std::string pack_path = path + "/bin";
-#else
- std::string pack_path = path ;
+ bbs_path = path + "/../../share/bbtk/bbs" ;
+ BBSPATH = BB.addChild((XMLCSTR)"bbs_path");
+ BBSPATH.addText((XMLCSTR)bbs_path.c_str());
+ Utilities::replace(bbs_path, INVALID_FILE_SEPARATOR, VALID_FILE_SEPARATOR);
+ mBbs_paths.push_back(bbs_path);
+
#endif
+
+ std::string pack_path;
+#ifdef _WIN32
+ pack_path = path;
XMLNode PACKPATH = BB.addChild((XMLCSTR)"package_path");
PACKPATH.addText((XMLCSTR)pack_path.c_str());
Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
mPackage_paths.push_back(pack_path);
-#ifdef _WIN32
- pack_path = path + "/RelWithDebInfo";
+ pack_path = path + "/bin";
PACKPATH = BB.addChild((XMLCSTR)"package_path");
PACKPATH.addText((XMLCSTR)pack_path.c_str());
Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
mPackage_paths.push_back(pack_path);
- pack_path = path + "/Debug";
- PACKPATH = BB.addChild((XMLCSTR)"package_path");
+
+// pack_path = path + "/RelWithDebInfo";
+// PACKPATH = BB.addChild((XMLCSTR)"package_path");
+// PACKPATH.addText((XMLCSTR)pack_path.c_str());
+// Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
+// mPackage_paths.push_back(pack_path);
+
+// pack_path = path + "/Debug";
+// PACKPATH = BB.addChild((XMLCSTR)"package_path");
+// PACKPATH.addText((XMLCSTR)pack_path.c_str());
+// Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
+// mPackage_paths.push_back(pack_path);
+
+// pack_path = path + "/Release";
+// PACKPATH = BB.addChild((XMLCSTR)"package_path");
+// PACKPATH.addText((XMLCSTR)pack_path.c_str());
+// Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
+// mPackage_paths.push_back(pack_path);
+#else
+ pack_path = path ;
+ XMLNode PACKPATH = BB.addChild((XMLCSTR)"package_path");
PACKPATH.addText((XMLCSTR)pack_path.c_str());
Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
mPackage_paths.push_back(pack_path);
- pack_path = path + "/Release";
+
+ #ifdef MACOSX
+ pack_path = path+"/../../lib/creatools" ;
+ #else
+ pack_path = path+"/../../lib64/creatools" ;
+ #endif
PACKPATH = BB.addChild((XMLCSTR)"package_path");
PACKPATH.addText((XMLCSTR)pack_path.c_str());
Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
mPackage_paths.push_back(pack_path);
+
#endif
+#ifdef _WIN32
+#endif
+
XMLError err = BB.writeToFile((XMLCSTR)Get_config_xml_full_path().c_str());
if ( err != eXMLErrorNone )
- {
- std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
- bbtkDebugMessage("config",1,mess<< std::endl);
- bbtkError(mess);
- }
-
+ {
+ std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
+ bbtkDebugMessage("config",1,mess<< std::endl);
+ bbtkError(mess);
+ } // if err
return true;
}
//=========================================================================