2 -- $Id: main.lua,v 1.19 2005/04/03 20:28:22 cpressey Exp $
3 -- Main menu for demonstration application for dfuibe_lua.
5 App = require "app"; App.init()
11 require "target_system"
15 GetText = require "gettext"
16 GetText.set_package("dfuibe_lua")
17 GetText.set_locale_dir("/usr/local/share/locale")
21 name = "Demonstration App",
24 transport = "tcp", -- XXX default from command line options...
30 -- Set one of the following options to run this installer in `mock mode':
32 -- App.option.fake_execution = true -- don't actually execute anything
33 -- App.option.confirm_execution = true -- always ask before executing
35 -- You might also wish to change the root from whence things are drawn:
37 -- App.dir.root = "/usr/release/root/" -- or what have you
39 -- These can be set from the dfuibe_lua command line like so:
40 -- option.fake_execution=true dir.root=/usr/release/root
43 -- Create a storage-descriptor for the application.
44 App.state.storage = StorageDescriptor.new()
45 App.state.storage:survey()
47 -- put welcome notify-box here
50 -- First let the user configure the important user-interface aspects
51 -- of their system (language, keyboard/screenmap if on console,
52 -- internet connection for logging to remote machine over net, etc.)
54 -- These are termed "pre-install tasks" even though that is a slight
55 -- misnomer (and an unfortunate acronym):
61 short_desc = "Choose one of the following tasks to perform.",
62 continue_constraint = function(result)
63 if App.state.do_reboot then
72 -- If there is a target system mounted, unmount it before leaving.
74 if App.state.target ~= nil and App.state.target:is_mounted() then
75 if not App.state.target:unmount() then
77 _("Warning: subpartitions were not correctly unmounted.")
84 if App.state.do_reboot then
85 -- exit with reboot code