Cambios para independizar nombreProducto del nombre exe

master
Gerardo 2023-01-18 00:20:09 +01:00
parent ffca6c4588
commit c331e9003c
5 changed files with 18 additions and 14 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -22,32 +22,32 @@
<ProjectGuid>{04E5B10E-5A75-48A2-857B-805659C7877D}</ProjectGuid>
<RootNamespace>licUtiles</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>Dynamic</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>Dynamic</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>Dynamic</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>Dynamic</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>