Browse Source

Z991239-5719 #comment 移除废弃的安装相关的框架接口

80374374 1 year ago
parent
commit
ec5b14c3e3

+ 9 - 22
Framework/Common/SpBase.h

@@ -477,19 +477,20 @@ struct linkContext
 struct CSystemStaticInfo : public CInstallInfo
 {
 	CSystemStaticInfo() :
-		strTerminalID(""),
-		strMachineType(""),
+		strTerminalID(true),
+		strMachineType(true),
 		eScreen(ScreenEnum::Screen_Operation),  // 设置一个默认值
 		nTotalRunCount(0),  // 初始化为 0 或其他适当的默认值
 		nTodayRunCount(0),  // 初始化为 0 或其他适当的默认值
 		tmCreateDate(),     // 使用默认构造函数初始化 SmallDateTime
 		tmCurrentTime(),    // 使用默认构造函数初始化 SmallDateTime
-		strSite(""),
+		strSite(true),
 		EnrolGPS(),
-		strEnrolAddr(""),
-		strManufacturer(""),
-		strMachineModel(""),
-		strMachineSN("")
+		strEnrolAddr(true),
+		strManufacturer(true),
+		strMachineModel(true),
+		strMachineSN(true),
+		CurrDepVersion(true)
 	{
 		// 在构造函数中进行额外的初始化工作,如果需要的话
 	}
@@ -509,6 +510,7 @@ struct CSystemStaticInfo : public CInstallInfo
 	CSimpleStringA strManufacturer;
     CSimpleStringA strMachineModel;
     CSimpleStringA strMachineSN;
+	CSimpleStringA CurrDepVersion;
 };
 
 /** map to spshell launch options.*/
@@ -1110,21 +1112,6 @@ struct IEntityFunctionPrivilege
 	/** hide blue screen */
 	virtual ErrorCodeEnum UndisplayBlueScreen() = 0;
 
-	virtual ErrorCodeEnum RollBackToHistoryVersion(CVersion HistoryVersion) = 0;
-
-	/** Set startup shell to new version shell,next restart will run in new version path
-	if bToSysInstall=true the SpShell.exe will not startup first,waiting Guardian.exe running install over,and started up by Guardian.exe*/
-	virtual ErrorCodeEnum UpgradeToNewVersion(bool bToSysInstall) = 0;
-
-	/**If the update or rollback version succeed run, info the framework this version is ok*/
-	virtual ErrorCodeEnum SetRunSucceed() = 0;
-
-	/** os pack upgrade, run.ini has ToRun define */
-	virtual ErrorCodeEnum BeginSysPackInstall(const char* pszPackageName, CSimpleStringA& strErrMsg) = 0;
-
-	/**check if the syspack has been installed*/
-	virtual ErrorCodeEnum IsInstalledSysPack(const char* pszPackageName) = 0;
-
 	/** show system running output console, including all  entity's syslog */
 	virtual ErrorCodeEnum ShowOuputConsole() = 0;
 

+ 4 - 0
Framework/spbase/SpEntity.cpp

@@ -1251,6 +1251,7 @@ ErrorCodeEnum SpEntity::GetSystemStaticInfo(CSystemStaticInfo &Info)
 {
 	sp_env_t *env = sp_get_env();
 	sp_cfg_t *cfg = env->cfg;
+	sp_dir_t* dir = env->dir;
 	sp_cfg_root_ini_t *root_ini = cfg->root_ini;
 	sp_cfg_install_ini_t *install_ini = cfg->install_ini;
 	int i;
@@ -1293,6 +1294,9 @@ ErrorCodeEnum SpEntity::GetSystemStaticInfo(CSystemStaticInfo &Info)
 		Info.InstallPack = CSimpleStringA(version_info->install_pack);
 		Info.InstallState = (InstallStateEnum)version_info->install_state;
 	}
+	if (dir->dep_ver_path != NULL) {
+		Info.CurrDepVersion = CSimpleStringA(strrchr(dir->dep_ver_path, SPLIT_SLASH) + 1);
+	}
 	return Error_Succeed;
 }
 

+ 0 - 22
Framework/spbase/SpEntityNoPrivilege.h

@@ -90,28 +90,6 @@ public:
     {
         return Error_NoPrivilege;
     }
