diff --git a/LicCliente.cpp b/LicCliente.cpp index 096d715..6244e00 100644 --- a/LicCliente.cpp +++ b/LicCliente.cpp @@ -13,12 +13,12 @@ LicCliente::~LicCliente(void) { } //********************************************************************************************************************* -bool LicCliente::cargaLicencia( LicClientEscucha* escucha, char* exePath ) +bool LicCliente::cargaLicencia( LicClientEscucha* escucha, char* exePath, char* nameProducto) { this->escucha = escucha; lic.clear(); pathf[0]=0; - if(!lic.fillLic(exePath)) + if(!lic.fillLic(exePath, nameProducto)) { escucha->muestaError("Error, no se puede inicializar licencia", lic.nombre_producto); return false; @@ -197,10 +197,10 @@ int LicCliente::getPermisos() return lic.permisos; } //********************************************************************************************************************* -bool LicCliente::creaLicPropietaria( char *key, int tipo, char *path ) +bool LicCliente::creaLicPropietaria( char *key, int tipo, char *path , char* nombreProducto) { lic.clear(); - lic.fillLic(path); + lic.fillLic(path, nombreProducto); strcpy(lic.clave, key); lic.tipo = tipo; diff --git a/LicCliente.h b/LicCliente.h index 5a3d740..0bca7f3 100644 --- a/LicCliente.h +++ b/LicCliente.h @@ -10,8 +10,8 @@ private: public: LicCliente(void); ~LicCliente(void); - bool cargaLicencia(LicClientEscucha* escucha, char* exePath= NULL); - bool creaLicPropietaria(char *key, int tipo, char *path); + bool cargaLicencia(LicClientEscucha* escucha, char* exePath= NULL, char * nameProducto= NULL); + bool creaLicPropietaria(char *key, int tipo, char *path, char* nombreProducto=NULL); bool isLicencia();//devuelve si tiene licencia o no int getPermisos();//devuelve permisos diff --git a/Licencia.cpp b/Licencia.cpp index 3b28aaa..b574c77 100644 --- a/Licencia.cpp +++ b/Licencia.cpp @@ -39,7 +39,7 @@ char* Licencia::getIdm( char *buf ) return Cutl::id_pc(buf,128); } //********************************************************************************************************************* -bool Licencia::fillLic( char* pathProducto /*= 0;*/ ) +bool Licencia::fillLic( char* pathProducto /*= 0;*/, char* nameProducto /*= 0;*/) { char path[256]; strcpy(LicServerUrl, LU_DEFAULT_SERVER); @@ -64,12 +64,16 @@ bool Licencia::fillLic( char* pathProducto /*= 0;*/ ) if(!Cdir_manager::getVersionFile(path,version_producto)) return false; char name[32]; + if(!Cdir_manager::nombre_archivo(path,name)) return false; char *ext =Cdir_manager::extension_archivo(name); if(ext) *(ext-1)=0; - strcpy(nombre_producto, name); + if (nameProducto) + strcpy(nombre_producto, nameProducto); + else + strcpy(nombre_producto, name); return true; } diff --git a/Licencia.h b/Licencia.h index e674cff..efb14ed 100644 --- a/Licencia.h +++ b/Licencia.h @@ -43,7 +43,7 @@ public: void* getLic( void *buf); Licencia* setLic( void *buf); - bool fillLic(char* pathProducto = 0); + bool fillLic(char* pathProducto = 0, char* nameProducto = 0); bool fillidmYuser(); private: char* getIdm(char *buf);//buffer de tamaņo 128 diff --git a/licUtiles.vcxproj b/licUtiles.vcxproj index dfb9096..5d3a2e3 100644 --- a/licUtiles.vcxproj +++ b/licUtiles.vcxproj @@ -22,32 +22,32 @@ {04E5B10E-5A75-48A2-857B-805659C7877D} licUtiles Win32Proj - 10.0.17763.0 + 10.0 DynamicLibrary - v141 + v142 Dynamic MultiByte true DynamicLibrary - v141 + v142 Dynamic MultiByte DynamicLibrary - v141 + v142 Dynamic MultiByte true DynamicLibrary - v141 + v142 Dynamic MultiByte