Cambios para independizar nombreProducto del nombre exe
parent
ffca6c4588
commit
c331e9003c
|
|
@ -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;
|
this->escucha = escucha;
|
||||||
lic.clear();
|
lic.clear();
|
||||||
pathf[0]=0;
|
pathf[0]=0;
|
||||||
if(!lic.fillLic(exePath))
|
if(!lic.fillLic(exePath, nameProducto))
|
||||||
{
|
{
|
||||||
escucha->muestaError("Error, no se puede inicializar licencia", lic.nombre_producto);
|
escucha->muestaError("Error, no se puede inicializar licencia", lic.nombre_producto);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -197,10 +197,10 @@ int LicCliente::getPermisos()
|
||||||
return lic.permisos;
|
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.clear();
|
||||||
lic.fillLic(path);
|
lic.fillLic(path, nombreProducto);
|
||||||
|
|
||||||
strcpy(lic.clave, key);
|
strcpy(lic.clave, key);
|
||||||
lic.tipo = tipo;
|
lic.tipo = tipo;
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ private:
|
||||||
public:
|
public:
|
||||||
LicCliente(void);
|
LicCliente(void);
|
||||||
~LicCliente(void);
|
~LicCliente(void);
|
||||||
bool cargaLicencia(LicClientEscucha* escucha, char* exePath= NULL);
|
bool cargaLicencia(LicClientEscucha* escucha, char* exePath= NULL, char * nameProducto= NULL);
|
||||||
bool creaLicPropietaria(char *key, int tipo, char *path);
|
bool creaLicPropietaria(char *key, int tipo, char *path, char* nombreProducto=NULL);
|
||||||
bool isLicencia();//devuelve si tiene licencia o no
|
bool isLicencia();//devuelve si tiene licencia o no
|
||||||
int getPermisos();//devuelve permisos
|
int getPermisos();//devuelve permisos
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ char* Licencia::getIdm( char *buf )
|
||||||
return Cutl::id_pc(buf,128);
|
return Cutl::id_pc(buf,128);
|
||||||
}
|
}
|
||||||
//*********************************************************************************************************************
|
//*********************************************************************************************************************
|
||||||
bool Licencia::fillLic( char* pathProducto /*= 0;*/ )
|
bool Licencia::fillLic( char* pathProducto /*= 0;*/, char* nameProducto /*= 0;*/)
|
||||||
{
|
{
|
||||||
char path[256];
|
char path[256];
|
||||||
strcpy(LicServerUrl, LU_DEFAULT_SERVER);
|
strcpy(LicServerUrl, LU_DEFAULT_SERVER);
|
||||||
|
|
@ -64,12 +64,16 @@ bool Licencia::fillLic( char* pathProducto /*= 0;*/ )
|
||||||
if(!Cdir_manager::getVersionFile(path,version_producto))
|
if(!Cdir_manager::getVersionFile(path,version_producto))
|
||||||
return false;
|
return false;
|
||||||
char name[32];
|
char name[32];
|
||||||
|
|
||||||
if(!Cdir_manager::nombre_archivo(path,name))
|
if(!Cdir_manager::nombre_archivo(path,name))
|
||||||
return false;
|
return false;
|
||||||
char *ext =Cdir_manager::extension_archivo(name);
|
char *ext =Cdir_manager::extension_archivo(name);
|
||||||
if(ext)
|
if(ext)
|
||||||
*(ext-1)=0;
|
*(ext-1)=0;
|
||||||
strcpy(nombre_producto, name);
|
if (nameProducto)
|
||||||
|
strcpy(nombre_producto, nameProducto);
|
||||||
|
else
|
||||||
|
strcpy(nombre_producto, name);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public:
|
||||||
void* getLic( void *buf);
|
void* getLic( void *buf);
|
||||||
Licencia* setLic( void *buf);
|
Licencia* setLic( void *buf);
|
||||||
|
|
||||||
bool fillLic(char* pathProducto = 0);
|
bool fillLic(char* pathProducto = 0, char* nameProducto = 0);
|
||||||
bool fillidmYuser();
|
bool fillidmYuser();
|
||||||
private:
|
private:
|
||||||
char* getIdm(char *buf);//buffer de tamaño 128
|
char* getIdm(char *buf);//buffer de tamaño 128
|
||||||
|
|
|
||||||
|
|
@ -22,32 +22,32 @@
|
||||||
<ProjectGuid>{04E5B10E-5A75-48A2-857B-805659C7877D}</ProjectGuid>
|
<ProjectGuid>{04E5B10E-5A75-48A2-857B-805659C7877D}</ProjectGuid>
|
||||||
<RootNamespace>licUtiles</RootNamespace>
|
<RootNamespace>licUtiles</RootNamespace>
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<UseOfMfc>Dynamic</UseOfMfc>
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<UseOfMfc>Dynamic</UseOfMfc>
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<UseOfMfc>Dynamic</UseOfMfc>
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<UseOfMfc>Dynamic</UseOfMfc>
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue