Exemplo n.º 1
0
/** 
 ** This routine will handle upgrade/modify installs only.
 ** This dialog will only be displayed if ingres is being modified or upgraded.
 */
BOOL
InstanceList::OnWizardFinish()
{
	char code[3];
	char ach[2048], ii_system[1024];
	int flag=0;
	BOOL bInstalled=FALSE;

	sprintf(code, "%s", m_iicode);
	thePreInstall.m_InstallCode=m_iicode;
	if(strlen(code)!=2 || !isalpha(code[0]) || !isalnum(code[1]))
	{
		Error(IDS_INVALIDINSTALLATIONCODE, code);
		return FALSE;
	}

	CInstallation *inst=NULL;
	for(int i=0; i<thePreInstall.m_Installations.GetSize(); i++)
	{
		inst=(CInstallation *) thePreInstall.m_Installations.GetAt(i);
		if (inst && !thePreInstall.m_InstallCode.CompareNoCase(inst->m_id))
		{
			bInstalled=TRUE;
			sprintf(ii_system, "%s", inst->m_path);
			thePreInstall.m_UpgradeType=CompareIngresVersion(ii_system);
			if (thePreInstall.m_DBATools)
				thePreInstall.m_UpgradeType=inst->m_UpgradeCode;
			if (inst->m_ver25)
			{
				thePreInstall.m_Ver25 ="1";
				thePreInstall.m_EmbeddedRelease =inst->m_embedded;
			}
			break;
		}
	}

	if (!(bInstalled && (!thePreInstall.m_Ver25.Compare("1") || thePreInstall.m_UpgradeType)))
		goto Label;

	char buf[2048], szInstallCode[3];
	char szKey[256], szResName[256];
	int idx;
	HKEY hKey;
	BOOL bCluster;

	sprintf(szInstallCode, thePreInstall.m_InstallCode.GetBuffer(3));
	if (_stricmp(szInstallCode, "II"))
	{
		/* Compute the GUID index from the installation code */
		idx = (toupper(szInstallCode[0]) - 'A') * 26 + toupper(szInstallCode[1]) - 'A';
		if (idx <= 0)
			idx = (toupper(szInstallCode[0]) - 'A') * 26 + toupper(szInstallCode[1]) - '0';

		sprintf(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{A78D%04X-2979-11D5-BDFA-00B0D0AD4485}",idx);
	}
	else 
		sprintf(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{A78D00D8-2979-11D5-BDFA-00B0D0AD4485}");
	thePreInstall.m_InstallCode.ReleaseBuffer();

	bCluster=FALSE;
	if(!RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, KEY_QUERY_VALUE, &hKey))
	{
		char szData[2];
		DWORD dwSize;

		dwSize=sizeof(szData); *szData=0;
		if (!RegQueryValueEx(hKey,"IngresClusterInstall", NULL, NULL, (BYTE *)szData, &dwSize) && !strcmp(szData, "1"))
			bCluster=TRUE;
		dwSize=sizeof(szResName); *szResName=0;
		if (!RegQueryValueEx(hKey,"IngresClusterResource", NULL, NULL, (BYTE *)szResName, &dwSize))
			sprintf(szResName, "Ingres Service [ %s ]", szInstallCode);
		RegCloseKey(hKey);
	}
				
	SetEnvironmentVariable("II_SYSTEM", ii_system);
	GetEnvironmentVariable("PATH", buf, sizeof(buf));
	sprintf(ach, "%s\\ingres\\bin;%s\\ingres\\utility;%s", ii_system, ii_system, buf);
	SetEnvironmentVariable("PATH", ach);

	while(IngresAlreadyRunning()==1)
	{
		thePreInstall.m_RestartIngres=1;

		MessageBeep(MB_ICONEXCLAMATION);
		if(!flag && AskUserYN(IDS_INGRESRUNNING))
		{
			CWaitCursor wait;

			flag=1;
			if (!bCluster)
			{
				sprintf(ach, "\"%s\\ingres\\bin\\winstart.exe\"", ii_installpath);
				Execute(ach, "/stop", FALSE);
				Sleep(1000);
				while(WinstartRunning())
				{
					Sleep(1000);
					GetParent()->UpdateWindow();
				}
			}
			else
			{
				HCLUSTER hCluster = NULL;
				HRESOURCE hResource = NULL;
				WCHAR lpwResourceName[256];

				hCluster = OpenCluster(NULL);
				if (hCluster)
				{
					mbstowcs(lpwResourceName, szResName, 256);
					hResource = OpenClusterResource(hCluster, lpwResourceName);
					if (hResource)
					{
						OfflineClusterResource(hResource);
						CloseClusterResource(hResource);
					}
				}
				while (IngresAlreadyRunning()==1)
					Sleep(1000);

			}
		}
		else
		{
			GotoDlgCtrl(&m_list);
			return FALSE;
		}
	}

	sprintf(ach, "\"%s\\ingres\\bin\\ivm.exe\"", ii_installpath);
	if (!Execute(ach, "-stop", FALSE))
	{
		sprintf(ach, "\"%s\\ingres\\vdba\\ivm.exe\"", ii_installpath);
		Execute(ach, "-stop", FALSE);
	}

	if(IngresAlreadyRunning()==0)
	{
		if ((thePreInstall.m_UpgradeType ==1 || thePreInstall.m_UpgradeType ==2) && 			!thePreInstall.m_DBATools)
		{
			CString charset;
			if (IsPre92Release(inst->m_ReleaseVer))
			{
			Local_NMgtIngAt("II_CHARSET", inst->m_path, charset);
			if (charset.IsEmpty())
			{
				char charsetinst[MAX_PATH];
				sprintf(charsetinst, "II_CHARSET%s", inst->m_id);
				Local_NMgtIngAt(charsetinst, inst->m_path, charset);
			}
			if (!charset.IsEmpty() && charset.CompareNoCase("UTF8")==0)
			{
				Error(IDS_BLOCKUPGRADE, code);
				return FALSE;
			}
			}
			if (thePreInstall.m_Ver25.Compare("1"))
			{
				if(!AskUserYN(IDS_UPGRADE))
				{
					thePreInstall.m_UpgradeType=0;
				}
			}
			else
			{
				if (!AskUserYN(IDS_MUSTUPGRADEVER25, thePreInstall.m_InstallCode))
				{
					GotoDlgCtrl(&m_list);
					return FALSE;
				}
			}
		}
	}

Label:
	if(!thePreInstall.LaunchWindowsInstaller(!bInstalled))
		exit(0);

	return TRUE;
}
Exemplo n.º 2
0
/*
**  Name:ingres_prepare_remove_dbms_files
**
**  Description:
**	Set up the RemoveFile table in DBMS Merge Module for the 
**	directories and files that were not installed as part of 
**	the initial installation so that they can be removed from  
**	the system during an uninstall.
**
**  Inputs:
**	hInstall	Handle to the installation.
**
**  Outputs:
**	None.
**	Returns:
**	    ERROR_SUCCESS			The function succeeds.
**	    ERROR_INSTALL_FAILURE	The function fails.
**	Exceptions:
**	    None.
**
**  Side Effects:
**	None.
**
**  History:
**	16-Aug-2001 (penga03)
**	    Created.
**	17-Aug-2001 (penga03)
**	    Do not put the INSTALLDIR in the RemoveFile table.
**	14-may-2004 (somsa01)
**	    Make sure we use the 64-bit GUID,
**	    8CCBF50C_6C17_4366_B8FE_FBB31A4092E0, when needed.
**	17-may-2004 (somsa01)
**	    Backed out prior change, as it does NOT properly fix the problem.
*/
UINT __stdcall
ingres_prepare_remove_dbms_files(MSIHANDLE hInstall)
{
	TCHAR tchValue[MAX_PATH+1], ii_system[MAX_PATH+1], szBuf[MAX_PATH+1];
	DWORD dwSize;
	MSIHANDLE hDatabase, hView, hRecord;
	TCHAR ConfigKey[256], Host[64];
	INSTALLSTATE iInstalled, iAction;
	TCHAR inst_id[64] = "INSTALLDIR.870341B5_2D6D_11D5_BDFC_00B0D0AD4485";
	TCHAR bin_id[64] = "Bin.870341B5_2D6D_11D5_BDFC_00B0D0AD4485";
	char sharedDisk[3];

	MsiGetFeatureState(hInstall, "IngresDBMS", &iInstalled, &iAction);
	if(iAction!=INSTALLSTATE_ABSENT)
		return ERROR_SUCCESS;

	dwSize=sizeof(ii_system);
	if(MsiGetTargetPath(hInstall, inst_id, ii_system, &dwSize)!=ERROR_SUCCESS)
		return ERROR_INSTALL_FAILURE;
	if(ii_system[lstrlen(ii_system)-1] == '\\')
		ii_system[lstrlen(ii_system)-1] = '\0';
	SetEnvironmentVariable("II_SYSTEM", ii_system);
	
	MsiSetProperty(hInstall, "INGRES_CLUSTER_RESOURCE_INUSE", "0");
	if(Local_NMgtIngAt("II_DATABASE", tchValue)==ERROR_SUCCESS)
	{
		strncpy(sharedDisk, tchValue, 2);
		sharedDisk[2]='\0';
		if (GetFileAttributes(sharedDisk) == -1)
		{
			MsiSetProperty(hInstall, "INGRES_CLUSTER_RESOURCE_INUSE", "1");
			return ERROR_SUCCESS;
		}
	}

	hDatabase=MsiGetActiveDatabase(hInstall);
	if(!hDatabase)
		return ERROR_INSTALL_FAILURE;
	if(MsiDatabaseOpenView(hDatabase, "INSERT INTO `RemoveFile` (`FileKey`, `Component_`, `FileName`, `DirProperty`, `InstallMode`) VALUES (?, ?, ?, ?, ?) TEMPORARY", &hView)!=ERROR_SUCCESS)
		return ERROR_INSTALL_FAILURE;
	hRecord=MsiCreateRecord(5);
	if(!hRecord)
		return ERROR_INSTALL_FAILURE;

	if(Local_NMgtIngAt("II_DATABASE", tchValue)==ERROR_SUCCESS)
	{
		int KeyCount;
		char szKey[MAX_PATH+1], szKey2[MAX_PATH+1];

		wsprintf(szBuf, "%s\\ingres\\data", tchValue);
		Count=-1;
		CreateDirList(szBuf);
		for(KeyCount=0; KeyCount<=Count; KeyCount++)
		{
			wsprintf(szKey, "RemoveDatabaseDir_%d", KeyCount);
			wsprintf(szKey2, "RemoveDatabaseDir_%d_Dir", KeyCount);

			MsiSetProperty(hInstall, szKey, DirList[KeyCount].DirName);
			
			MsiRecordSetString(hRecord, 1, szKey);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "*.*");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;

			MsiRecordSetString(hRecord, 1, szKey2);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;
		}

		Count++;
		wsprintf(szKey, "RemoveDatabaseDir_%d", Count);
		wsprintf(szKey2, "RemoveDatabaseDir_%d_Dir", Count);

		wsprintf(szBuf, "%s\\ingres", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
			
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;

		Count++;
		wsprintf(szKey, "RemoveDatabaseDir_%d", Count);
		wsprintf(szKey2, "RemoveDatabaseDir_%d_Dir", Count);
		
		wsprintf(szBuf, "%s", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
			
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;
	}

	if(Local_NMgtIngAt("II_CHECKPOINT", tchValue)==ERROR_SUCCESS)
	{
		int KeyCount;
		char szKey[MAX_PATH+1], szKey2[MAX_PATH+1];

		wsprintf(szBuf, "%s\\ingres\\ckp", tchValue);
		Count=-1;
		CreateDirList(szBuf);
		for(KeyCount=0; KeyCount<=Count; KeyCount++)
		{
			wsprintf(szKey, "RemovecCheckpointDir_%d", KeyCount);
			wsprintf(szKey2, "RemoveCheckpointDir_%d_Dir", KeyCount);

			MsiSetProperty(hInstall, szKey, DirList[KeyCount].DirName);
			
			MsiRecordSetString(hRecord, 1, szKey);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "*.*");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;

			MsiRecordSetString(hRecord, 1, szKey2);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;
		}

		Count++;
		wsprintf(szKey, "RemovecCheckpointDir_%d", Count);
		wsprintf(szKey2, "RemovecCheckpointDir_%d_Dir", Count);

		wsprintf(szBuf, "%s\\ingres", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
			
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;

		Count++;
		wsprintf(szKey, "RemovecCheckpointDir_%d", Count);
		wsprintf(szKey2, "RemovecCheckpointDir_%d_Dir", Count);
		
		wsprintf(szBuf, "%s", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
			
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;
	}

	if(Local_NMgtIngAt("II_JOURNAL", tchValue)==ERROR_SUCCESS)
	{
		int KeyCount;
		char szKey[MAX_PATH+1], szKey2[MAX_PATH+1];

		wsprintf(szBuf, "%s\\ingres\\jnl", tchValue);
		Count=-1;
		CreateDirList(szBuf);
		for(KeyCount=0; KeyCount<=Count; KeyCount++)
		{
			wsprintf(szKey, "RemoveJournalDir_%d", KeyCount);
			wsprintf(szKey2, "RemoveJournalDir_%d_Dir", KeyCount);

			MsiSetProperty(hInstall, szKey, DirList[KeyCount].DirName);
			
			MsiRecordSetString(hRecord, 1, szKey);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "*.*");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;

			MsiRecordSetString(hRecord, 1, szKey2);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;
		}

		Count++;
		wsprintf(szKey, "RemoveJournalDir_%d", Count);
		wsprintf(szKey2, "RemoveJournalDir_%d_Dir", Count);

		wsprintf(szBuf, "%s\\ingres", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
			
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;

		Count++;
		wsprintf(szKey, "RemoveJournalDir_%d", Count);
		wsprintf(szKey2, "RemoveJournalDir_%d_Dir", Count);
		
		wsprintf(szBuf, "%s", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
			
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;
	}

	if(Local_NMgtIngAt("II_DUMP", tchValue)==ERROR_SUCCESS)
	{
		int KeyCount;
		char szKey[MAX_PATH+1], szKey2[MAX_PATH+1];

		wsprintf(szBuf, "%s\\ingres\\dmp", tchValue);
		Count=-1;
		CreateDirList(szBuf);
		for(KeyCount=0; KeyCount<=Count; KeyCount++)
		{
			wsprintf(szKey, "RemoveDumpDir_%d", KeyCount);
			wsprintf(szKey2, "RemoveDumpDir_%d_Dir", KeyCount);

			MsiSetProperty(hInstall, szKey, DirList[KeyCount].DirName);
			
			MsiRecordSetString(hRecord, 1, szKey);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "*.*");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;

			MsiRecordSetString(hRecord, 1, szKey2);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;
		}

		Count++;
		wsprintf(szKey, "RemoveDumpDir_%d", Count);
		wsprintf(szKey2, "RemoveDumpDir_%d_Dir", Count);

		wsprintf(szBuf, "%s\\ingres", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
			
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;

		Count++;
		wsprintf(szKey, "RemoveDumpDir_%d", Count);
		wsprintf(szKey2, "RemoveDumpDir_%d_Dir", Count);
		
		wsprintf(szBuf, "%s", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
			
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;
	}

	if(Local_NMgtIngAt("II_WORK", tchValue)==ERROR_SUCCESS)
	{
		int KeyCount;
		char szKey[MAX_PATH+1], szKey2[MAX_PATH+1];

		wsprintf(szBuf, "%s\\ingres\\work", tchValue);
		Count=-1;
		CreateDirList(szBuf);
		for(KeyCount=0; KeyCount<=Count; KeyCount++)
		{
			wsprintf(szKey, "RemoveWorkDir_%d", KeyCount);
			wsprintf(szKey2, "RemoveWorkDir_%d_Dir", KeyCount);

			MsiSetProperty(hInstall, szKey, DirList[KeyCount].DirName);
			
			MsiRecordSetString(hRecord, 1, szKey);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "*.*");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;

			MsiRecordSetString(hRecord, 1, szKey2);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;
		}

		Count++;
		wsprintf(szKey, "RemoveWorkDir_%d", Count);
		wsprintf(szKey2, "RemoveWorkDir_%d_Dir", Count);

		wsprintf(szBuf, "%s\\ingres", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
			
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;

		Count++;
		wsprintf(szKey, "RemoveWorkDir_%d", Count);
		wsprintf(szKey2, "RemoveWorkDir_%d_Dir", Count);
		
		wsprintf(szBuf, "%s", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
			
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;
	}

	Local_PMhost(Host);
	wsprintf(ConfigKey, "ii.%s.rcp.log.log_file_parts", Host);
	if(Local_PMget(ConfigKey, tchValue) == ERROR_SUCCESS)
	{
		int num_logs, i;
		
		num_logs=atoi(tchValue);
		for(i=1; i<=num_logs; i++)
		{
			wsprintf(ConfigKey, "ii.%s.rcp.log.log_file_%d", Host, i);
			if(Local_PMget(ConfigKey, tchValue) == ERROR_SUCCESS)
			{
				int KeyCount;
				char szKey[MAX_PATH+1], szKey2[MAX_PATH+1];
				
				StringReplace(tchValue);
				wsprintf(szBuf, "%s\\ingres\\log", tchValue);
				Count=-1;
				CreateDirList(szBuf);
				for(KeyCount=0; KeyCount<=Count; KeyCount++)
				{
					wsprintf(szKey, "RemoveLogDir_%d", KeyCount);
					wsprintf(szKey2, "RemoveLogDir_%d_Dir", KeyCount);
					
					MsiSetProperty(hInstall, szKey, DirList[KeyCount].DirName);
					
					MsiRecordSetString(hRecord, 1, szKey);
					MsiRecordSetString(hRecord, 2, bin_id);
					MsiRecordSetString(hRecord, 3, "*.*");
					MsiRecordSetString(hRecord, 4, szKey);
					MsiRecordSetInteger(hRecord, 5, 2);
					if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
						return ERROR_INSTALL_FAILURE;
					
					MsiRecordSetString(hRecord, 1, szKey2);
					MsiRecordSetString(hRecord, 2, bin_id);
					MsiRecordSetString(hRecord, 3, "");
					MsiRecordSetString(hRecord, 4, szKey);
					MsiRecordSetInteger(hRecord, 5, 2);
					if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
						return ERROR_INSTALL_FAILURE;
				}
				
				Count++;
				wsprintf(szKey, "RemoveLogDir_%d", Count);
				wsprintf(szKey2, "RemoveLogDir_%d_Dir", Count);
				
				wsprintf(szBuf, "%s\\ingres", tchValue);
				MsiSetProperty(hInstall, szKey, szBuf);
				
				MsiRecordSetString(hRecord, 1, szKey2);
				MsiRecordSetString(hRecord, 2, bin_id);
				MsiRecordSetString(hRecord, 3, "");
				MsiRecordSetString(hRecord, 4, szKey);
				MsiRecordSetInteger(hRecord, 5, 2);
				if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
					return ERROR_INSTALL_FAILURE;
				
				Count++;
				wsprintf(szKey, "RemoveLogDir_%d", Count);
				wsprintf(szKey2, "RemoveLogDir_%d_Dir", Count);
				
				wsprintf(szBuf, "%s", tchValue);
				MsiSetProperty(hInstall, szKey, szBuf);
				
				MsiRecordSetString(hRecord, 1, szKey2);
				MsiRecordSetString(hRecord, 2, bin_id);
				MsiRecordSetString(hRecord, 3, "");
				MsiRecordSetString(hRecord, 4, szKey);
				MsiRecordSetInteger(hRecord, 5, 2);
				if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
					return ERROR_INSTALL_FAILURE;
			}
		}
	}
	
	wsprintf(ConfigKey, "ii.%s.rcp.log.dual_log_1", Host);
	if(Local_PMget(ConfigKey, tchValue) == ERROR_SUCCESS)
	{
		int KeyCount;
		char szKey[MAX_PATH+1], szKey2[MAX_PATH+1];
		
		StringReplace(tchValue);
		wsprintf(szBuf, "%s\\ingres\\log", tchValue);
		Count=-1;
		CreateDirList(szBuf);
		for(KeyCount=0; KeyCount<=Count; KeyCount++)
		{
			wsprintf(szKey, "RemoveDuallogDir_%d", KeyCount);
			wsprintf(szKey2, "RemoveDuallogDir_%d_Dir", KeyCount);

			MsiSetProperty(hInstall, szKey, DirList[KeyCount].DirName);
			
			MsiRecordSetString(hRecord, 1, szKey);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "*.*");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;

			MsiRecordSetString(hRecord, 1, szKey2);
			MsiRecordSetString(hRecord, 2, bin_id);
			MsiRecordSetString(hRecord, 3, "");
			MsiRecordSetString(hRecord, 4, szKey);
			MsiRecordSetInteger(hRecord, 5, 2);
			if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
				return ERROR_INSTALL_FAILURE;
		}

		Count++;
		wsprintf(szKey, "RemoveDuallogDir_%d", Count);
		wsprintf(szKey2, "RemoveDuallogDir_%d_Dir", Count);
				
		wsprintf(szBuf, "%s\\ingres", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
				
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;
		
		Count++;
		wsprintf(szKey, "RemoveDuallogDir_%d", Count);
		wsprintf(szKey2, "RemoveDuallogDir_%d_Dir", Count);
		
		wsprintf(szBuf, "%s", tchValue);
		MsiSetProperty(hInstall, szKey, szBuf);
		
		MsiRecordSetString(hRecord, 1, szKey2);
		MsiRecordSetString(hRecord, 2, bin_id);
		MsiRecordSetString(hRecord, 3, "");
		MsiRecordSetString(hRecord, 4, szKey);
		MsiRecordSetInteger(hRecord, 5, 2);
		if(MsiViewExecute(hView, hRecord)!=ERROR_SUCCESS)
			return ERROR_INSTALL_FAILURE;
	}

	MsiCloseHandle(hRecord);
	MsiCloseHandle(hView);
	MsiCloseHandle(hDatabase);

	return ERROR_SUCCESS;
}