Exemple #1
0
DWORD WINAPI UninstallerThread(LPVOID data)
{
    // also kill the original uninstaller, if it's just spawned
    // a DELETE_ON_CLOSE copy from the temp directory
    WCHAR *exePath = GetUninstallerPath();
    if (!path::IsSame(exePath, GetOwnPath()))
        KillProcess(exePath, TRUE);
    free(exePath);

    if (!RemoveUninstallerRegistryInfo(HKEY_LOCAL_MACHINE) &&
        !RemoveUninstallerRegistryInfo(HKEY_CURRENT_USER)) {
        NotifyFailed(L"Failed to delete uninstaller registry keys");
    }

    if (!RemoveShortcut(true) && !RemoveShortcut(false))
        NotifyFailed(L"Couldn't remove the shortcut");

    UninstallBrowserPlugin();
    UninstallPdfFilter();
    UninstallPdfPreviewer();
    RemoveOwnRegistryKeys();

    if (!RemoveInstalledFiles())
        NotifyFailed(L"Couldn't remove installation directory");

    // always succeed, even for partial uninstallations
    gGlobalData.success = true;

    if (!gGlobalData.silent)
        PostMessage(gHwndFrame, WM_APP_INSTALLATION_FINISHED, 0, 0);
    return 0;
}
		//--------------------------------------------------------------
		//--------------------------------------------------------------
        void GooglePlayExpansionSystem::UnzipTask()
        {
        	m_javaInterface->KeepAppAwake();

        	RemoveInstalledFiles();

        	Json::Value jManifest(Json::arrayValue);
			for(u32 i=0; i<m_numExpansions; ++i)
			{
				Unzip(m_javaInterface->GetExpansionPath(i), jManifest);
			}

			CSCore::Application::Get()->GetFileSystem()->WriteFile(CSCore::StorageLocation::k_cache, "AndroidExpansion.manifest", (s8*)jManifest.toStyledString().data(), jManifest.toStyledString().size());

			CachePackageDescriptions();

			m_javaInterface->AllowAppToSleep();

			CSCore::Application::Get()->GetTaskScheduler()->ScheduleMainThreadTask(std::bind(&GooglePlayExpansionSystem::UnzipCompleteTask, this, DownloadStatus::k_complete));
        }