Closed Bug 157672 Opened 22 years ago Closed 22 years ago

unix install wizard "silent" mode not implemented

Categories

(SeaMonkey :: Installer, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ajschult784, Assigned: dveditz)

Details

Attachments

(2 files, 1 obsolete file)

silent mode installation, "-ms", is parsed by the unix install wizard, but then
ignored.  windows and os2 installers seem to have this implemented.

I have a patch that seems to work.
Attached patch patch (obsolete) — Splinter Review
patch cuts out all GUI for "MODE_SILENT".
ErrorHandler prints a message to the console
CRC Check / CRC Failure / Connection dropped print messages too

the connection dropped message is hardcoded because the one from installer.ini
is inappropriate for silent-mode install (hit resume or cancel).  I guess there
needs to be a separate message for it.	Also, I don't know if it should try to
reconnect (resume) or quit.  This patch has it quit.

an X display is not required for the install, although it still tries to launch
Mozilla when its done installing.

tested with XPIs already downloaded, having the installer download them and a
few of the error conditions.
Samir, could you review this patch?
Status: NEW → ASSIGNED
While you're in there, can we throw in another flag not to launch Moz? I would
imagine it would be insanely simple to add. I always have to cancel it since I
run mozilla as a different user. Slightly annoying, and a reasonable option.

> This patch has it quit.

That's reasonable. Not worth coding a interactive command line query, and
auto-retry is probably a bad idea.
> While you're in there, can we throw in another flag not to launch Moz?

That sort of already exists.  You can set what apps start in config.ini:

;-------------------------------------------------------------------------
[RunApp0]
;-------------------------------------------------------------------------
Target=mozilla
Arguments=-installer


*HOWEVER*, the windows wizard does have a commandline option (-ira) to ignore
anything in a RunApp section.  adding it to the unix wizard should be trivial.
QA Contact: bugzilla → ktrina
Keywords: patch, review
Comment on attachment 91467 [details] [diff] [review]
patch

r=dveditz
Attachment #91467 - Flags: review+
Comment on attachment 91467 [details] [diff] [review]
patch

Could you attach a diff -w patch please?  (And sorry for the delayed response.)

>+    if (gCtx->opt->mMode == nsXIOptions::MODE_SILENT) {
>+       fprintf (stderr, "ERROR: %s\n", msg);

The ``ERROR'' string should already be embedded by now in msg.

>@@ -786,6 +794,9 @@
>     static int lastTotal = 0;
>     static int lastBytesRd = 0;
> 
>+    if (gCtx->opt->mMode == nsXIOptions::MODE_SILENT)
>+       return 0;
>+

Instead of adding code to the callbacks themselves just test for MODE_SILENT
and pass in NULL when initiating actions that accept the callback; e.g., pass
NULL instead of DownloadCB when doing an nsHTTPConn::Get().

> void
>@@ -1153,6 +1169,11 @@
> {
>     GtkWidget *label, *okButton, *packer;
> 
>+    if (gCtx->opt->mMode == nsXIOptions::MODE_SILENT) {
>+       fprintf (stderr, "%s\n", gCtx->Res("CRC_CHECK"));
>+       return;

We should use the ErrorHandler().

>@@ -1187,6 +1208,11 @@
> 
>     // throw up dialog informing user to press resume
>     // or to cancel out
>+    if (gCtx->opt->mMode == nsXIOptions::MODE_SILENT) {
>+       fprintf (stderr, "%s\n", gCtx->Res("CRC_FAILED"));
>+       return OK;
>+    }

We should use the ErrorHandler().

>@@ -1220,6 +1246,11 @@
> 
>     // throw up dialog informing user to press resume
>     // or to cancel out
>+    if (gCtx->opt->mMode == nsXIOptions::MODE_SILENT) {
>+       fprintf (stderr, "A network connection failure occured\n");

String needs to come from install.properties using gCtx->Res().
Attachment #91467 - Flags: review+ → needs-work+
Attachment #91467 - Attachment is obsolete: true
the new patch:
1. uses NULL for the callbacks.  also caught a few of the other gtk-only calls
2. does E_CRC_FAILED for CRC_CHECK and CRC_FAILURE.  do we need a new error code
for E_CRC_CHECK?
3. does E_DOWNLOAD for the connection dropped
4. adds strings to installer.ini for the last three error codes, most
importantly E_CRC_FAILED, which just printed "Fatal error [-628]: (null)" before.
Samir, can you please review the updated patch?

Andrew, the -ira might be a good idea... when I change the [RunApp0] target to
'echo' or another no op, it shows something like:

Gdk-ERROR **: X connection to :0.0 broken (explicit kill or server shutdown)
> Andrew, the -ira might be a good idea

bug 158033
Attachment #101656 - Flags: review?(sgehani)
Attachment #101657 - Flags: review+
r=sgehani
Attachment #101657 - Flags: superreview?(dveditz)
Comment on attachment 101656 [details] [diff] [review]
patch with Samir's suggestions (diff -u)

sr=dveditz

(-w diff was helpful, but the approval needs to go on the patch you're actually
checking in)
Attachment #101656 - Flags: superreview+
Comment on attachment 101657 [details] [diff] [review]
same patch (diff -w)

reviewed other patch
Attachment #101657 - Flags: superreview?(dveditz)
Attachment #101656 - Flags: checkin?(dveditz)
Comment on attachment 101656 [details] [diff] [review]
patch with Samir's suggestions (diff -u)

marking review+ based on the r= for the other patch
Attachment #101656 - Flags: review?(sgehani)
Attachment #101656 - Flags: review+
Attachment #101656 - Flags: checkin?(dveditz)
Attachment #101656 - Flags: checkin?
Whiteboard: checkin: biesi ?
checked in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Whiteboard: checkin: biesi ?
Thanks biesi for the checkin and thanks Andrew for the patch !
verified code fixes and ran
Status: RESOLVED → VERIFIED
QA Contact: ktrina → gbush
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: