コード例 #1
0
BOOL CPropSheet::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	switch(wParam)
	{
	case IDCANCEL: 
		if (!AskUserYN(IDS_AREYOUSURE))
			return TRUE;
	}


	return CPropertySheet::OnCommand(wParam, lParam);
}
コード例 #2
0
/*
**  Name: ingres_install_adobe_reader
**	
**  Description:
**	This function is responsible for checking for existance of
**	Adobe Reader and will suggest to install it if it isn't detected.
**	This function has been modified to open just a page browser instead
**	of redistributing the Adobe Reader. 
**
**  Side Effects:
**	None.
**
**  History:
**	16-Nov-2006 (drivi01)
**	    Created.
**	19-May-2008 (drivi01)
**	    Remove locale routines.  Currently we have no
**	    way to pull up locale dependent adobe site, so 
**	    we will point everyone at adobe.com and they
**	    can choose to go to the locale of their choice.
**	16-Jan-2009 (whiro01)
**	    Removed now unused local variables (clears compiler warnings).
*/
UINT __stdcall 
ingres_install_adobe_reader(MSIHANDLE hInstall)
{
	if (!IsCurrentAcrobatAlreadyInstalled())
	{
	    if (AskUserYN(hInstall, "The Ingres documentation is provided in Portable Document Format (PDF).\nTo view PDF files, you must download and install Adobe Reader from the\nAdobe website if it is not already installed on your computer.\n\nWould you like to go to the Adobe website to download Adobe Reader?\n(Version 7.0 or above is required.)"))
		OpenPageForAcrobat();
	    else
		MyMessageBox(hInstall, "Please obtain the correct version of the Adobe Acrobat Reader from http://www.adobe.com.");
	}
	return ERROR_SUCCESS;
}
コード例 #3
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;
}