]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Add license dialog to the installer.
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 20 Oct 2010 18:01:24 +0000 (20:01 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 20 Oct 2010 18:01:24 +0000 (20:01 +0200)
langs/de/install/lang_de.c
langs/en/install/lang_en.c
langs/es/install/lang_es.c
langs/fr/install/lang_fr.c
make.sh
src/install+setup/install/main.c
src/install+setup/libsmooth/libsmooth.h
src/install+setup/libsmooth/main.c

index b59b5d064d3e9a95cf90bdee2ad44b8bd3e9f947..0a1d275371c68153b17811d54584c4e3116c1b7a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * German (de) Data File
  *
- * This file is part of the IPCop Firewall.
+ * This file is part of the IPFire.
  * 
  * IPCop is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with IPCop; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  * 
+ * (c) IPFire Team  <info@ipfire.org>
+ *
+ * based on work of SmoothWall and IPCop
+ *
  * (c) The SmoothWall Team
  * 
  * IPCop translation
@@ -567,5 +571,10 @@ char *de_tr[] = {
 "Starte den DHCP-Server ...",
 /* TR_DHCP_STOPSERVER */
 "Stoppe den DHCP-Server ...",
+/* TR_LICENSE_ACCEPT */
+"Ich akzeptiere diese Lizens.",
+/* TR_LICENSE_NOT_ACCEPTED */
+"Die Lizens wurde nicht akzeptiert. Abbruch!",
+
 }; 
   
index 939d627ad7a1d870bedcfc1d11f3728c1c20c306..690a5868cf5bb74f3ba197ce0848ce2ebf7d21cb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * English (en) Data File
  *
- * This file is part of the IPCop Firewall.
+ * This file is part of the IPFire.
  * 
  * IPCop is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with IPCop; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  * 
+ * (c) IPFire Team  <info@ipfire.org>
+ *
+ * based on work of SmoothWall and IPCop
+ *
  * (c) The SmoothWall Team
  *  
  */
@@ -563,6 +567,10 @@ char *en_tr[] = {
 "Starting DHCP-Server ...",
 /* TR_DHCP_STOPSERVER */
 "Stopping DHCP-Server ...",
+/* TR_LICENSE_ACCEPT */
+"I accept this license.",
+/* TR_LICENSE_NOT_ACCEPTED */
+"License not accepted. Exit!",
 
 }; 
   
index 2e32de279ba6220c039abd997562c0958b26a11e..b9601377b0f4d1c1978cc03084d166a41bf6f735 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Spanish (es) Data File
  *
- * This file is part of the IPFire Firewall.
+ * This file is part of the IPFire.
  * 
  * IPFire is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -17,6 +17,8 @@
  * along with IPFire; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  *
+ * (c) IPFire Team  <info@ipfire.org>
+ *
  */
  
 #include "libsmooth.h"
@@ -561,6 +563,10 @@ char *es_tr[] = {
 "Iniciando Servidor DHCP ...",
 /* TR_DHCP_STOPSERVER */
 "Deteniendo Servidor DHCP ...",
+/* TR_LICENSE_ACCEPT */
+"I accept this license.",
+/* TR_LICENSE_NOT_ACCEPTED */
+"License not accepted. Exit!",
 
 }; 
   
index 2147284ddc88ffaf13a30e33eb7bef968e5ee864..25c313c7c4877fc035fbfdd03e0d40f6c58b5280 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * French (fr) Data File
  *
- * This file is part of the IPCop Firewall.
+ * This file is part of the IPFire.
  * 
  * IPCop is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -17,8 +17,8 @@
  * along with IPCop; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  * 
- * (c) The SmoothWall Team
- *  
+ * (c) IPFire Team  <info@ipfire.org>
+ *
  */
  
 #include "libsmooth.h"
@@ -563,6 +563,10 @@ char *fr_tr[] = {
 "Démarrage du serveur DHCP ...",
 /* TR_DHCP_STOPSERVER */
 "Arrêt du serveur DHCP ...",
+/* TR_LICENSE_ACCEPT */
+"I accept this license.",
+/* TR_LICENSE_NOT_ACCEPTED */
+"License not accepted. Exit!",
 
 }; 
   
diff --git a/make.sh b/make.sh
index 1f986bc826b98371e80e651b6170faf50ebf2481..cc2d3c500799143e2df5ba28de2a8ebf759f3304 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -689,6 +689,7 @@ buildinstaller() {
   ipfiremake mbr
   ipfiremake memtest
   ipfiremake installer
+  cp -f $BASEDIR/doc/COPYING $BASEDIR/build/install/initrd/
   installmake strip
   ipfiremake initrd
 }
index a46de921f70bebbe9aafd46712c3c97f5a42d578..dc3ac1934029f7be773e966de70af2eedba719e5 100644 (file)
@@ -35,6 +35,9 @@ extern char *fr_tr[];
 
 int main(int argc, char *argv[])
 {
+
+       char discl_msg[40000] = "Disclaimer\n";
+
        char *langnames[] = { "Deutsch", "English", "Français", "Español", NULL };
        char *shortlangnames[] = { "de", "en", "fr", "es", NULL };
        char **langtrs[] = { de_tr, en_tr, fr_tr, es_tr, NULL };
@@ -57,7 +60,7 @@ int main(int argc, char *argv[])
        int allok_fastexit=0;
        int raid_disk = 0;
        struct keyvalue *ethernetkv = initkeyvalues();
-       FILE *handle, *cmdfile;
+       FILE *handle, *cmdfile, *copying;
        char line[STRING_SIZE];
        char string[STRING_SIZE];
        long memory = 0, disk = 0, free;
@@ -108,6 +111,16 @@ int main(int argc, char *argv[])
                }               
        }
 
