[mojosetup] Add a --noprompt option that disables the 'Finish' dialog

Francois Gouget fgouget at codeweavers.com
Mon May 23 18:06:43 EDT 2011


# HG changeset patch
# User Francois Gouget <fgouget at codeweavers.com>
# Date 1306186294 -7200
# Node ID f0caa14547d2df2ee751d1cf1acf7af09f7bf7a3
# Parent  69b8f674b46cad4d1ac7c49a34d9f09da004d4c8
Add a --noprompt option that disables the 'Finish' dialog.

This makes it possible to do automated installations by combining the --i-agree-to-all-licenses, --noprompt and --destination options.

diff -r 69b8f674b46c -r f0caa14547d2 scripts/mojosetup_mainline.lua
--- a/scripts/mojosetup_mainline.lua	Tue Jan 25 01:20:58 2011 -0500
+++ b/scripts/mojosetup_mainline.lua	Mon May 23 23:31:34 2011 +0200
@@ -1270,6 +1270,7 @@
     local skipeulas = MojoSetup.cmdline("i-agree-to-all-licenses")
     local skipreadmes = MojoSetup.cmdline("noreadme")
     local skipoptions = MojoSetup.cmdline("nooptions")
+    local skipprompt = MojoSetup.cmdline("noprompt")
 
     -- !!! FIXME: try to sanity check everything we can here
     -- !!! FIXME:  (unsupported URLs, bogus media IDs, etc.)
@@ -1792,9 +1793,11 @@
     end
 
     -- Next stage: show results gui
-    stages[#stages+1] = function(thisstage, maxstage)
-        MojoSetup.gui.final(_("Installation was successful."))
-        return 1  -- go forward.
+    if not skipprompt then
+        stages[#stages+1] = function(thisstage, maxstage)
+            MojoSetup.gui.final(_("Installation was successful."))
+            return 1  -- go forward.
+        end
     end
 
     -- Now make all this happen.



More information about the mojosetup mailing list