Ejemplo n.º 1
1
    bool RunInstaller(vector<SharedDependency> missing, bool forceInstall)
    {

        string installer(FileUtils::Join(app->path.c_str(), "installer", "installer.exe", 0));
        if (!FileUtils::IsFile(installer))
        {
            ShowError("Missing installer and application has additional modules that are needed.");
            return false;
        }
        return BootUtils::RunInstaller(missing, app, updateFile, "", false, forceInstall);
    }
Ejemplo n.º 2
0
// Main
bool AppMain(const std::vector<std::wstring>& Args) {
  if (Args.size() != 4) {
    Usage();
    return true;
  }

  const auto pid = std::stoul(Args[1]);
  const auto installationMethod = std::wstring(Args[2]);
  const auto executionMethod = std::wstring(Args[3]);

  std::shared_ptr<REMOTE_MEMORY_BLOCK>(*installer)(HANDLE) = nullptr;
  if (installationMethod == L"alloc") {
    installer = InstallCodeWithVirtualAllocEx;
  } else if (installationMethod == L"section") {
    installer = InstallCodeWithZwMapViewOfSection;
  }
  DWORD (*executer)(HANDLE, REMOTE_MEMORY_BLOCK*) = nullptr;
  if (executionMethod == L"remote") {
    executer = ExecuteCodeWithCreateRemoteThread;
  } else if (executionMethod == L"context") {
    executer = ExecuteCodeWithSetThreadContext;
  }

  if (!installer || !executer) {
    Usage();
    return false;
  }

  const auto processHandle =
      stdexp::make_unique_resource(Open32BitProcess(pid), &::CloseHandle);
  if (!processHandle) {
    return false;
  }

  // Inject code
  const auto remoteMemory = installer(processHandle.get());
  if (!remoteMemory) {
    return false;
  }
  std::cout << "Remote Address   : " << std::hex << remoteMemory.get()
            << std::endl;

  // Execute code
  const auto remoteThreadId = executer(processHandle.get(), remoteMemory.get());
  if (!remoteThreadId) {
    return false;
  }

  std::cout << "Remote Thread ID : " << std::dec << remoteThreadId << std::endl;

  // Do not execute a destructor for remoteMemory that will release remote code
  ::ExitProcess(EXIT_SUCCESS);
}
Ejemplo n.º 3
0
void InstallComponentsCommand::redo()
{
    if (!m_installedComponents.empty()) {
        // Redo after undo installing
        m_manager->startupComponents(m_installedComponents);
        return;
    }

    // Get component names from the files
    QStringList componentNames;
    for (const QString &fileName : m_definitionFiles) {
        QFileInfo definitionFile(fileName);
        componentNames.push_back(definitionFile.completeBaseName());
    }

    // Add existed components
    DirectoryInstaller installer(m_sourceDirectoryPath, m_installPath);
    for (IComponent *comp : m_manager->components()) {
        installer.addExistedComponent(comp);
    }

    installer.tryToInstall(componentNames);
    QStringList installedDefinitionFiles = installer.install();

    if (!m_addAfterInstallation)
        return;

    // Startup installed components
    for (const QString &fileName : installedDefinitionFiles) {
        FileComponentProvider provider(fileName);
        IComponent *component = provider.loadComponent();
        if (m_manager->addComponent(component))
            m_installedComponents.push_back(component);
        else
            delete component;
    }

    if (!m_startAfterInstallation)
        return;

    m_manager->startupComponents(m_installedComponents);
}
Ejemplo n.º 4
0
void main(void)
{
    initScreens();
    sdmmc_sdcard_init();

    //Determine if booting with A9LH
    u32 a9lhBoot = !PDN_SPI_CNT;
    //Detect the console being used
    console = PDN_MPCORE_CFG == 7;

    drawString(TITLE, 10, 10, COLOR_TITLE);
    posY = drawString("Thanks to delebile, #cakey and StandardBus", 10, 40, COLOR_WHITE);
    posY = drawString(a9lhBoot ? "Press SELECT to update ShadowNAND" : "Press SELECT for a full install", 10, posY + SPACING_Y, COLOR_WHITE);
    posY = drawString("Press any other button to shutdown", 10, posY, COLOR_WHITE);

    u32 pressed = waitInput();
    if(pressed == BUTTON_SELECT) installer(a9lhBoot);

    shutdown(0, NULL);
}
Ejemplo n.º 5
0
void UpdaterTest::testIsUpdateDownloaded()
{
	if (exists("a_temporary_test_data_directory"))
	{
		remove("a_temporary_test_data_directory\\BumpTopInstaller.msi");
		remove("a_temporary_test_data_directory\\version.txt");
		remove("a_temporary_test_data_directory\\desc.txt");
	}

	vector<string> versionStrings;
	versionStrings.push_back("800");
	MockUpdateServer *mus = new MockUpdateServer(versionStrings);
	Updater *u = new Updater(mus, 99, "a_temporary_test_data_directory", 0, 0, 0);

	create_directory("a_temporary_test_data_directory");

	ofstream installer("a_temporary_test_data_directory//BumpTopInstaller.msi");
	installer << "!!!!!";
	installer.close();

	CPPUNIT_ASSERT_EQUAL(false, u->isUpdateDownloaded());

	ofstream versionFile("a_temporary_test_data_directory//version.txt");
	versionFile << "2000";
	versionFile.close();

	CPPUNIT_ASSERT_EQUAL(false, u->isUpdateDownloaded());

	ofstream descFile("a_temporary_test_data_directory//desc.txt");
	descFile << "best version ever";
	descFile.close();

	CPPUNIT_ASSERT_EQUAL(true, u->isUpdateDownloaded());

	remove("a_temporary_test_data_directory\\BumpTopInstaller.msi");
	remove("a_temporary_test_data_directory\\version.txt");
	remove("a_temporary_test_data_directory\\desc.txt");
	remove("a_temporary_test_data_directory");


}
Ejemplo n.º 6
0
bool SyncState::autoUpdate()
{
	const char* versionUrl = "https://raw.githubusercontent.com/Repo3DS/BrewMan/master/version.yml";
	const char* versionFilename = "sdmc:/3ds/BrewMan/tmp/version.yml";
	const char* updateFilename = "sdmc:/3ds/BrewMan/tmp/update.bin";
	setStatus("Checking for BrewMan update...");

	Download download(versionUrl, versionFilename);
	download.run();

	YAML::Node yaml = YAML::LoadFile(cpp3ds::FileSystem::getFilePath(versionFilename));
	std::string version = yaml["version"].as<std::string>();
	std::string fileUrl = yaml["file"].as<std::string>();

	if (version != BREWMAN_VERSION)
	{
		setStatus(_("Downloading BrewMan %s ...", version.c_str()));
		Download download(fileUrl, updateFilename);
		download.run();

		AppItem item;
		item.setFilesize(yaml["filesize"].as<size_t>());
		item.setFileMD5(yaml["file-md5"].as<std::string>());
		item.setDirectory("BrewMan");
		Installer installer(&item, updateFilename);
		if (installer.isValid())
		{
			setStatus(_("Installing BrewMan %s ...", version.c_str()));
			installer.install();
			return true;
		}
		else
			setStatus(_("Failed to install BrewMan %s!", version.c_str()));
	}

	return false;
}
Ejemplo n.º 7
0
int main(int argc, char *argv[]) {
    int retval;
    R_RSA_PUBLIC_KEY key;
    char log_path[MAXPATHLEN];
#ifdef _USING_FCGI_
    unsigned int counter=0;
#endif

    for(int c = 1; c < argc; c++) {
        std::string option(argv[c]);
        if(option == "-v" || option == "--version") {
            printf("%s\n", SVN_VERSION);
            exit(0);
        } else if(option == "-h" || option == "--help") {
            usage(argv[0]);
            exit(0);
        } else if (option.length()){
            fprintf(stderr, "unknown command line argument: %s\n\n", argv[c]);
            usage(argv[0]);
            exit(1);
        }
    }

    installer();

    get_log_path(log_path, "file_upload_handler.log");
#ifndef _USING_FCGI_
    if (!freopen(log_path, "a", stderr)) {
        fprintf(stderr, "Can't open log file '%s' (errno: %d)\n",
            log_path, errno
        );
        return_error(ERR_TRANSIENT, "can't open log file '%s' (errno: %d)",
            log_path, errno
        );
        exit(1);
    }
#else
    FCGI_FILE *f = FCGI::fopen(log_path, "a");
    if (f) {
       log_messages.redirect(f);
    } else {
        fprintf(stderr, "Can't redirect FCGI log messages\n");
        return_error(ERR_TRANSIENT, "can't open log file (FCGI)");
        exit(1);
    }
#endif

    retval = config.parse_file();
    if (retval) {
        fprintf(stderr, "Can't parse config.xml: %s\n", boincerror(retval));
        return_error(ERR_TRANSIENT,
            "can't parse config file", log_path, errno
        );
        exit(1);
    }

    log_messages.pid = getpid();
    log_messages.set_debug_level(config.fuh_debug_level);

    if (boinc_file_exists(config.project_path("stop_upload"))) {
        return_error(ERR_TRANSIENT, "Maintenance underway: file uploads are temporarily disabled.");
        exit(1);
    }

    if (!config.ignore_upload_certificates) {
        retval = get_key(key);
        if (retval) {
            return_error(ERR_TRANSIENT, "can't read key file");
            exit(1);
        }
    }

#ifdef _USING_FCGI_
    while(FCGI_Accept() >= 0) {
        counter++;
        //fprintf(stderr, "file_upload_handler (FCGI): counter: %d\n", counter);
        log_messages.set_indent_level(0);
#endif
        handle_request(stdin, key);
#ifdef _USING_FCGI_
        // flush log for FCGI, otherwise it just buffers a lot
        log_messages.flush();
    }
    // when exiting, write headers back to apache so it won't complain
    // about "incomplete headers"
    fprintf(stdout,"Content-type: text/plain\n\n");
#endif
    return 0;
}
Ejemplo n.º 8
0
int wizardmain(int argc, char **argv)
{
    const char *outfile = NULL, *relpath = NULL;
    for(int i = 1; i < argc; i++)
    {
        if(argv[i][0] == '-') continue;
        if(!outfile) outfile = argv[i];
        else if(!relpath) relpath = argv[i];
    }
    if(!outfile || !relpath)
    {
        printf("invalid arguments specified!\n");
        printf("usage: ac_server <outfile> <relbinarypath>\n");
        return EXIT_FAILURE;
    }

    printf("The AssaultCube Server Wizard\n\n");
    printf("Before setting up a new server, please ensure you've read the rules at:\n"
           "\thttp://masterserver.cubers.net/rules.html\n\n");
    printf("You will also need to ensure that the UDP port you choose is open.\n"
           "Whatever port you choose, you will need to forward that port, plus one port after that.\n"
           "If you're having issues, use and forward the default ports 28763 and 28764\n"
           "Use http://www.portforward.com for guidance.\n\n");
    printf("Now to specify some optional settings for your server.\n"
           "The default settings will be used if you leave the fields blank.\n"
           "If you're unsure about what to specify for the settings, leave the field blank.\n\n"
           "Read http://assault.cubers.net/docs/commandline.html for a description of these settings.\n\n");

    vector<char> argstr;
    readarg(argstr, "Server description", "-n");
    readarg(argstr, "Message of the day", "-o");
    readarg(argstr, "Maximum clients (No more than 20 allowed!)", "-c");
    readarg(argstr, "Administrator password", "-x");
    readarg(argstr, "Server port", "-f");

    printf("\nPrivate server settings:\n"
           "------------------------\n");
    string ispub = "";
    readarg("Public server (Yes/No)?", ispub, sizeof(ispub));
    if(toupper(ispub[0]) == 'N') addarg(argstr, "-mlocalhost");
    string cmds = "";
    readarg(argstr, "Player password", "-p");

    readarg("\nAdditional server switches", cmds, sizeof(cmds));
    if(cmds[0]) addarg(argstr, cmds);

#ifdef WIN32

    string wsname = "", wsdisplayname = "";
    readarg("win service name", wsname, sizeof(wsname));
    if(wsname[0])
        readarg("win service display", wsdisplayname, sizeof(wsdisplayname));

#endif

    printf("\nWriting your configuration to %s ... ", outfile); fflush(stdout);

    argstr.add('\0');

    FILE *script = fopen(outfile, "w");
    if(!script)
    {
        printf("Failed!\n");
        return EXIT_FAILURE;
    }

#ifdef WIN32
        fprintf(script, "%s%s\npause\n", relpath, argstr.getbuf());
#elif __GNUC__
        fprintf(script, "#!/bin/sh\n%s%s\n", relpath, argstr.getbuf());
#endif
    fclose(script);

    printf("Done\n\n");
    printf("Note: You can start %s directly the next time you want to use the same configuration to start the server.\n\n", outfile);

#ifdef WIN32

    if(wsname[0])
    {
        if(!wsdisplayname[0]) copystring(wsdisplayname, wsname);

        printf("Installing the AC Server as windows service ... "); fflush(stdout);

        vector<char> path;
        databuf<char> cwd = path.reserve(MAX_PATH);
        if(!_getcwd(cwd.buf, MAX_PATH))
        {
            printf("Failed!\n");
            printf("Could not get current working directory: %u\n", (uint)GetLastError());
            return EXIT_FAILURE;
        }
        path.advance(strlen(cwd.buf));
        path.add('\\');
        path.put(relpath, strlen(relpath));
        path.put(" -S", 3);
        path.put(wsname, strlen(wsname));
        path.add(' ');
        path.put(argstr.getbuf(), argstr.length());

        winserviceinstaller installer(wsname, wsdisplayname, path.getbuf());

        int r;
        if(!installer.OpenManger())
        {
            printf("Failed!\n");
            printf("Could not open the Service Control Manager: %u\n", (uint)GetLastError());
            installer.CloseManager();
            return EXIT_FAILURE;
        }

        if((r = installer.IsInstalled()) != 0)
        {
            printf("Failed!\n");
            if(r == -1) printf("Error accessing the Service Control Manager\n");
            else if(r == 1) printf("A windows service with this name (%s) is already installed: %u\n", wsname, (uint)GetLastError());
            return EXIT_FAILURE;
        }

        if((r = installer.Install()) != 1)
        {
            printf("Failed!\n");
            if(r == -1) printf("Error accessing the Service Control Manager\n");
            else if(r == 0) printf("Could not create the new windows service: %u\n", (uint)GetLastError());
            return EXIT_FAILURE;
        }

        printf("Done\n\n");
        printf("Note: You can now manage your AC server using services.msc and sc.exe\n\n");
    }

#endif

    printf("Please press ENTER now to start your server...\n");
    fgetc(stdin);
    printf("Starting the AC server ...\n");
    argstr.insert(0, relpath, strlen(relpath));
    system(argstr.getbuf());

    return EXIT_SUCCESS;
}
void
TTracker::InitMimeTypes()
{
	InstallMimeIfNeeded(B_DIR_MIMETYPE, kResFolderIcon,
		"Folder", "Folder container for file system items.", kTrackerSignature);

	InstallMimeIfNeeded(B_APP_MIME_TYPE, kResAppIcon,
		"Be Application", "Generic Be Application executable.", kTrackerSignature);

	InstallMimeIfNeeded(B_FILE_MIMETYPE, kResFileIcon,
		"Generic file", "Generic document file.", kTrackerSignature);

	InstallMimeIfNeeded(B_VOLUME_MIMETYPE, kResHardDiskIcon,
		"Be Volume", "Disk volume.", kTrackerSignature);

	InstallMimeIfNeeded(B_QUERY_MIMETYPE, kResQueryIcon,
		"Be Query", "Query to locate items on disks.", kTrackerSignature);

	InstallMimeIfNeeded(B_QUERY_TEMPLATE_MIMETYPE, kResQueryTemplateIcon,
		"Be Query Template", "", kTrackerSignature);

	InstallMimeIfNeeded(B_LINK_MIMETYPE, kResBrokenLinkIcon,
		"Symbolic Link", "Link to another item in the file system.", kTrackerSignature);

	InstallMimeIfNeeded(B_ROOT_MIMETYPE, kResBeBoxIcon,
		"Be Root", "File system root.", kTrackerSignature);

	InstallMimeIfNeeded(B_BOOKMARK_MIMETYPE, kResBookmarkIcon,
		"Bookmark", "Bookmark for a web page.", kNetPositiveSignature);	 
	
	{
		// install a couple of extra fields for bookmark

		ExtraAttributeLazyInstaller installer(B_BOOKMARK_MIMETYPE);
		installer.AddExtraAttribute("URL", "META:url", B_STRING_TYPE, true, true,
			170, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("Keywords", "META:keyw", B_STRING_TYPE, true, true,
			130, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("Title", "META:title", B_STRING_TYPE, true, true,
			130, B_ALIGN_LEFT, false); 
	}

	InstallMimeIfNeeded(B_PERSON_MIMETYPE, kResPersonIcon,
		"Person", "Contact information for a person.", 0);
		
	{
		ExtraAttributeLazyInstaller installer(B_PERSON_MIMETYPE);
		installer.AddExtraAttribute("Contact Name", kAttrName, B_STRING_TYPE, true, true,
			120, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("Company", kAttrCompany, B_STRING_TYPE, true, true,
			120, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("Address", kAttrAddress, B_STRING_TYPE, true, true,
			120, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("City", kAttrCity, B_STRING_TYPE, true, true,
			90, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("State", kAttrState, B_STRING_TYPE, true, true,
			50, B_ALIGN_LEFT, false);
		installer.AddExtraAttribute("Zip", kAttrZip, B_STRING_TYPE, true, true,
			50, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("Country", kAttrCountry, B_STRING_TYPE, true, true,
			120, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("E-mail", kAttrEmail, B_STRING_TYPE, true, true,
			120, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("Home Phone", kAttrHomePhone, B_STRING_TYPE, true, true,
			90, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("Work Phone", kAttrWorkPhone, B_STRING_TYPE, true, true,
			90, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("Fax", kAttrFax, B_STRING_TYPE, true, true,
			90, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("URL", kAttrURL, B_STRING_TYPE, true, true,
			120, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("Group", kAttrGroup, B_STRING_TYPE, true, true,
			120, B_ALIGN_LEFT, false); 
		installer.AddExtraAttribute("Nickname", kAttrNickname, B_STRING_TYPE, true, true,
			120, B_ALIGN_LEFT, false); 
	}

	InstallMimeIfNeeded(B_PRINTER_SPOOL_MIMETYPE, kResSpoolFileIcon,
		"Printer spool", "Printer spool file.", "application/x-vnd.Be-PRNT");
		
	{
#if B_BEOS_VERSION_DANO
		ExtraAttributeLazyInstaller installer(B_PRINTER_SPOOL_MIMETYPE);
		installer.AddExtraAttribute("Status", PSRV_SPOOL_ATTR_STATUS, B_STRING_TYPE, true, false,
			60, B_ALIGN_LEFT, false);
		installer.AddExtraAttribute("Page Count", PSRV_SPOOL_ATTR_PAGECOUNT, B_INT32_TYPE, true, false,
			40, B_ALIGN_RIGHT, false);
		installer.AddExtraAttribute("Description", PSRV_SPOOL_ATTR_DESCRIPTION, B_STRING_TYPE, true, true,
			100, B_ALIGN_LEFT, false);
		installer.AddExtraAttribute("Printer Name", PSRV_SPOOL_ATTR_PRINTER, B_STRING_TYPE, true, false,
			80, B_ALIGN_LEFT, false);
		installer.AddExtraAttribute("Job creator type", PSRV_SPOOL_ATTR_MIMETYPE, B_ASCII_TYPE, true, false,
			60, B_ALIGN_LEFT, false);
#else
		ExtraAttributeLazyInstaller installer(B_PRINTER_SPOOL_MIMETYPE);
		installer.AddExtraAttribute("Page Count", "_spool/Page Count", B_INT32_TYPE, true, false,
			40, B_ALIGN_RIGHT, false);
		installer.AddExtraAttribute("Description", "_spool/Description", B_ASCII_TYPE, true, true,
			100, B_ALIGN_LEFT, false);
		installer.AddExtraAttribute("Printer Name", "_spool/Printer", B_ASCII_TYPE, true, false,
			80, B_ALIGN_LEFT, false);
		installer.AddExtraAttribute("Job creator type", "_spool/MimeType", B_ASCII_TYPE, true, false,
			60, B_ALIGN_LEFT, false);
#endif
	}
		
	InstallMimeIfNeeded(B_PRINTER_MIMETYPE, kResGenericPrinterIcon,
		"Printer", "Printer queue.", kTrackerSignature /*application/x-vnd.Be-PRNT*/);
		// for now set tracker as a default handler for the printer because we
		// just want to open it as a folder
#if B_BEOS_VERSION_DANO
	{
		ExtraAttributeLazyInstaller installer(B_PRINTER_MIMETYPE);
		installer.AddExtraAttribute("Driver", PSRV_PRINTER_ATTR_DRV_NAME, B_STRING_TYPE, true, false,
			120, B_ALIGN_LEFT, false);
		installer.AddExtraAttribute("Transport", PSRV_PRINTER_ATTR_TRANSPORT, B_STRING_TYPE, true, false,
			60, B_ALIGN_RIGHT, false);
		installer.AddExtraAttribute("Connection", PSRV_PRINTER_ATTR_CNX, B_STRING_TYPE, true, false,
			40, B_ALIGN_LEFT, false);
		installer.AddExtraAttribute("Description", PSRV_PRINTER_ATTR_COMMENTS, B_STRING_TYPE, true, true,
			140, B_ALIGN_LEFT, false);
	}
#endif
}
Ejemplo n.º 10
0
void
QvisVisItUpdate::installVisIt()
{
    if(files.count() > 0)
    {
        // If we've created the installer before, delete it.
        if(installProcess != 0)
        {
#if !defined(_WIN32)
            disconnect(installProcess, SIGNAL(readyReadStandardOutput()),
                       this, SLOT(readInstallerStdout()));
            disconnect(installProcess, SIGNAL(readyReadStandardError()),
                       this, SLOT(readInstallerStderr()));
#endif
            disconnect(installProcess, SIGNAL(finished(int,QProcess::ExitStatus)),
                       this, SLOT(emitInstallationComplete(int)));
            delete installProcess;
            installProcess = 0;
        }

        // Set the cursor to busy and tell the user that we're installing.
        QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
        Status(tr("Installing..."), 120000);

        installProcess = new QProcess(0);
        QStringList installerArgs;
#if defined(_WIN32)
        // Install VisIt the WIN32 way by running the visit installer.
        QString installer(files.front());
#else
        QString installer;

        if(files[1].endsWith(".dmg"))
        {
            // Assume we want to do a Mac bundle so just open the volume.
            installer = "open";
            installerArgs.append(files[1]);
        }
        else
        {
            // Install VisIt the UNIX way.
            QString visit_install(files.front());
            QFile::setPermissions(visit_install, QFile::ReadOwner |
                                  QFile::WriteOwner | QFile::ExeOwner);

            // Get the VisIt installation directory.
            QString installDir(getInstallationDir());

            // Create an installation process that will run visit-install.
            installer = QString(visit_install);

            // Add installer arguments.
            installerArgs.append("-c");
            installerArgs.append(configName);
            installerArgs.append("-b");
            installerArgs.append(bankName);
            installerArgs.append(latestVersion);
            installerArgs.append(distName);
            installerArgs.append(installDir);
            connect(installProcess, SIGNAL(readyReadStandardOutput()),
                    this, SLOT(readInstallerStdout()));
            connect(installProcess, SIGNAL(readyReadStandardError()),
                    this, SLOT(readInstallerStderr()));

            debug1 << "Going to run: " << visit_install.toStdString() << " -c "
                   << configName.toStdString()
                   << " -b " << bankName.toStdString() << " "
                   << latestVersion.toStdString() << " "
                   << distName.toStdString() << " "
                   << installDir.toStdString() << endl;
        }
#endif
        debug1 << "Connecting finished->emitInstallationComplete" << endl;
        // We want to know when the installer completes.
        connect(installProcess, SIGNAL(finished(int,QProcess::ExitStatus)),
                this, SLOT(emitInstallationComplete(int)));

        // Start the visit installer.
        installProcess->start(installer, installerArgs);
    }
Ejemplo n.º 11
0
int main(int argc, char** argv){
	setlocale( LC_ALL, "");
	bindtextdomain( "gpc", LOCALEDIR);
	textdomain( "gpc" );
	Gtk::Main app(argc, argv);
	Glib::thread_init();
	GrubEnv env;
	GPC presenter(env);
	GrublistCfg listcfg(env);
	GrublistCfgDlgGtk listCfgView;
	SettingsManagerDataStore settings(env);
	SettingsManagerDataStore settingsOnDisk(env);
	GrubInstaller installer(env);
	GrubInstallDlgGtk installDlg;
	ScriptAddDlgGtk scriptAddDlg;
	MountTable mountTable;
	PartitionChooserGtk partitionChooser;
	GrublistCfg savedListCfg(env);
	FbResolutionsGetter fbResolutionsGetter;
	GrubSettingsDlgGtk settingsDlg;
	DeviceDataList deviceDataList;
	AboutDialogGtk aboutDialog;
	GlibMutex listCfgMutex1;
	GlibMutex listCfgMutex2;
	GlibThreadController threadC(presenter);
	presenter.setListCfg(listcfg);
	presenter.setListCfgDlg(listCfgView);
	presenter.setSettingsDialog(settingsDlg);
	presenter.setSettingsManager(settings);
	presenter.setSettingsBuffer(settingsOnDisk);
	presenter.setInstaller(installer);
	presenter.setInstallDlg(installDlg);
	presenter.setScriptAddDlg(scriptAddDlg);
	presenter.setPartitionChooser(partitionChooser);
	presenter.setSavedListCfg(savedListCfg);
	presenter.setFbResolutionsGetter(fbResolutionsGetter);
	presenter.setDeviceDataList(deviceDataList);
	presenter.setMountTable(mountTable);
	presenter.setAboutDialog(aboutDialog);
	presenter.setThreadController(threadC);
	EventListener evt(presenter);
	listCfgView.setEventListener(evt);
	installDlg.setEventListener(evt);
	scriptAddDlg.setEventListener(evt);
	settingsDlg.setEventListener(evt);
	partitionChooser.setEventListener(evt);
	listcfg.setEventListener(evt);
	installer.setEventListener(evt);
	fbResolutionsGetter.setEventListener(evt);
	StreamLogger logger(std::cout);
	presenter.setLogger(logger);
	listcfg.setLogger(logger);
	listCfgView.setLogger(logger);
	settings.setLogger(logger);
	settingsOnDisk.setLogger(logger);
	installer.setLogger(logger);
	installDlg.setLogger(logger);
	scriptAddDlg.setLogger(logger);
	mountTable.setLogger(logger);
	partitionChooser.setLogger(logger);
	savedListCfg.setLogger(logger);
	fbResolutionsGetter.setLogger(logger);
	settingsDlg.setLogger(logger);
	deviceDataList.setLogger(logger);
	aboutDialog.setLogger(logger);
	listCfgMutex1.setLogger(logger);
	listCfgMutex2.setLogger(logger);
	threadC.setLogger(logger);
	env.setLogger(logger);
	listcfg.setMutex(listCfgMutex1);
	savedListCfg.setMutex(listCfgMutex2);
	presenter.init();
	app.run();
}