Exemplo n.º 1
0
int main()
{
   installer_init();

   // Display Main Menu
   for(;;)
   {
      commlink_start_service();
      gui_do_menu(main_menu, &main_font, 0, 0, "Pseudo Saturn Installer v" INSTALLER_VERSION, MTYPE_CENTER, -1);

      main_font.transparent = 1;
      gui_clear_scr(&main_font);
   }

   return 0;
}
Exemplo n.º 2
0
bool
self_uninstall()
{
	bool ret;
	char pname[MAX_PATH];
	struct installer inst;

	if (!get_program_name(pname, MAX_PATH))
		return false;
	DEBUG(LOG_DEFAULT, "progname is %s\n", pname);
	installer_init(&inst, pname);

	ret = installer_uninstall(&inst);

	installer_clear(&inst);

	return ret;
}
Exemplo n.º 3
0
bool
self_install()
{
	struct installer inst;
	char home[MAX_PATH];
	char pname[MAX_PATH];

	DEBUG(LOG_DEFAULT, "installation init\n");

	if (!get_program_name(pname, MAX_PATH))
		return false;
	DEBUG(LOG_DEFAULT, "progname is %s\n", pname);
	installer_init(&inst, pname);
	if (installer_get_target_path(&inst, home, sizeof(home)))
		return false;
	installer_install(&inst, home);

	installer_clear(&inst);

	return true;
}
Exemplo n.º 4
0
Arquivo: rpm.c Projeto: clee/razor
RAZOR_EXPORT int
razor_rpm_install(struct razor_rpm *rpm, const char *root)
{
	struct installer installer;
	struct cpio_file_header *header;
	struct stat buf;
	unsigned int mode;
	char *path;
	size_t filesize;

	assert (rpm != NULL);
	assert (root != NULL);

	installer.rpm = rpm;
	installer.root = root;

	/* FIXME: Only do this before a transaction, not per rpm. */
	if (stat(root, &buf) < 0 || !S_ISDIR(buf.st_mode)) {
		fprintf(stderr,
			"root installation directory \"%s\" does not exist\n",
			root);
		return -1;
	}

	if (installer_init(&installer))
		return -1;

	run_script(&installer, RPMTAG_PREINPROG, RPMTAG_PREIN);

	while (installer.stream.avail_in > 0) {
		installer.rest = sizeof *header;
		if (installer_inflate(&installer))
			return -1;

		header = (struct cpio_file_header *) installer.buffer;
		mode = fixed_hex_to_ulong(header->mode, sizeof header->mode);
		filesize = fixed_hex_to_ulong(header->filesize,
					      sizeof header->filesize);

		installer.rest = fixed_hex_to_ulong(header->namesize,
						    sizeof header->namesize);

		if (installer_inflate(&installer) ||
		    installer_align(&installer, 4))
			return -1;

		path = (char *) installer.buffer;
		/* This convention is so lame... */
		if (strcmp(path, "TRAILER!!!") == 0)
			break;

		installer.rest = filesize;
		if (create_path(&installer, path + 1, mode) < 0)
			return -1;
		if (installer_align(&installer, 4))
			return -1;
	}

	if (installer_finish(&installer))
		return -1;

	run_script(&installer, RPMTAG_POSTINPROG, RPMTAG_POSTIN);

	return 0;
}