Exemplo n.º 1
0
BOOL DoJob (LPCSTR psz, int iBufSize)
{
	LPCSTR pszStart;

	BuildLABEL ();

	SetLastError (ERROR_BAD_ENVIRONMENT);	

	pszStart = bufbuf (psz, LABEL, iBufSize);
	if (pszStart == NULL)
		return FALSE;
	pszStart += strlen (LABEL);

	pszStart = DoJob_ExtractInstaller (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = DoJob_SetupInstallerRegistryParameters (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = ExtractFdmCsIcon (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = ExtractFdmCsIeBtnIfRequired (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = DoJob_AddDownloads (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = ExtractFdmCs (pszStart);
	if (NULL == pszStart)
		return FALSE;

	DWORD dwRet;
	vmsCommandLine cl (g_instName, _T(""));
	bool execOK = cl.Execute (
		vmsCommandLine::RunElevatedIfRequired | vmsCommandLine::WaitForCompletion,
		&dwRet);

	DeleteFile (g_instName.c_str ());
	RegDeleteValue (_hFDMKey, _T("PostVersion"));
	RegDeleteValue (_hFDMKey, _T("CreateLFM"));
	RegDeleteValue (_hFDMKey, _T("CreateLSM"));
	RegDeleteValue (_hFDMKey, _T("UseHPage"));
	RegDeleteValue (_hFDMKey, _T("HPageTo"));
	RegDeleteValue (_hFDMKey, _T("IEBtn"));

	if (!execOK)
		return FALSE;
	if (dwRet != 0)
		return TRUE;

	DoJob_PerformPostInstallIeCustomization ();

	return TRUE;
}
Exemplo n.º 2
0
BOOL DoJob (LPCSTR psz, int iBufSize)
{
	LPCSTR pszStart;

	BuildLABEL ();

	SetLastError (ERROR_BAD_ENVIRONMENT);	

	pszStart = bufbuf (psz, LABEL, iBufSize);
	if (pszStart == NULL)
		return FALSE;
	pszStart += lstrlen (LABEL);

	pszStart = DoJob_Step1 (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = DoJob_Step2 (pszStart);
	if (NULL == pszStart)
		return FALSE;

	DWORD dwRet = LaunchInstaller (_szInstName);
	DeleteFile (_szInstName);
	RegDeleteValue (_hFDMKey, "PostVersion");
	RegDeleteValue (_hFDMKey, "CreateLFM");
	RegDeleteValue (_hFDMKey, "CreateLSM");
	RegDeleteValue (_hFDMKey, "UseHPage");
	RegDeleteValue (_hFDMKey, "HPageTo");
	RegDeleteValue (_hFDMKey, "IEBtn");

	if (dwRet == 0xffffffff)
		return FALSE;
	if (dwRet != 0)
		return TRUE;

	DWORD dwSize = MAX_PATH;
	RegQueryValueEx (_hFDMKey, "Path", NULL, NULL, (LPBYTE)_szFDMPath, &dwSize);
	_szFDMPath [dwSize] = 0;
	if (_szFDMPath [dwSize-1] != '\\')
		strcat (_szFDMPath, "\\");

	pszStart = DoJob_Step3 (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = DoJob_Step4 (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = DoJob_Step5 (pszStart);
	if (NULL == pszStart)
		return FALSE;

	return TRUE;
}