-
-    virtual ErrorCodeEnum RollBackToHistoryVersion(CVersion historyVersion)
-    {
-        return Error_NoPrivilege;
-    }
-    virtual ErrorCodeEnum UpgradeToNewVersion(bool bToSysInstall)
-    {
-        return Error_NoPrivilege;
-    }
-    virtual ErrorCodeEnum SetRunSucceed()
-    {
-        return Error_NoPrivilege;
-    }
-    virtual ErrorCodeEnum BeginSysPackInstall(const char* pszPackageName, CSimpleStringA& strErrMsg)
-    {
-        return Error_NoPrivilege;
-    }
-    virtual ErrorCodeEnum IsInstalledSysPack(const char* pszPackageName)
-    {
-        return Error_NoPrivilege;
-    }
-
     virtual ErrorCodeEnum ShowOuputConsole()
     {
         return Error_NoPrivilege;

+ 0 - 332
Framework/spbase/SpEntityPrivilege.cpp

@@ -667,147 +667,6 @@ bool SpEntityPrivilege::GetSysUpgradeResult(const char *pszResultLog, ErrorCodeE
 	return true;
 }
 
-// 执行系统外升级
-ErrorCodeEnum SpEntityPrivilege::BeginSysPackInstall(const char *pszPackageName, CSimpleStringA &strErrMsg)
-{
-	// 创建安装包日志文件
-	strErrMsg = "";
-	WriteInstallLog(pszPackageName, CSimpleStringA::Format("begin install os pack: [%s]", pszPackageName));
-
-	CSimpleStringA strDownloadsPath;
-	auto rc = GetPath("Downloads", strDownloadsPath);
-	TOOLKIT_ASSERT(rc == Error_Succeed);
-
-	CSimpleStringA strUnzipPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strDownloadsPath, (const char*)pszPackageName);
-	if (strUnzipPath.IsEndWith(".zip") || strUnzipPath.IsEndWith(".cab"))
-		strUnzipPath = strUnzipPath.SubString(0, strUnzipPath.GetLength() - 4);
-
-	auto strConfigPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "Run.ini", (const char*)strUnzipPath);
-
-	// 检查文件是否存在
-	DWORD attr = GetFileAttributesA(strConfigPath);
-	TOOLKIT_ASSERT((attr != INVALID_FILE_ATTRIBUTES) && !(attr & FILE_ATTRIBUTE_DIRECTORY));
-
-	// ToRun=install.bat
-	char *p = inifile_read_str(strConfigPath, "Action", "ToRun", "");
-	CSimpleStringA strToRun = p;
-	FREE(p);
-
-	//TOOLKIT_ASSERT(!strToCopy.IsNullOrEmpty());
-	if (strToRun.IsNullOrEmpty())
-	{
-		strErrMsg = "未定义执行文件[ToRun]";
-		LogError(Severity_Low, Error_Null, 0, "file to run not define");
-		return Error_Null;
-	}
-
-	ErrorCodeEnum eErrorCode = Error_Succeed;
-	auto list = strToRun.Split(',');
-	for (int i = 0; i < list.GetCount(); i++)
-	{
-		auto &file = list[i];
-
-		CSimpleStringA strSourcePath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strUnzipPath, (const char*)file);
-		if (ExistsFileA(strSourcePath))
-		{
-#ifdef _WIN32
-			// 如果是Wow64模式,需屏蔽System32重定向
-			PVOID pRedirectOldValue(NULL);
-			bool bIsWow64 = IsWow64Process();
-			if (bIsWow64)
-			{
-				if (!Wow64DisableWow64FsRedirection(&pRedirectOldValue))
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Wow64DisableWow64FsRedirection fail: %d", GetLastError());
-				else
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Wow64DisableWow64FsRedirection succ");
-			}
-#endif //_WIN32
-			
-			// xkm@20161114: 执行完成,从result.txt中读取安装结果
-			system(strSourcePath);
-
-			CSimpleStringA strResultLog = strUnzipPath + SPLIT_SLASH_STR "result.log";
-			if (!GetSysUpgradeResult(strResultLog, eErrorCode, strErrMsg))
-			{
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("get upgrade result from result.log fail, %s", (const char*)strErrMsg);
-				/** ?? [Gifur@202268]*/
-				eErrorCode = Error_Succeed;
-				strErrMsg = "";
-			}
-			
-#ifdef _WIN32
-			// 如果是Wow64模式,恢复System32重定向
-			if (bIsWow64)
-			{
-				if (!Wow64RevertWow64FsRedirection(pRedirectOldValue))
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Wow64RevertWow64FsRedirection fail: %d", GetLastError());
-				else
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Wow64RevertWow64FsRedirection succ");
-			}
-#endif //_WIN32
-
-			if (eErrorCode != Error_Succeed)
-			{
-				LogError(Severity_Low, Error_UpdateFailed, 0, CSimpleStringA::Format("run file [%s] error: %s(%d)", (const char*)file, (const char*)strErrMsg, eErrorCode));
-				WriteInstallLog(pszPackageName, CSimpleStringA::Format("run file [%s] error: %s(%d)", (const char*)file, (const char*)strErrMsg, eErrorCode));
-				return eErrorCode;
-			}
-		}
-		else
-		{
-			strErrMsg = "指定执行文件不存在";
-			LogError(Severity_Low, Error_NotExist, 0, CSimpleStringA::Format("file [%s] to run not exists", (const char*)strSourcePath));
-			WriteInstallLog(pszPackageName, CSimpleStringA::Format("file [%s] to run not exists", (const char*)strSourcePath));
-			return Error_NotExist;
-		}
-	}
-
-	WriteInstallLog(pszPackageName, "install sys pack succ");
-
-	// 登录到安装记录文件中
-	sp_env_t *env = sp_get_env();
-	auto cfg = env->cfg;
-
-	CSimpleStringA strPackName = pszPackageName;
-
-	char *pszSysPacks = inifile_read_str(cfg->install_ini_path, "Main", "SysPack", "");
-	CSimpleStringA strSysPacks = pszSysPacks;
-	FREE(pszSysPacks);
-
-	if (!strSysPacks.IsNullOrEmpty())
-		strSysPacks += ",";
-
-	strSysPacks += pszPackageName;
-	inifile_write_str(cfg->install_ini_path, "Main", "SysPack", strSysPacks);	
-	inifile_format_write(cfg->install_ini_path, strPackName, "InstalledDate", "0x%08X", y2k_time_now());
-	inifile_write_str(cfg->install_ini_path, strPackName, "PackState", "U");
-
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("install sys pack [%s] succ", (const char*)strPackName);
-	return Error_Succeed;
-}
-
-// 判断是否是已安装的系统外升级包
-ErrorCodeEnum SpEntityPrivilege::IsInstalledSysPack(const char *pszPackageName)
-{
-	// 登录到安装记录文件中
-	sp_env_t *env = sp_get_env();
-	auto cfg = env->cfg;
-
-	CSimpleStringA strPackName = pszPackageName;
-
-	// 查询系统外升级包
-	char *p = inifile_read_str(cfg->install_ini_path, "Main", "SysPack", "");
-	CSimpleStringA strSysPackList = p;
-	FREE(p);
-
-	if (!strSysPackList.IsNullOrEmpty() && (strSysPackList.IndexOf(strPackName)!= -1))
-	{
-		return Error_Succeed;
-	}
-
-	return Error_Unexpect;
-}
-
 // File*A.*
 bool SpEntityPrivilege::IsFileMatch(const char *pszFilter, const char *pszFileName)
 {
@@ -877,197 +736,6 @@ CSimpleStringA SpEntityPrivilege::GetFileDirectory(const char *pszFullPath)
 	return CSimpleStringA(pszFullPath, i);
 }
 
