Compilacion inicial en 2017 partiendo de la version v2018

master
Gerardo 2020-04-06 13:01:34 +02:00
commit c068e62c85
36 changed files with 3290 additions and 0 deletions

12
.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
/Debug/*
/LicServer.ncb
/LicServer/Debug/*
/LicServer/Release/*
/LicServer/x64/Debug/*
/LicServer/x64/Release/*
/LicServer.suo
/x64/*
/LicServer/x64/Debug/*
/LicServer/x64/Debug/*
/LicServer/x64/Release/*
/x64/Debug/*

BIN
.vs/LicServer/v15/.suo Normal file

Binary file not shown.

Binary file not shown.

89
Backup/LicServer.sln Normal file
View File

@ -0,0 +1,89 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LicServer", "LicServer\LicServer.vcproj", "{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}"
ProjectSection(ProjectDependencies) = postProject
{04E5B10E-5A75-48A2-857B-805659C7877D} = {04E5B10E-5A75-48A2-857B-805659C7877D}
{AA58C828-7025-4A4C-868E-76B8902AF6BB} = {AA58C828-7025-4A4C-868E-76B8902AF6BB}
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70} = {149E3D49-90F8-44E6-A4F9-BDEE84F65A70}
{22EEEE5A-0A71-4655-B57F-5FB8E1692389} = {22EEEE5A-0A71-4655-B57F-5FB8E1692389}
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0} = {30C05365-2DFC-4AD4-905E-8A414AE0D0A0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "licUtiles", "..\licUtiles\licUtiles.vcproj", "{04E5B10E-5A75-48A2-857B-805659C7877D}"
ProjectSection(ProjectDependencies) = postProject
{AA58C828-7025-4A4C-868E-76B8902AF6BB} = {AA58C828-7025-4A4C-868E-76B8902AF6BB}
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0} = {30C05365-2DFC-4AD4-905E-8A414AE0D0A0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utiles", "..\Utiles\utiles.vcproj", "{AA58C828-7025-4A4C-868E-76B8902AF6BB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ClientLic", "..\ClientLic\ClientLic.vcproj", "{22EEEE5A-0A71-4655-B57F-5FB8E1692389}"
ProjectSection(ProjectDependencies) = postProject
{04E5B10E-5A75-48A2-857B-805659C7877D} = {04E5B10E-5A75-48A2-857B-805659C7877D}
{AA58C828-7025-4A4C-868E-76B8902AF6BB} = {AA58C828-7025-4A4C-868E-76B8902AF6BB}
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0} = {30C05365-2DFC-4AD4-905E-8A414AE0D0A0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileTransfer", "..\TransferSrv\FileTransfer\FileTransfer.vcproj", "{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}"
ProjectSection(ProjectDependencies) = postProject
{AA58C828-7025-4A4C-868E-76B8902AF6BB} = {AA58C828-7025-4A4C-868E-76B8902AF6BB}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TransferSrv", "..\TransferSrv\TransferSrv\TransferSrv.vcproj", "{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}"
ProjectSection(ProjectDependencies) = postProject
{AA58C828-7025-4A4C-868E-76B8902AF6BB} = {AA58C828-7025-4A4C-868E-76B8902AF6BB}
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70} = {149E3D49-90F8-44E6-A4F9-BDEE84F65A70}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Debug|Win32.ActiveCfg = Debug|Win32
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Debug|Win32.Build.0 = Debug|Win32
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Debug|x64.ActiveCfg = Debug|x64
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Release|Win32.ActiveCfg = Release|Win32
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Release|Win32.Build.0 = Release|Win32
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Release|x64.ActiveCfg = Release|x64
{04E5B10E-5A75-48A2-857B-805659C7877D}.Debug|Win32.ActiveCfg = Debug|Win32
{04E5B10E-5A75-48A2-857B-805659C7877D}.Debug|Win32.Build.0 = Debug|Win32
{04E5B10E-5A75-48A2-857B-805659C7877D}.Debug|x64.ActiveCfg = Debug|x64
{04E5B10E-5A75-48A2-857B-805659C7877D}.Release|Win32.ActiveCfg = Release|Win32
{04E5B10E-5A75-48A2-857B-805659C7877D}.Release|Win32.Build.0 = Release|Win32
{04E5B10E-5A75-48A2-857B-805659C7877D}.Release|x64.ActiveCfg = Release|x64
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Debug|Win32.ActiveCfg = Debug|Win32
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Debug|Win32.Build.0 = Debug|Win32
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Debug|x64.ActiveCfg = Debug|x64
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Debug|x64.Build.0 = Debug|x64
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Release|Win32.ActiveCfg = Release|Win32
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Release|Win32.Build.0 = Release|Win32
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Release|x64.ActiveCfg = Release|x64
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Release|x64.Build.0 = Release|x64
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Debug|Win32.ActiveCfg = Debug|Win32
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Debug|Win32.Build.0 = Debug|Win32
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Debug|x64.ActiveCfg = Debug|x64
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Release|Win32.ActiveCfg = Release|Win32
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Release|Win32.Build.0 = Release|Win32
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Release|x64.ActiveCfg = Release|x64
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Debug|Win32.ActiveCfg = Debug|Win32
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Debug|Win32.Build.0 = Debug|Win32
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Debug|x64.ActiveCfg = Debug|x64
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Release|Win32.ActiveCfg = Release|Win32
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Release|Win32.Build.0 = Release|Win32
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Release|x64.ActiveCfg = Release|x64
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Debug|Win32.ActiveCfg = Debug|Win32
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Debug|Win32.Build.0 = Debug|Win32
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Debug|x64.ActiveCfg = Debug|x64
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Release|Win32.ActiveCfg = Release|Win32
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Release|Win32.Build.0 = Release|Win32
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Release|x64.ActiveCfg = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

81
LicServer.sln Normal file
View File

@ -0,0 +1,81 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.329
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LicServer", "LicServer\LicServer.vcxproj", "{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "licUtiles", "..\licUtiles\licUtiles.vcxproj", "{04E5B10E-5A75-48A2-857B-805659C7877D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utiles", "..\Utiles\utiles.vcxproj", "{AA58C828-7025-4A4C-868E-76B8902AF6BB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ClientLic", "..\ClientLic\ClientLic.vcxproj", "{22EEEE5A-0A71-4655-B57F-5FB8E1692389}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileTransfer", "..\TransferSrv\FileTransfer\FileTransfer.vcxproj", "{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TransferSrv", "..\TransferSrv\TransferSrv\TransferSrv.vcxproj", "{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Debug|Win32.ActiveCfg = Debug|Win32
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Debug|Win32.Build.0 = Debug|Win32
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Debug|x64.ActiveCfg = Debug|x64
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Debug|x64.Build.0 = Debug|x64
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Release|Win32.ActiveCfg = Release|Win32
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Release|Win32.Build.0 = Release|Win32
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Release|x64.ActiveCfg = Release|x64
{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}.Release|x64.Build.0 = Release|x64
{04E5B10E-5A75-48A2-857B-805659C7877D}.Debug|Win32.ActiveCfg = Debug|Win32
{04E5B10E-5A75-48A2-857B-805659C7877D}.Debug|Win32.Build.0 = Debug|Win32
{04E5B10E-5A75-48A2-857B-805659C7877D}.Debug|x64.ActiveCfg = Debug|x64
{04E5B10E-5A75-48A2-857B-805659C7877D}.Debug|x64.Build.0 = Debug|x64
{04E5B10E-5A75-48A2-857B-805659C7877D}.Release|Win32.ActiveCfg = Release|Win32
{04E5B10E-5A75-48A2-857B-805659C7877D}.Release|Win32.Build.0 = Release|Win32
{04E5B10E-5A75-48A2-857B-805659C7877D}.Release|x64.ActiveCfg = Release|x64
{04E5B10E-5A75-48A2-857B-805659C7877D}.Release|x64.Build.0 = Release|x64
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Debug|Win32.ActiveCfg = Debug|Win32
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Debug|Win32.Build.0 = Debug|Win32
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Debug|x64.ActiveCfg = Debug|x64
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Debug|x64.Build.0 = Debug|x64
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Release|Win32.ActiveCfg = Release|Win32
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Release|Win32.Build.0 = Release|Win32
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Release|x64.ActiveCfg = Release|x64
{AA58C828-7025-4A4C-868E-76B8902AF6BB}.Release|x64.Build.0 = Release|x64
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Debug|Win32.ActiveCfg = Debug|Win32
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Debug|Win32.Build.0 = Debug|Win32
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Debug|x64.ActiveCfg = Debug|x64
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Debug|x64.Build.0 = Debug|x64
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Release|Win32.ActiveCfg = Release|Win32
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Release|Win32.Build.0 = Release|Win32
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Release|x64.ActiveCfg = Release|x64
{22EEEE5A-0A71-4655-B57F-5FB8E1692389}.Release|x64.Build.0 = Release|x64
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Debug|Win32.ActiveCfg = Debug|Win32
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Debug|Win32.Build.0 = Debug|Win32
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Debug|x64.ActiveCfg = Debug|x64
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Debug|x64.Build.0 = Debug|x64
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Release|Win32.ActiveCfg = Release|Win32
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Release|Win32.Build.0 = Release|Win32
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Release|x64.ActiveCfg = Release|x64
{149E3D49-90F8-44E6-A4F9-BDEE84F65A70}.Release|x64.Build.0 = Release|x64
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Debug|Win32.ActiveCfg = Debug|Win32
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Debug|Win32.Build.0 = Debug|Win32
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Debug|x64.ActiveCfg = Debug|x64
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Debug|x64.Build.0 = Debug|x64
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Release|Win32.ActiveCfg = Release|Win32
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Release|Win32.Build.0 = Release|Win32
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Release|x64.ActiveCfg = Release|x64
{30C05365-2DFC-4AD4-905E-8A414AE0D0A0}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CA61B304-F115-4AA3-A278-4C5ED9879F04}
EndGlobalSection
EndGlobal

54
LicServer/AppClasSrv.cpp Normal file
View File

@ -0,0 +1,54 @@
#include "StdAfx.h"
#include "AppClasSrv.h"
#include "_app.h"
AppClasSrv::AppClasSrv(void)
{
key[0]=0;
user[0]=0;
path[0]=0;
C_app::GetApp()->log.l_lisener=this;
strcpy(C_app::GetApp()->log.nombre,"LicServer");
}
AppClasSrv::~AppClasSrv(void)
{
}
void AppClasSrv::log_ext( __time64_t tiemp, char *modulo, char *fmt )
{
char tiem[32];
char str[1024];
strftime(tiem, 20, "%Y-%m-%d %H:%M:%S", localtime(&tiemp));
sprintf_s(str,1024, "%s %-12s %s\r\n",
(char *) LPCTSTR (tiem),
(char *) LPCTSTR (modulo),
(char *) LPCTSTR (fmt));
_tprintf(str);
}
//************************************************************************************
void AppClasSrv::runApp()
{
while(true)
Sleep(1000);
}
//************************************************************************************
bool AppClasSrv::getClave( char* clave, char* producto )
{
strcpy(clave, key);
return true;
}
//************************************************************************************
void AppClasSrv::muestaError( char* info, char* producto )
{
C_log::log("Mens_lic", info);
}
//************************************************************************************
bool AppClasSrv::descargaInstalador( Licencia *lic )
{
return true;
}
//************************************************************************************

23
LicServer/AppClasSrv.h Normal file
View File

@ -0,0 +1,23 @@
#pragma once
#include "_log.h"
class AppClasSrv: public C_escucha_log, public LicClientEscucha
{
public:
AppClasSrv(void);
~AppClasSrv(void);
char key[32];
char user[32];
char path[256];
virtual void log_ext( __time64_t tiemp, char *modulo, char *fmt );
void runApp();
virtual bool getClave(char* clave, char* producto );
virtual void muestaError( char* info, char* producto );
virtual bool descargaInstalador( Licencia *lic );
};

1591
LicServer/CppSQLite3.cpp Normal file

File diff suppressed because it is too large Load Diff

325
LicServer/CppSQLite3.h Normal file
View File

@ -0,0 +1,325 @@
#pragma once
////////////////////////////////////////////////////////////////////////////////
// CppSQLite3 - A C++ wrapper around the SQLite3 embedded database library.
//
// Copyright (c) 2004..2007 Rob Groves. All Rights Reserved. rob.groves@btinternet.com
//
// Permission to use, copy, modify, and distribute this software and its
// documentation for any purpose, without fee, and without a written
// agreement, is hereby granted, provided that the above copyright notice,
// this paragraph and the following two paragraphs appear in all copies,
// modifications, and distributions.
//
// IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,
// INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST
// PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
// EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF
// ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". THE AUTHOR HAS NO OBLIGATION
// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
//
// V3.0 03/08/2004 -Initial Version for sqlite3
//
// V3.1 16/09/2004 -Implemented getXXXXField using sqlite3 functions
// -Added CppSQLiteDB3::tableExists()
//
// V3.2 01/07/2005 -Fixed execScalar to handle a NULL result
// 12/07/2007 -Added CppSQLiteDB::IsAutoCommitOn()
// -Added int64 functions to CppSQLite3Query
// -Added Name based parameter binding to CppSQLite3Statement.
////////////////////////////////////////////////////////////////////////////////
#include <sqlite3.h>
#define CPPSQLITE_ERROR 1000
class CppSQLite3Exception
{
public:
CppSQLite3Exception(const int nErrCode,
char* szErrMess,
bool bDeleteMsg=true);
CppSQLite3Exception(const CppSQLite3Exception& e);
virtual ~CppSQLite3Exception();
const int errorCode() { return mnErrCode; }
const char* errorMessage() { return mpszErrMess; }
static const char* errorCodeAsString(int nErrCode);
private:
int mnErrCode;
char* mpszErrMess;
};
class CppSQLite3Buffer
{
public:
CppSQLite3Buffer();
~CppSQLite3Buffer();
const char* format(const char* szFormat, ...);
operator const char*() { return mpBuf; }
void clear();
private:
char* mpBuf;
};
class CppSQLite3Binary
{
public:
CppSQLite3Binary();
~CppSQLite3Binary();
void setBinary(const unsigned char* pBuf, int nLen);
void setEncoded(const unsigned char* pBuf);
const unsigned char* getEncoded();
const unsigned char* getBinary();
int getBinaryLength();
unsigned char* allocBuffer(int nLen);
void clear();
private:
unsigned char* mpBuf;
int mnBinaryLen;
int mnBufferLen;
int mnEncodedLen;
bool mbEncoded;
};
class CppSQLite3Query
{
public:
CppSQLite3Query();
CppSQLite3Query(const CppSQLite3Query& rQuery);
CppSQLite3Query(sqlite3* pDB,
sqlite3_stmt* pVM,
bool bEof,
bool bOwnVM=true);
CppSQLite3Query& operator=(const CppSQLite3Query& rQuery);
virtual ~CppSQLite3Query();
int numFields();
int fieldIndex(const char* szField);
const char* fieldName(int nCol);
const char* fieldDeclType(int nCol);
int fieldDataType(int nCol);
const char* fieldValue(int nField);
const char* fieldValue(const char* szField);
int getIntField(int nField, int nNullValue=0);
int getIntField(const char* szField, int nNullValue=0);
sqlite_int64 getInt64Field(int nField, sqlite_int64 nNullValue=0);
sqlite_int64 getInt64Field(const char* szField, sqlite_int64 nNullValue=0);
double getFloatField(int nField, double fNullValue=0.0);
double getFloatField(const char* szField, double fNullValue=0.0);
const char* getStringField(int nField, const char* szNullValue="");
const char* getStringField(const char* szField, const char* szNullValue="");
const unsigned char* getBlobField(int nField, int& nLen);
const unsigned char* getBlobField(const char* szField, int& nLen);
bool fieldIsNull(int nField);
bool fieldIsNull(const char* szField);
bool eof();
void nextRow();
void finalize();
private:
void checkVM();
sqlite3* mpDB;
sqlite3_stmt* mpVM;
bool mbEof;
int mnCols;
bool mbOwnVM;
};
class CppSQLite3Table
{
public:
CppSQLite3Table();
CppSQLite3Table(const CppSQLite3Table& rTable);
CppSQLite3Table(char** paszResults, int nRows, int nCols);
virtual ~CppSQLite3Table();
CppSQLite3Table& operator=(const CppSQLite3Table& rTable);
int numFields();
int numRows();
const char* fieldName(int nCol);
const char* fieldValue(int nField);
const char* fieldValue(const char* szField);
int getIntField(int nField, int nNullValue=0);
int getIntField(const char* szField, int nNullValue=0);
double getFloatField(int nField, double fNullValue=0.0);
double getFloatField(const char* szField, double fNullValue=0.0);
const char* getStringField(int nField, const char* szNullValue="");
const char* getStringField(const char* szField, const char* szNullValue="");
bool fieldIsNull(int nField);
bool fieldIsNull(const char* szField);
void setRow(int nRow);
void finalize();
private:
void checkResults();
int mnCols;
int mnRows;
int mnCurrentRow;
char** mpaszResults;
};
class CppSQLite3Statement
{
public:
CppSQLite3Statement();
CppSQLite3Statement(const CppSQLite3Statement& rStatement);
CppSQLite3Statement(sqlite3* pDB, sqlite3_stmt* pVM);
virtual ~CppSQLite3Statement();
CppSQLite3Statement& operator=(const CppSQLite3Statement& rStatement);
int execDML();
CppSQLite3Query execQuery();
void bind(int nParam, const char* szValue);
void bind(int nParam, const int nValue);
void bind(int nParam, const double dwValue);
void bind(int nParam, const unsigned char* blobValue, int nLen);
void bindNull(int nParam);
int bindParameterIndex(const char* szParam);
void bind(const char* szParam, const char* szValue);
void bind(const char* szParam, const int nValue);
void bind(const char* szParam, const double dwValue);
void bind(const char* szParam, const unsigned char* blobValue, int nLen);
void bindNull(const char* szParam);
void reset();
void finalize();
private:
void checkDB();
void checkVM();
sqlite3* mpDB;
sqlite3_stmt* mpVM;
};
class CppSQLite3DB
{
public:
CppSQLite3DB();
virtual ~CppSQLite3DB();
void open(const char* szFile);
void close();
bool tableExists(const char* szTable);
int execDML(const char* szSQL);
CppSQLite3Query execQuery(const char* szSQL);
int execScalar(const char* szSQL, int nNullValue=0);
CppSQLite3Table getTable(const char* szSQL);
CppSQLite3Statement compileStatement(const char* szSQL);
sqlite_int64 lastRowId();
void interrupt() { sqlite3_interrupt(mpDB); }
void setBusyTimeout(int nMillisecs);
static const char* SQLiteVersion() { return SQLITE_VERSION; }
static const char* SQLiteHeaderVersion() { return SQLITE_VERSION; }
static const char* SQLiteLibraryVersion() { return sqlite3_libversion(); }
static int SQLiteLibraryVersionNumber() { return sqlite3_libversion_number(); }
bool IsAutoCommitOn();
private:
CppSQLite3DB(const CppSQLite3DB& db);
CppSQLite3DB& operator=(const CppSQLite3DB& db);
sqlite3_stmt* compile(const char* szSQL);
void checkDB();
sqlite3* mpDB;
int mnBusyTimeoutMs;
};

View File

@ -0,0 +1,367 @@
#include "StdAfx.h"
#include "DbLicServerFiller.h"
#define MODULO "DbLicServerFiller"
#include "_log.h"
#include "Licencia.h"
#include "CppSQLite3.h"
#define PATH_DB_LS "serverversionmanager.db"
#include <shlwapi.h>
#include <atltime.h>
DbLicServerFiller *DbLicServerFiller::_instance=NULL;
DbLicServerFiller::DbLicServerFiller(void)
{
}
DbLicServerFiller::~DbLicServerFiller(void)
{
}
DbLicServerFiller* DbLicServerFiller::Get()
{
if(!_instance)
{
_instance = new DbLicServerFiller();
if(!_instance->init())
C_log::log(MODULO, "Error al inicializar db");
}
return _instance;
}
__int64 strToint64(const char* str)
{
char st[32];
int j =0;
int state =0;//0 año, 1 mes 2 dia, 3 hora, 4 min, 5 seg
int a=0,m=0,d=0,h =0,min=0,s=0, aux;
for(int i =0; str[i]!=0 && state<6; i++)
{
if(str[i]== ':'|| str[i]== '-' || str[i]== ' ')
{
st[j]=0;
j=0;
aux = atoi(st);
switch(state)
{
case(0):
a =aux;
break;
case(1):
m =aux;
break;
case(2):
d =aux;
break;
case(3):
h =aux;
break;
case(4):
min =aux;
break;
case(5):
s =aux;
break;
}
state++;
continue;
}
st[j++]=str[i];
}
CTime t = CTime(a,m,d,h,m,s);
return t.GetTime();
}
bool DbLicServerFiller::fill( Licencia* lic )
{
if(!db)
return FALSE;
std::string sql_select,caducidad;
bool res = false;
if(getProducId(lic)<0)
return false;
char s[32];
sprintf(s,"%ld", lic->idProducto);
sql_select = "SELECT * from licencias WHERE clave = \""+std::string(lic->clave)+"\" AND id_producto = "+std::string(s);
CppSQLite3Query q = db->execQuery(sql_select.c_str());
while (!q.eof() && !res)
{
lic->tipo = q.getIntField("tipo", 0);
lic->instaId = q.getIntField("id_instalador", -1);
lic->max_user = q.getIntField("user_max", 0);
caducidad = q.getStringField("caducidad", "");
lic->permisos = q.getIntField("permisos", 0);
lic->renovacion = q.getIntField("renovacion", 0);
lic->id = q.getIntField("id", -1);
res =true;
q.nextRow();
}
q.finalize();
if(!res)
return res;
lic->caducidad = strToint64(caducidad.c_str());
return res;
}
int DbLicServerFiller::getProducId( Licencia* lic )
{
lic->idProducto = -1;
if(!db)
return lic->idProducto;
std::string sql_select,caducidad;
sql_select = "SELECT id from productos WHERE nombre = \""+std::string(lic->nombre_producto)+"\"";
CppSQLite3Query q = db->execQuery(sql_select.c_str());
while (!q.eof() && lic->idProducto<0)
{
lic->idProducto = q.getIntField("id", -1);
q.nextRow();
}
q.finalize();
return lic->idProducto;
}
bool DbLicServerFiller::init()
{
if (!PathFileExists(PATH_DB_LS))
{
C_log::log(MODULO, "Error no se encuentra archivo db: %s",PATH_DB_LS );
return false;
}
try
{
db = new CppSQLite3DB();
db->open(PATH_DB_LS);
}
catch (CppSQLite3Exception ex)
{
C_log::log(MODULO, "Error al arbrir db: %s",PATH_DB_LS );
return false;
}
return true;
}
int DbLicServerFiller::licCount( Licencia* lic )
{
if(!db || lic->id<0)
return -1;
std::string sql_select,caducidad;
//pilla usuario
int res = -1;
int idusu = -1;
CppSQLite3Query q;
idusu =GetUsu(lic);
if(idusu<0)
return res;
res =0;
char ss[64];
sprintf(ss,"%ld",lic->id);
sql_select = "SELECT id_usu FROM acceso WHERE id_licencia = "+std::string(ss);
q = db->execQuery(sql_select.c_str());
while (!q.eof())
{
res++;
if(idusu>=0 && idusu == q.getIntField("id_usu", -1))
{
res =0;
q.finalize();
return res;
}
}
q.finalize();
return res;
}
int DbLicServerFiller::GetUsu( Licencia* lic )
{
if(!db)
return -1;
std::string sql_select,caducidad;
//pilla usuario
sql_select = "SELECT * from usuarios WHERE idm = \""+std::string(lic->idm)+"\"";
int idusu = -1;
CppSQLite3Query q = db->execQuery(sql_select.c_str());
while (!q.eof() && idusu<0)
{
idusu= q.getIntField("id", -1);
break;
}
q.finalize();
if(idusu<0)
idusu =SetUsu(lic );
return idusu;
}
int DbLicServerFiller::SetUsu( Licencia* lic )
{
if(!db || lic->instaId<=0)
return FALSE;
char ss[64];
sprintf(ss,"%ld",lic->idCliente);
std::string sql_select,caducidad;
sql_select = "INSERT INTO usuarios (nombre, idm) "+
std::string("VALUES (\"") +
std::string(lic->nombre_user)+"\", \""+
std::string(lic->idm)+"\");";
bool res = false;
int id_usu = -1;
CppSQLite3Query q = db->execQuery(sql_select.c_str());
res = q.eof();
q.finalize();
if(!res)
return id_usu;
res = false;
sql_select = "SELECT id from usuarios WHERE idm = \""+std::string(lic->idm)+"\"";
q = db->execQuery(sql_select.c_str());
while (!q.eof() && !res)
{
id_usu = q.getIntField("id", -1);
res =true;
q.nextRow();
}
q.finalize();
return id_usu;
}
bool DbLicServerFiller::fillInstal( Licencia* lic )
{
if(!db || lic->instaId<=0)
return FALSE;
std::string sql_select,caducidad;
char ss[64];
sprintf(ss,"%ld",lic->instaId);
sql_select = "SELECT * from instaladores WHERE id = "+std::string(ss);
bool res = false;
CppSQLite3Query q = db->execQuery(sql_select.c_str());
while (!q.eof() && !res)
{
strcpy(lic->instaServer,q.getStringField("server", ""));
strcpy(lic->instaKey,q.getStringField("clave", ""));
strcpy(lic->instaUsu,q.getStringField("usuario", ""));
strcpy(lic->instaDescrip,q.getStringField("archivo_descripcion", ""));
strcpy(lic->instaPath,q.getStringField("archivo", ""));
strcpy(lic->instaVersion,q.getStringField("version", ""));
res =true;
q.nextRow();
}
q.finalize();
return res;
}
bool DbLicServerFiller::getConf( char *ip, int *port )
{
if(!db)
return FALSE;
std::string sql_select,fuelstate,str,sql_where;
sql_select = "SELECT * from configuracion_socket";
bool res = false;
CppSQLite3Query q = db->execQuery(sql_select.c_str());
while (!q.eof() || !res)
{
*port = q.getIntField("puerto", -1);
strcpy(ip, q.getStringField("ip", ""));
res =true;
q.nextRow();
}
q.finalize();
return res;
}
bool DbLicServerFiller::setAcceso( Licencia* lic, __int64 *ultAcc, __int64 *actualAcceso)
{
int idusua = GetUsu(lic);
if(!idusua)
return false;
//mira si existe
std::string sql_select;
char idusu[32];
char idlic[32];
char acces[32];
CTime tiempo = CTime::GetCurrentTime();
*actualAcceso=tiempo.GetTime();
sprintf(acces,"%ld-%02d-%02d %02d:%02d %02d",
tiempo.GetYear(), tiempo.GetMonth(), tiempo.GetDay(),
tiempo.GetHour(), tiempo.GetMinute(), tiempo.GetSecond());
sprintf(idusu, "%ld", idusua);
sprintf(idlic, "%ld", lic->id);
sql_select = "SELECT * from acceso WHERE id_licencia = "+std::string(idusu) +
std::string(" AND id_usu = ")+std::string(idlic);
bool res = false;
CppSQLite3Query q = db->execQuery(sql_select.c_str());
std::string ultimo_acceso;
while (!q.eof() && !res)
{
ultimo_acceso = q.getStringField("ultimo_acceso", "");
//falta pillar acceso y version si existe
res =true;
q.nextRow();
}
q.finalize();
if(res)
{
*ultAcc = strToint64(ultimo_acceso.c_str());
//update acceso
sql_select = "UPDATE acceso "+
std::string("SET ultimo_acceso = \"") + acces + std::string("\", version = \"")+
lic->version_producto+ std::string("\" ")+
"WHERE id_usu = "+std::string(idusu)+ " AND id_licencia = "+std::string(idlic)+";";
q = db->execQuery(sql_select.c_str());
res = q.eof();
q.finalize();
return res;
}
else
{
*ultAcc =0;
//insert
sql_select = "INSERT INTO acceso (id_usu, id_licencia, ultimo_acceso, version) "+
std::string("VALUES( ")+
std::string(idusu)+", "+
std::string(idlic)+", \""+
std::string(acces)+"\", \""+
std::string(lic->version_producto)+"\");";
q = db->execQuery(sql_select.c_str());
res = q.eof();
q.finalize();
return res;
}
return false;
}

View File

@ -0,0 +1,25 @@
#pragma once
class CppSQLite3DB;
class DbLicServerFiller: public DBLicProvider
{
CppSQLite3DB *db;
DbLicServerFiller(void);
static DbLicServerFiller* _instance;
bool init();
public:
~DbLicServerFiller(void);
virtual bool fill( Licencia* lic );//rellena datos licencia
virtual int licCount( Licencia* lic );//cuenta numero de licencias
virtual bool fillInstal( Licencia* lic );//rellena instalador
virtual bool setAcceso( Licencia* lic, __int64 *ultAcc, __int64 *actualAcceso);
virtual bool getConf( char *ip, int *port );//configuracion de escucha
static DbLicServerFiller* Get();
private:
int SetUsu( Licencia* lic );//devuelve el id de usuario
int GetUsu( Licencia* lic );//crea usuario nuevo y devuelve el id
int getProducId( Licencia* lic );
};

123
LicServer/LicServer.cpp Normal file
View File

@ -0,0 +1,123 @@
// LicServer.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "LicServer.h"
#include "DbLicServerFiller.h"
#include "_log.h"
#include "licencia.h"
#include "utl.h"
#include "StrArray.h"
#include "AppClasSrv.h"
#include "LicenciasManager.h"
#include "LicCliente.h"
#include "ClienteLicencias.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// The one and only application object
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
AppClasSrv app;
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = 1;
}
else
{
if(argc==1)
{
ClienteLicencias lic;
if(!lic.cargaLicencia())
C_log::log("Main", "Error al cargar licencia");
C_log::log("Main", "Final feliz");
system("pause");
}
else if(argc==2 && strstr("Server",argv[1]))
{
//modo servidor--------------
LicenciasManager licSrv;
if(licSrv.inicia(DbLicServerFiller::Get()))
{
C_log::log("Main", "Servidor activo");
app.runApp();
}
else
C_log::log("Main", "error iniciar servidor");
system("pause");
}
else if(argc>=2 && argc<=4 )
{
LicCliente cli;
int tipo =0;
for (int i =1; i<argc; i++)
{
if(app.key[0]==0)
{
strcpy(app.key,argv[i]);
continue;;
}
if(app.path[0]==0)
{
strcpy(app.path,argv[i]);
continue;;
}
if(tipo==0)
{
tipo = atoi(argv[i]);
continue;;
}
}
char *pp=NULL;
if(app.path[0]!=0)
pp = app.path;
if(tipo)
{
C_log::log("Main", "Generando licencia");
cli.creaLicPropietaria(app.key,tipo, pp);
}
else if(!cli.cargaLicencia(&app, pp))
C_log::log("Main", "Error al cargar licencia");
C_log::log("Main", "Final feliz");
system("pause");
//ModoCliente
// TODO: code your application's behavior here.
/*
Licencia lic;
strcpy(lic.clave, "1234pruebas");
if(!lic.fillLic())
C_log::log("Main", "error al rellenar la licencia");
if(!filler->fill(&lic))
C_log::log("Main", "error en acceder a bbdd");
if(!filler->fillInstal(&lic))
C_log::log("Main", "error en acceder a bbdd");
__int64 accesodb, accesoAct;
if(!filler->setAcceso(&lic, &accesodb, &accesoAct))
C_log::log("Main", "error en acceso a bbdd");
int nlic =filler->licCount(&lic);
C_log::log("Main", "error en acceso a bbdd");
lic.permisos = lic.permisos;*/
}
}
return nRetCode;
}

