QString getCADPath( QString locationKey ,pathType pat) { //#ifdef _WIN64 return GetCADPathByWinAPI(locationKey, pat); //#else //return GetCADPathByQt(locationKey, pat); //#endif }
static BOOL CopyCUIXandMNR( LPCTSTR cuixPath, LPCTSTR mnrPath ) { CString cadPath = GetCADPathByWinAPI( _T( "RoamableRootFolder" ), CURRENT_USER ); cadPath.Append( _T( "Support" ) ); //CString CADcuixPath = cadPath + _T("\\acad.CUIX"); CString CADcuixPath = cadPath + _T( "\\acad.CUIX" ); CString CADmnrPath = cadPath + _T( "\\acad.mnr" ); //获取当前程序(.exe)所在的路径 CString CurrentPath = GetWorkDir(); CString JLcuixPath = CurrentPath; //JLcuixPath.Append("\\Datas\\JL\\acad.CUIX"); JLcuixPath.Append( cuixPath ); CString JLmnrPath = CurrentPath + mnrPath; if( !CopyFile( JLcuixPath, CADcuixPath, false ) ) return FALSE; //if(!CopyFile(JLmnrPath,CADmnrPath,false)) return FALSE; return TRUE; }
CString CADHelper::GetCADPath() { CString cadPath = GetCADPathByWinAPI( _T( "AcadLocation" ), LOCAL_MACHINE ); cadPath.Append( _T( "\\acad.exe" ) ); return cadPath; }
BOOL CADHelper::IsAutoCADExist() { //CAD的安装目录 CString cadPath = GetCADPathByWinAPI( _T( "AcadLocation" ), LOCAL_MACHINE ); return cadPath.IsEmpty() ? FALSE : TRUE; }