Пример #1
0
void UninstallProcess::run()
{
	if (m_szIPath == "" || m_szMCFPath == "")
	{
		gcException errPathNull(ERR_BADPATH, gcString("One of the paths for uninstall was nullptr [IP: {0} MCF: {1}].", m_szIPath, m_szMCFPath));
		onErrorEvent(errPathNull);
		return;
	}

	MCFCore::MCFI *mcfHandle = mcfFactory();
	m_pMcfHandle = mcfHandle;
	mcfHandle->getErrorEvent() += delegate(&onErrorEvent);
	mcfHandle->getProgEvent() += delegate(this, &UninstallProcess::onProgress);

	InstallScriptRunTime isrt(m_szInstallScript.c_str(), m_szIPath.c_str());

	try
	{
		mcfHandle->setFile(m_szMCFPath.c_str());
		mcfHandle->parseMCF();

		isrt.run("PreUninstall");
		mcfHandle->removeFiles(m_szIPath.c_str());
		isrt.run("PostUninstall");
	}
	catch (gcException &except)
	{
		onErrorEvent(except);
	}

	m_pMcfHandle=nullptr;
	mcfDelFactory(mcfHandle);

	onCompleteEvent();
}
Пример #2
0
    virtual int performAction(std::vector<std::string> &args)
    {
        MCFCore::MCFI* mcfPatch = mcfFactory();
        MCFCore::MCFI* mcfFull = mcfFactory();

        mcfPatch->setFile(args[0].c_str());
        mcfPatch->parseMCF();

        mcfFull->setFile(args[1].c_str());
        mcfFull->parseMCF();

        mcfPatch->makeBackPatchMCF(mcfFull, args[2].c_str());

        mcfDelFactory(mcfFull);
        mcfDelFactory(mcfPatch);

        return 0;
    }
Пример #3
0
	void makeMCF(const char* path)
	{
		MCFCore::MCFI* mcfHandle = mcfFactory();
		mcfHandle->getProgEvent() += delegate((UtilFunction*)this, &UtilFunction::printProgress);
		mcfHandle->getErrorEvent() += delegate((UtilFunction*)this, &UtilFunction::mcfError);

		mcfHandle->setFile("temp.mcf");
		mcfHandle->parseFolder(path);
		mcfHandle->saveMCF();

		mcfDelFactory(mcfHandle);
	}
Пример #4
0
    virtual int performAction(std::vector<std::string> &args)
    {
        MCFCore::MCFI* mcfSrc = mcfFactory();
        MCFCore::MCFI* mcfPatch = mcfFactory();

        printf("Parsing MCF: %s\n", args[0].c_str());
        mcfSrc->setFile(args[0].c_str());
        mcfSrc->parseMCF();

        printf("Parsing MCF: %s\n", args[1].c_str());
        mcfPatch->setFile(args[1].c_str());
        mcfPatch->parseMCF();

        printf("Merging patch!\n");
        mcfSrc->makeFullFile(mcfPatch, args[2].c_str());

        mcfDelFactory(mcfSrc);
        mcfDelFactory(mcfPatch);

        return 0;
    }
Пример #5
0
    virtual int performAction(std::vector<std::string> &args)
    {
        MCFCore::MCFI* mcfSrc = mcfFactory();
        MCFCore::MCFI* mcfPrev = mcfFactory();

        mcfSrc->setFile(args[1].c_str());
        mcfPrev->setFile(args[2].c_str());

        mcfSrc->parseFolder(args[0].c_str());
        mcfSrc->hashFiles();

        mcfPrev->parseMCF();

        mcfSrc->makePatch(mcfPrev);
        mcfSrc->saveMCF();


        mcfDelFactory(mcfSrc);
        mcfDelFactory(mcfPrev);

        return 0;
    }