-ErrorCodeEnum SpEntityPrivilege::RollBackToHistoryVersion(CVersion historyVersion)
-{
-	auto env = sp_get_env();
-	auto cfg = env->cfg;
-
-	// 判断目标版本是否小于当前版本
-	auto &v = cfg->install_ini->install_version;
-	CVersion curVersion(v.major, v.minor, v.revision, v.build);
-	if (curVersion <= historyVersion)
-	{
-		LogError(Severity_Low, Error_Param, 0, CSimpleStringA::Format("history version [%s] >= current version [%s]", 
-			(const char*)historyVersion.ToString(), (const char*)curVersion.ToString()));
-		return Error_Param;
-	}
-
-	// 修改当前Install.ini配置
-	CInstallInfo info= {};
-	auto rc = GetInstallInfo(historyVersion, info);
-	if (rc != Error_Succeed)
-	{
-		LogError(Severity_Low, Error_NotExist, 0, CSimpleStringA::Format("history version [%s] to rollback not exist", (const char*)historyVersion.ToString()));
-		return Error_NotExist;
-	}
-
-	// 检查对应文件夹是否存在
-	CSimpleStringA strHisVersion = historyVersion.ToString();
-	CSimpleStringA strHisVerPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", env->dir->root_ver_path, (const char*)strHisVersion);
-	if (!ExistsDirA(strHisVerPath))
-	{
-		LogError(Severity_Low, Error_NotExist, 0, CSimpleStringA::Format("history version dir [%s] not exists", (const char*)strHisVerPath));
-		return Error_NotExist;
-	}
-
-	// 修改当前版本状态为倒回R
-	int nRet = inifile_write_str(cfg->install_ini_path, curVersion.ToString(), "InstallState", "R");
-
-	// 更新回退次数
-	auto nTotalRollbackCount = inifile_read_int(cfg->install_ini_path, curVersion.ToString(), "TotalRollbackCount", 0);
-	nTotalRollbackCount++;
-	nRet = inifile_write_int(cfg->install_ini_path, curVersion.ToString(), "TotalRollbackCount", nTotalRollbackCount);
-	if (-1 == nRet)
-	{
-		LogError(Severity_Low, Error_Unexpect, 0, "inifile_write_int TotalRollbackCount");
-	}
-	LOG_TRACE("inifile_write_int, nTotalRollbackCount[%d]", nTotalRollbackCount);
-
-	// 修改active.txt文件
-	CSimpleStringA strActiveFile = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "active.txt", env->dir->root_ver_path);
-	auto result = UpdateActiveTxt(strActiveFile, strHisVersion, true);
-	if (result == Error_Succeed) {
-		LOG_TRACE("set rollback to history version [%s] succeed", (const char*)strHisVersion);
-	}
-	return result;
-}
-
-ErrorCodeEnum SpEntityPrivilege::UpgradeToNewVersion(bool bToSysInstall)
-{
-	auto env = sp_get_env();
-	auto cfg = env->cfg;
-		
-	// 修改当前Install.ini配置
-	auto &v = cfg->install_ini->install_version;
-	CVersion curVersion(v.major, v.minor, v.revision, v.build);
-	int nRet = inifile_write_str(cfg->install_ini_path, curVersion.ToString(), "InstallState", "U");	 // 已升级
-
-	// 取到新版本
-	char *p = inifile_read_str(cfg->install_ini_path, "Main", "LatterInstallVersion", "");
-	CSimpleStringA strNewVer = p; 
-	FREE(p);
-	//TOOLKIT_ASSERT(!strNewVer.IsNullOrEmpty());
-	if (strNewVer.IsNullOrEmpty())
-	{
-		LogError(Severity_Low, Error_Unexpect, 0, "install.ini Main LatterInstallVersion is null");
-		return Error_Unexpect;
-	}
-	CSimpleStringA strNewVerPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", env->dir->root_ver_path, (const char*)strNewVer);
-		
-	// 修改新版本install.ini
-	auto strNewInstallIni = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "install.ini", (const char*)strNewVerPath);
-	TOOLKIT_ASSERT(ExistsFileA(strNewInstallIni));
-
-	// 取新版本安装包名称
-	p = inifile_read_str(strNewInstallIni, strNewVer, "InstallPack", "");
-	CSimpleStringA strPackName = p;
-	FREE(p);
-	TOOLKIT_ASSERT(!strPackName.IsNullOrEmpty());
-	WriteInstallLog(strPackName, "Upgrade to new version");
-
-	nRet &= inifile_write_str(strNewInstallIni, curVersion.ToString(), "InstallState", "U");			// 已升级
-	nRet &= inifile_write_str(strNewInstallIni, strNewVer, "InstallState", "S");			// 设置启动
-
-	BOOL bSetSucc = (nRet == 0);
-	// 修改active.txt配置
-	CSimpleStringA strActiveFile = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "active.txt", env->dir->root_ver_path);
-	if (bSetSucc && Error_Succeed == UpdateActiveTxt(strActiveFile, strNewVer, true)) {
-		bSetSucc = TRUE;
-	}
-	else {
-		bSetSucc = FALSE;
-	}
-
-	// 修改内存配置
-	if (bSetSucc)
-	{
-		sp_version_t newVersion = {};
-		sscanf((const char*)strNewVer, "%d.%d.%d.%d", &newVersion.major, &newVersion.minor, &newVersion.revision, &newVersion.build);
-		auto newVerInfo = sp_cfg_find_version_info(cfg, &newVersion);
-		if (newVerInfo != NULL)
-			newVerInfo->install_state = Install_SetToStart;
-
-		LOG_TRACE("set new version [%s] active", (const char*)strNewVer);
-		return Error_Succeed;
-	}
-	else
-	{
-		LogError(Severity_Low, Error_Unexpect, 0, "switch to new version fail");
-	}
-	return Error_Unexpect;
-}
-
-ErrorCodeEnum SpEntityPrivilege::SetRunSucceed()
-{
-	sp_env_t *env = sp_get_env();
-	auto cfg = env->cfg;
-	
-	// 修改内存状态
-	auto pVerInfo = sp_cfg_find_version_info(cfg, &cfg->install_ini->install_version);
-	pVerInfo->install_state = Install_Active;		// 安装成功 
-
-	// 设置后一版本状态为倒回
-	if (sp_version_is_valid(&cfg->install_ini->latter_install_version))
-	{
-		// 修改后一版本安装文件状态为倒回
-		auto &latterVer = cfg->install_ini->latter_install_version;
-		char tmp[MAX_PATH];
-		auto rc = sp_dir_get_path_version(env->dir, latterVer.major, latterVer.minor, latterVer.revision, latterVer.build, SP_DIR_INSTALL_INI,
-			NULL, tmp, MAX_PATH, detect_env_test_mode(env->cfg->args->test_mode));
-
-		if (rc != 0) 
-		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("get install.ini path failed!");
-			return (ErrorCodeEnum)rc;
-		}
-
-		if (ExistsFileA(tmp))		// 可能后续版本目录被删除
-		{
-			// 倒回状态
-			CVersion lVer(latterVer.major, latterVer.minor, latterVer.revision, latterVer.build);
-			inifile_write_str(tmp, (const char*)lVer.ToString(), "InstallState", "R");
-
-			// 修改内存状态
-			auto pLatterVerInfo = sp_cfg_find_version_info(cfg, &latterVer);
-			if (pLatterVerInfo != NULL)
-				pLatterVerInfo->install_state = Install_RollBack;
-
-			// 修改对应安装包日志
-			auto p = inifile_read_str(tmp, (const char*)lVer.ToString(), "InstallPack", "");
-			CSimpleStringA strPackName = p;
-			FREE(p);
-			TOOLKIT_ASSERT(!strPackName.IsNullOrEmpty());	
-
-			auto &curVer = cfg->install_ini->install_version;
-			WriteInstallLog(strPackName, CSimpleStringA::Format("Rollback to version: [%d.%d.%d.%d]", 
-				curVer.major, curVer.minor, curVer.revision, curVer.build));
-		}
-	}
-
-	// 设置当前版本安装状态为活动
-	char *pCurVersion = inifile_read_str(cfg->install_ini_path, "Main", "InstallVersion", "");
-	inifile_write_str(cfg->install_ini_path, pCurVersion, "InstallState", "A");
-	inifile_format_write(cfg->install_ini_path, pCurVersion, "SwitchOverDate", "0x%08X", y2k_time_now());
-	auto pPackName = inifile_read_str(cfg->install_ini_path, pCurVersion, "InstallPack", "");
-	CSimpleStringA strPackName = pPackName;
-	FREE(pCurVersion);
-	FREE(pPackName);
-	
-	// 修改安装包历史
-	if (!strPackName.IsNullOrEmpty())
-		WriteInstallLog(strPackName, "Set version state active");
-	
-	// 拷贝升级包到Upgraded目录
-	const char *pPackFile = pVerInfo->install_pack;
-	CSimpleStringA strDownloadPath, strUpgradedPath;
-	GetPath("Downloads", strDownloadPath);
-	GetPath("Upgraded", strUpgradedPath);
-	CSimpleStringA strSourcePath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strDownloadPath, pPackFile);
-	CSimpleStringA strDestPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strUpgradedPath, pPackFile);
-	CopyFileA(strSourcePath, strDestPath, FALSE);
-
-	return Error_Succeed;
-}
 ErrorCodeEnum SpEntityPrivilege::SetSysDebugLevel(const char *pszEntityName,DebugLevelEnum eDebugLevel,bool bPersist)
 {
 	sp_env_t *env = sp_get_env();

+ 0 - 5
Framework/spbase/SpEntityPrivilege.h

@@ -42,11 +42,6 @@ public:
 
 	// update related functions
 	virtual ErrorCodeEnum Reboot(RebootTriggerEnum eTriggerReason,RebootWayEnum eWay);
-	virtual ErrorCodeEnum RollBackToHistoryVersion(CVersion historyVersion);
-	virtual ErrorCodeEnum UpgradeToNewVersion(bool bToSysInstall);
-	virtual ErrorCodeEnum SetRunSucceed();
-	virtual ErrorCodeEnum BeginSysPackInstall(const char *pszPackageName, CSimpleStringA &strErrMsg);
-	virtual ErrorCodeEnum IsInstalledSysPack(const char *pszPackageName);
 
 	virtual ErrorCodeEnum ShowOuputConsole();
 	virtual ErrorCodeEnum CloseOuputConsole();

+ 2 - 61
Framework/spbase/sp_cfg.cpp

@@ -2409,6 +2409,7 @@ static int is_valid_version_dir(const char *path)
 	return FALSE;
 }
 