+       // Read gpl ...
+       if (! (copying = fopen("/COPYING", "r")))
+       {
+               fprintf(flog,      "Couldn't open gpl (/COPYING)\n");
+               sprintf(discl_msg, "Couldn't open gpl (/COPYING)\n");
+       } else {
+               fread(discl_msg, 1, 40000, copying);
+               fclose(copying);
+       }
+
        // Load common modules
        mysystem("/sbin/modprobe iso9660"); // CDROM
        mysystem("/sbin/modprobe ext2"); // Boot patition
@@ -135,6 +148,13 @@ int main(int argc, char *argv[])
        sprintf(message, ctr[TR_WELCOME], NAME);
        newtWinMessage(title, ctr[TR_OK], message);
 
+       if (!unattended) {
+               if (disclaimerbox(discl_msg)==0) {
+                       errorbox(ctr[TR_LICENSE_NOT_ACCEPTED]);
+                       goto EXIT;
+               }
+       }
+
        switch (mysystem("/bin/mountsource.sh")) {
            case 0:
                                break;
index 54d702926befd789ea7088e2e978358435779d8d..fb381936374091c5ba136a6efe3546a119cb8c74 100644 (file)
@@ -79,6 +79,8 @@ void reboot(void);
 void stripnl(char *s);
 int mysystem(char *command);
 void errorbox(char *message);
+int statuswindowscroll(int width, int height, char *title, char *text, ...);
+int disclaimerbox(char *message);
 void statuswindow(int width, int height, char *title, char *text, ...);
 int runcommandwithprogress(int width, int height, char *title, char *command,
        int lines, char *text, ...);
index 710183a2156228154631c605cf0c3dc89c4a098f..8de8c231e9d9eb8c4a329d6a17c0f32ad77f69ee 100644 (file)
@@ -45,6 +45,61 @@ void errorbox(char *message)
        newtWinMessage(ctr[TR_ERROR], ctr[TR_OK], message);
 }
 
+int scrollmsgbox(int width, int height, char *title, char *text, ...)
+{
+       int rc = 0;
+       newtComponent t, f, b, c;
+       char *buf = NULL;
+       char checkbox;
+       int size = 0;
+       int i = 0;
+       va_list args;
+
+       va_start(args, text);
+
+       do {
+               size += 40000;
+               if (buf) free(buf);
+               buf = malloc(size);
+               i = vsnprintf(buf, size, text, args);
+       } while (i == size);
+
+       va_end(args);
+
+       newtCenteredWindow(width, height, title);
+
+       b = newtCompactButton(width - 15 ,height - 2, ctr[TR_OK]);
+       c = newtCheckbox(3, height - 2, ctr[TR_LICENSE_ACCEPT], ' ', " *", &checkbox);
+
+       t = newtTextbox(1, 1, width - 2, height - 4, NEWT_TEXTBOX_WRAP+NEWT_TEXTBOX_SCROLL);
+       newtTextboxSetText(t, buf);
+
+       f = newtForm(NULL, NULL, 0);
+       free(buf);
+
+       newtFormAddComponent(f, c);
+       newtFormAddComponent(f, b);
+       newtFormAddComponent(f, t);
+
+       newtRunForm(f);
+       if (checkbox=='*') rc=1;
+       newtFormDestroy(f);
+       return rc;
+}
+
+int disclaimerbox(char *message)
+{
+       int rc;
+       char title[STRING_SIZE];
+       
+       sprintf (title, "%s v%s - %s", NAME, VERSION, SLOGAN);
+       rc = scrollmsgbox(75, 20, title, message);
+       newtPopWindow();
+       
+       return rc;
+}
+
+
 void statuswindow(int width, int height, char *title, char *text, ...)
 {
        newtComponent t, f;