installing/updating silently

Thomas Schweikle tschweikle@bfs.de
Thu Apr 20 13:22:43 GMT 2023


Hi!

Trying to install or upgrade cygwin silently. Calling a newly downloaded 
setup-x86_64.exe (Power Shell-snipplets):

$URL = "https://www.cygwin.com/setup-x86_64.exe"
$dlp = "C:\INSTALL\Apps\c\cygwin"
$nsf = "$dlp\setup-x86_64.new"
$isf = "$dlp\setup-x86_64.exe"
$isl = "$dlp\setup-x86_64.log"
$ise = "$dlp\setup-x86_64.err"
$cll = "$dlp\setup-x86_64.cll"

$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $URL -OutFile $nsf

$ProgressPreference = 'Continue'
if (Test-Path -Path $isf -PathType Leaf) {
     Remove-Item -Path $isf
}
Rename-Item -Path $nsf -NewName $isf

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

Setup starts, but then does nothing. It does create the logs, but they 
do not contain anything. They stay empty. Anything missing from the options?

Calling the power shell script from an elevated prompt directly seems to 
work as expected. It bails out if it is not an elevated prompt. Calling 
it remotely it hangs and nothing happens. Any idea? Any hint?
-- 
Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x27AE2304B4974851.asc
Type: application/pgp-keys
Size: 2480 bytes
Desc: OpenPGP public key
URL: <https://cygwin.com/pipermail/cygwin/attachments/20230420/02b52941/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 321 bytes
Desc: OpenPGP digital signature
URL: <https://cygwin.com/pipermail/cygwin/attachments/20230420/02b52941/attachment.sig>


More information about the Cygwin mailing list