+/**直接从当前运行路径中拆分版本号*/
 static int generate_install_memory(sp_dir_t* dir, sp_cfg_install_ini_t* inst)
 {
 	if (dir == NULL || inst == NULL)
@@ -2447,67 +2448,6 @@ static int generate_install_memory(sp_dir_t* dir, sp_cfg_install_ini_t* inst)
 	return 0;
 }
 
-static int generate_install_ini(sp_dir_t *dir)
-{
-	char szIniPath[MAX_PATH] = {0};
-	sp_version_t active_version = {0};
-	int rc;
-	sp_version_t last_verion = {0};
-	int l = -1;
-	char *packs = NULL;
-
-	rc = sp_dir_get_path(dir, SP_DIR_INSTALL_INI, NULL, szIniPath, MAX_PATH);
-	TOOLKIT_ASSERT(rc == 0);
-	sscanf(strrchr(dir->base_path, SPLIT_SLASH) + 1, "%d.%d.%d.%d",
-		&active_version.major, &active_version.minor, &active_version.revision, &active_version.build);
-	{
-		char szVer[128];
-		char szNow[128];
-		y2k_time_t now;
-		sprintf(szVer, "%d.%d.%d.%d", active_version.major, active_version.minor, active_version.revision, active_version.build);
-		inifile_write_str(szIniPath, "Main", "InstallVersion", szVer);
-		now = y2k_time_now();
-		sprintf(szNow, "0x%08X", now);
-		inifile_write_str(szIniPath, "Main", "CreateDate", szNow);
-		inifile_write_str(szIniPath, "Main", "LatterInstallVersion", "");
-		packs = inifile_read_str(szIniPath, "Main", "LightPack", "");
-		inifile_write_str(szIniPath, "Main", "LightPack", "");
-		inifile_write_str(szIniPath, "Main", "TotalRunCount", "0");
-		inifile_write_str(szIniPath, "Main", "TodayRunCount", "0");
-		inifile_write_str(szIniPath, "Main", "CurrentTime", szNow);
-		
-		if (l != -1) 
-		{
-			char szPreVer[128];
-			sprintf(szPreVer, "%d.%d.%d.%d", last_verion.major, last_verion.minor, last_verion.revision, last_verion.build);
-			inifile_write_str(szIniPath, szVer, "PreviousInstallVersion", szPreVer);
-		}
-
-		inifile_write_str(szIniPath, szVer, "SwitchOverDate", szNow);
-		inifile_write_str(szIniPath, szVer, "InstallPack", "");
-		inifile_write_str(szIniPath, szVer, "InstallState", "A");
-	}
-
-	// 去掉所有历史版本中轻量安装记录
-	if (packs)
-	{
-		if (strlen(packs) >0)
-		{
-			char *p = NULL;
-			while((p = strrchr(packs, ',')) != NULL)
-			{
-				*p = 0;
-				WritePrivateProfileSectionA(p+1, NULL, szIniPath);
-			}
-
-			WritePrivateProfileSectionA(packs, NULL, szIniPath);
-		}
-
-		FREE(packs);
-	}
-	return 0;
-}
-
 int sp_cfg_create(sp_dir_t* dir, const sp_cfg_start_args_t* args, sp_cfg_t** p_cfg)
 {
 	sp_cfg_t *cfg;
@@ -2612,6 +2552,7 @@ int sp_cfg_create(sp_dir_t* dir, const sp_cfg_start_args_t* args, sp_cfg_t** p_c
 	}
 	else
 	{
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get install info from memory: %s", tmp);
 		rc = generate_install_memory(dir, cfg->install_ini);
 		if (rc != 0) {
 			DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("create cfg object failed!, %s", "generate install.ini failed!");