2 * Final result message of drivers acquiring installation utility
3 * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; exactly version 2 of June 1991 is required
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "final.h" /* self */
23 #include <glib/gmessages.h>
26 #include <glib/gstring.h>
29 #include <captive/macros.h>
33 #define FILENAME_ETC_FSTAB "/etc/fstab"
36 gchar *final_text(gboolean all_modules_found)
40 struct mntent *mntent;
42 gboolean any_dirs_found;
44 if (!all_modules_found)
46 "Although essential modules (\"ntoskrnl.exe\" and \"ntfs.sys\") are available "
47 "you may still want to get their better version and/or more modules. ");
49 base=_("All needed modules were found in their best preferred versions.");
50 gstring=g_string_new(base);
54 if (!(mntentfiler=setmntent(FILENAME_ETC_FSTAB,"r")))
55 g_error(_("Cannot open \"%s\" for reading: %m"),FILENAME_ETC_FSTAB);
56 while ((mntent=getmntent(mntentfiler))) {
57 if (strcmp(mntent->mnt_type,"captive-ntfs"))
59 if (!any_dirs_found) {
60 gstring=g_string_append(gstring,captive_printf_alloca(_("\n"
61 "Found NTFS disk partitions are prepared in %s. "
62 "You can mount them by commands mount(8) or usermount(1) such as:\n"
63 "\tmount /mnt/captive-LABEL_C\n"
64 "Available captive-ntfs partitions:"),FILENAME_ETC_FSTAB));
67 gstring=g_string_append(gstring,"\n\t");
68 gstring=g_string_append(gstring,mntent->mnt_dir);
71 gstring=g_string_append(gstring,_("\n"
72 "Despite drivers were found no NTFS disk partitions were found on your computer. "
73 "You still can mount read/write NTFS partitions by using filesystem type 'captive-ntfs' such as:\n"
74 "\tmkdir /mnt/captive-LABEL_C\n"
75 "\tmount -t captive-ntfs /dev/hda1 /mnt/captive-LABEL_C"));
76 if (1!=endmntent(mntentfiler))
77 g_warning(_("Cannot close \"%s\" after reading: %m"),FILENAME_ETC_FSTAB);
79 return g_string_free(gstring,
80 FALSE); /* free_segment */