public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Thomas Schweikle <tschweikle@bfs.de>
To: Brian Inglis via Cygwin <cygwin@cygwin.com>
Subject: Re: cygwin does not run quietly if --quiet-mode given on commandline
Date: Thu, 30 Mar 2023 19:00:57 +0000	[thread overview]
Message-ID: <4eb6b24b-d0cb-03a0-8a0d-bc80dac13d38@bfs.de> (raw)
In-Reply-To: <e9470a95-cdab-a5b3-cd35-b493adb85079@Shaw.ca>


[-- Attachment #1.1.1: Type: text/plain, Size: 3807 bytes --]



Am Do., 30.März.2023 um 18:24:20 schrieb Brian Inglis via Cygwin:
> On 2023-03-30 08:23, Thomas Schweikle via Cygwin wrote:
>> starting cygwin setup-x86_64.exe with parameters:
>> setup-x86_64.exe ^
>>    --verbose ^
>>    --delete-orphans ^
>>    --local-package-dir "C:\WINDOWS\ccmcache\4r\installdata" ^
>>    --no-desktop ^
>>    --proxy "<proxy-host:proxy-port>" ^
>>    --root "C:\cygwin" ^
>>    --upgrade-also ^
>>    --quiet-mode ^
>>    --wait
>> It does not matter if "--quiet-mode" is given or not: in all cases 
>> cygwin setup opens a window showing setup progress and the real bad 
>> thing: allows the user on whom desktop the window is shown to stop the 
>> upgrade!
>> I need a really unattended upgrade with some log written what setup 
>> had done.
>> And is it a bug? As far as I could find "--quiet-mode" means no 
>> window, no messages at all - am I wrong and all those interpreting it 
>> the same way?
> 
> Might want to try dropping:
> 
>  >    --verbose ^
>  >    --delete-orphans ^
>  >    --wait

If i drop "--verbose" it only does less output to console.

"--delete-orphans" is supposed to delete packages not found on servers 
any more. It is sometimes needed to have setup update cygwin without 
hassles. But I am aware of it removing more than necessary sometimes.

"--wait" is necessary. If it is not given, setup will immediate return, 
triggering following routines -- bad if some rely on cygwin upgraded and 
functional.

What I found after trying: the only way is to make this setup window 
hidden. It is opened in all cases. It is opened even before given 
options are evaluated. Thus "--quiet" is nearly useless: the window is 
open before setup evaluates not to open a window.

I was able to get what i wanted mostly with:

$SetupOpts = @{
     FilePath = $isf
     ArgumentList = @(
         "--verbose",
         "--delete-orphans",
         "--upgrade-also",
         "--quiet-mode",
         "--wait",
         "--no-desktop",
         "--local-package-dir", "`"C:\WINDOWS\ccmcache\4r\installdata`"",
         "--proxy", "`"<proxy-host:proxy-port>`"",
         "--root", "`"C:\cygwin`""
     )
     WindowStyle = "Hidden"
     PassThru = $True
     Wait = $True
     RedirectStandardOutput = "$isl"
     RedirectStandardError = "$ise"
}
$proc = Start-Process @SetupOpts

It behaves slightly different if "--wait" is only flagged for setup and 
not the calling process "Wait = $True". If "--wait" is given, but not 
"Wait = $True" it returns before final cleanup is done (PowerShell calls 
a hidden cmd.exe, which in tune calls setup-x86_64.exe). In case both 
waits are given it returns after everything is done.

If only "Wait = $True" was given it returns nearly immediately -- setup 
has not finished then.


or, from cmd.exe

setup-x86_64.exe ^
   --verbose ^
   --delete-orphans ^
   --local-package-dir "C:\WINDOWS\ccmcache\4r\installdata" ^
   --no-desktop ^
   --proxy "<proxy-host:proxy-port>" ^
   --package-manager ^
   --root "C:\cygwin" ^
   --upgrade-also ^
   --wait

> and add -O|--only-site -s|--site /url/ -s|--site ... closest/fastest 

Found this only a good idea if mirrors where reliable. But they are not. 
If one goes down you'll need a backup. Or you've got your own local 
mirror. Not too difficult to set up, but takes a lot of storage. Maybe 
in near future.

It is way to often the selected mirror is out of order. Giving --site or 
--only-site is then a point upgrades/installs fail.

> mirrors as long as it is/they are active in 
> https://cygwin.com/mirrors.lst - probably best if they are different 
> protocols at the same mirror (handles cert expiry) and/or reliable backup.
-- 
Thomas


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2521 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 321 bytes --]

      reply	other threads:[~2023-03-30 19:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 14:23 Thomas Schweikle
2023-03-30 16:24 ` Brian Inglis
2023-03-30 19:00   ` Thomas Schweikle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4eb6b24b-d0cb-03a0-8a0d-bc80dac13d38@bfs.de \
    --to=tschweikle@bfs.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).