3
LicServer/LicServer.h Normal file
View File

@ -0,0 +1,3 @@
#pragma once
#include "resource.h"

125
LicServer/LicServer.rc Normal file
View File

@ -0,0 +1,125 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_APP_TITLE "LicServer"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Spanish resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESN)
#ifdef _WIN32
LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "0c0a04b0"
BEGIN
VALUE "CompanyName", "Narvaling"
VALUE "FileDescription", "Servidor del gestor de Licencias"
VALUE "FileVersion", "1.0.0.1"
VALUE "InternalName", "LicServer"
VALUE "LegalCopyright", "(c) Narvaling. All rights reserved."
VALUE "OriginalFilename", "LicServer.exe"
VALUE "ProductName", "LicServer"
VALUE "ProductVersion", "1.0.0.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0xc0a, 1200
END
END
#endif // Spanish resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

250
LicServer/LicServer.vcxproj Normal file
View File

@ -0,0 +1,250 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D22EED4D-CE8E-4310-9C3A-DC7DE0368623}</ProjectGuid>
<RootNamespace>LicServer</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<UseOfMfc>Dynamic</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<UseOfMfc>Dynamic</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<UseOfMfc>Dynamic</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<UseOfMfc>Dynamic</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>15.0.28127.55</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\licUtiles;..\..\sqlite3;..\..\utiles;..\..\ClientLic;..\..\TransferSrv\FileTransfer;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>LicUtiles.lib;sqlite3.lib;Utiles.lib;ClientLic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>copy $(OutDir)$(TargetFileName) ..\..\bin\$(IntDir)
copy ..\serverversionmanager.db ..\..\bin\$(IntDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\licUtiles;..\..\sqlite3;..\..\utiles;..\..\ClientLic;..\..\TransferSrv\FileTransfer;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>LicUtiles.lib;sqlite3.lib;Utiles.lib;ClientLic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib\x64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
<PostBuildEvent>
<Command>copy $(OutDir)$(TargetFileName) ..\..\bin\$(IntDir)
copy ..\serverversionmanager.db ..\..\bin\$(IntDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\licUtiles;..\..\sqlite3;..\..\utiles;..\..\ClientLic;..\..\TransferSrv\FileTransfer;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>LicUtiles.lib;sqlite3.lib;Utiles.lib;ClientLic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>copy $(OutDir)$(TargetFileName) ..\..\bin\$(IntDir)
copy ..\serverversionmanager.db ..\..\bin\$(IntDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\licUtiles;..\..\sqlite3;..\..\utiles;..\..\ClientLic;..\..\TransferSrv\FileTransfer;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>LicUtiles.lib;sqlite3.lib;Utiles.lib;ClientLic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib\x64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX64</TargetMachine>
</Link>
<PostBuildEvent>
<Command>copy $(OutDir)$(TargetFileName) ..\..\bin\$(IntDir)
copy ..\serverversionmanager.db ..\..\bin\$(IntDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="AppClasSrv.cpp" />
<ClCompile Include="CppSQLite3.cpp" />
<ClCompile Include="DbLicServerFiller.cpp" />
<ClCompile Include="LicServer.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AppClasSrv.h" />
<ClInclude Include="CppSQLite3.h" />
<ClInclude Include="DbLicServerFiller.h" />
<ClInclude Include="LicServer.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="LicServer.rc" />
</ItemGroup>
<ItemGroup>
<None Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ClientLic\ClientLic.vcxproj">
<Project>{22eeee5a-0a71-4655-b57f-5fb8e1692389}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\licUtiles\licUtiles.vcxproj">
<Project>{04e5b10e-5a75-48a2-857b-805659c7877d}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\TransferSrv\FileTransfer\FileTransfer.vcxproj">
<Project>{149e3d49-90f8-44e6-a4f9-bdee84f65a70}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\TransferSrv\TransferSrv\TransferSrv.vcxproj">
<Project>{30c05365-2dfc-4ad4-905e-8a414ae0d0a0}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\Utiles\utiles.vcxproj">
<Project>{aa58c828-7025-4a4c-868e-76b8902af6bb}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="AppClasSrv.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CppSQLite3.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DbLicServerFiller.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="LicServer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AppClasSrv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CppSQLite3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DbLicServerFiller.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="LicServer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="LicServer.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="ReadMe.txt" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

46
LicServer/ReadMe.txt Normal file
View File

@ -0,0 +1,46 @@
========================================================================
CONSOLE APPLICATION : LicServer Project Overview
========================================================================
AppWizard has created this LicServer application for you.
This file contains a summary of what you will find in each of the files that
make up your LicServer application.
LicServer.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
LicServer.cpp
This is the main application source file.
/////////////////////////////////////////////////////////////////////////////
AppWizard has created the following resources:
LicServer.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named LicServer.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

17
LicServer/Resource.h Normal file
View File

@ -0,0 +1,17 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by LicServer.rc
//
#define IDS_APP_TITLE 103
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

8
LicServer/stdafx.cpp Normal file
View File

@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// LicServer.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

33
LicServer/stdafx.h Normal file
View File

@ -0,0 +1,33 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
#include <afx.h>
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <iostream>
#include "LicUtilesDef.h"
#include "base_head.h"
// TODO: reference additional headers your program requires here

24
LicServer/targetver.h Normal file
View File

@ -0,0 +1,24 @@
#pragma once
// The following macros define the minimum required platform. The minimum required platform
// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Specifies that the minimum required platform is Windows Vista.
#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0.
#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE.
#endif

BIN
Release/FileTransfer.dll Normal file

Binary file not shown.

BIN
Release/FileTransfer.exp Normal file

Binary file not shown.

BIN
Release/FileTransfer.iobj Normal file

Binary file not shown.

BIN
Release/FileTransfer.ipdb Normal file

Binary file not shown.

BIN
Release/FileTransfer.lib Normal file

Binary file not shown.

BIN
Release/FileTransfer.pdb Normal file

Binary file not shown.

BIN
Release/TransferSrv.exe Normal file

Binary file not shown.

BIN
Release/TransferSrv.iobj Normal file

Binary file not shown.

BIN
Release/TransferSrv.ipdb Normal file

Binary file not shown.

BIN
Release/TransferSrv.pdb Normal file

Binary file not shown.

BIN
UpgradeLog.htm Normal file

Binary file not shown.

25
limpia.bat Normal file
View File

@ -0,0 +1,25 @@
@echo off
Echo Borra ncb.
del "%~dp0"\*.ncb
Echo Borra bak
del "%~dp0"\*.bak
Echo Borra aps
del "%~dp0"\*.aps
Echo Borra debug.
rmdir /s /q "%~dp0"\debug"
Echo Borra release.
rmdir /s /q "%~dp0"\release
rmdir /s /q "%~dp0"\x64"
rmdir /s /q "%~dp0"\LicServer\debug"
rmdir /s /q "%~dp0"\LicServer\release"
rmdir /s /q "%~dp0"\LicServer\x64"
pause

BIN
serverversionmanager.db Normal file

Binary file not shown.

BIN
serverversionmanager_.db Normal file

Binary file not shown.