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: OpenPGP_0x27AE2304B4974851.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to