Running DownloadUpdates.sh in Cygwin

Running DownloadUpdates.sh in Cygwin

Postby jonathanbrickman0000 » 11.02.2016, 18:54

Many thanks for such a wonderful tool!!!!

I kept on getting errors without log entries when trying UpdateGenerator.exe, despite fixing the Sysinternals static links (and thanks for that!); there could be something wrong in this Windows 8.1 setup, not quite sure, it works well otherwise. It could, possibly, be LAN firewall, I do not have a way to find out how much HTTP/HTTPS massaging is being done here. But I thought that the bash script DownloadUpdates.sh might possibly behave in a fashion more traceable and/or predictable, so I tried it (after commenting out the OS detection code), and it is working well in Cygwin so far.

So my question is fundamentally, are there are gotchas I should be watching for in the result generated in this way?
jonathanbrickman0000
 

Re: Running DownloadUpdates.sh in Cygwin

Postby aker » 11.02.2016, 23:22

Working sysinternal links (at least at the moment):
:arrow: viewtopic.php?f=3&t=5440&p=17846#p17845

Please check, if .\bin\wget.exe is allowed to access the servers listed here:
viewtopic.php?f=7&t=3863

For some debugging:
Does UpdateGenerator.exe start? (maybe your AV-software generally treats all AutoIT-programs as malware)
Does it display any UI?
If you press the "Start"-button, could you see a black window (at least for a short time)?
Wer Rechtschreibfehler findet, darf sie behalten oder an den Meistbietenden versteigern. / Everybody finding a misspelling is allowed to keep or sell it.
aker

WSUS Offline Update „Community Edition“
https://gitlab.com/wsusoffline/wsusoffline/-/releases
aker
 
Posts: 3999
Joined: 02.03.2011, 15:32

Re: Running DownloadUpdates.sh in Cygwin

Postby jonathanbrickman0000 » 12.02.2016, 18:20

Found errors in the downloads test, so stopped there for now. The first four were successful. But "wget download.sysinternals.com" gave an ERROR 400: Bad Request, and "wget xpsp.dlservice.microsoft.com" gave ERROR 404: Not Found.
jonathanbrickman0000
 

Re: Running DownloadUpdates.sh in Cygwin

Postby aker » 12.02.2016, 22:48

That helped a bit. wget.exe seems to work.
Please answer my debugging questions now.
Wer Rechtschreibfehler findet, darf sie behalten oder an den Meistbietenden versteigern. / Everybody finding a misspelling is allowed to keep or sell it.
aker

WSUS Offline Update „Community Edition“
https://gitlab.com/wsusoffline/wsusoffline/-/releases
aker
 
Posts: 3999
Joined: 02.03.2011, 15:32

Re: Running DownloadUpdates.sh in Cygwin

Postby slycordinator » 03.04.2019, 06:48

I know that this is old, but I was able to get it to work on cygwin command line.
On line 337 of the download-updates.bash I changed:
Code: Select all
Linux | FreeBSD)

to:
Code: Select all
Linux | FreeBSD | CYGWIN_NT-10.0)


It will call common-tasks/30-check-needed-applications.bash
This will give errors if you don't have xmlstarlet, wget, and/or hashdeep.
So, you must install the xmlstarlet, wget, and md5deep cygwin packages.

It gives warnings if you don't have dialog and/or rsync. There are cygwin packages for both.

Also, it gives a warning if you don't have gvfs-trash (from the gvfs-bin package) or trash-put (from the trash-cli package).
There's no cygwin package for either of those, but trash-cli can be installed through pip.
Code: Select all
pip install trash-cli

or:
Code: Select all
pip2 install trash-cli

Code: Select all
pip3 install trash-cli


The pip calls depend on which versions you have installed. Often cygwin defaults to only having the "pip2" command available.
slycordinator
 
Posts: 8
Joined: 23.02.2019, 07:48

Re: Running DownloadUpdates.sh in Cygwin

Postby aker » 03.04.2019, 10:25

Why do you want to use cygwin?

If you‘re on Windows, why don‘t use DownloadUpdates.cmd?
Wer Rechtschreibfehler findet, darf sie behalten oder an den Meistbietenden versteigern. / Everybody finding a misspelling is allowed to keep or sell it.
aker

WSUS Offline Update „Community Edition“
https://gitlab.com/wsusoffline/wsusoffline/-/releases
aker
 
Posts: 3999
Joined: 02.03.2011, 15:32

Re: Running DownloadUpdates.sh in Cygwin

Postby slycordinator » 03.04.2019, 11:26

I'm personally more comfortable on a unix-like command line...

Also, earlier I was mostly just interested in seeing if it would work.

Incidentally, one or two of the other associated scripts give command-not-found when unzip isn't installed (and I assume this would happen on my linux boxes as well).
slycordinator
 
Posts: 8
Joined: 23.02.2019, 07:48

Re: Running DownloadUpdates.sh in Cygwin

Postby hbuhrmester » 03.04.2019, 16:09

There is also an unzip for Cygwin: https://cygwin.com/packages/x86_64/unzip/

unzip is used to unpack the Sysinternals downloads AutoLogon.zip and Sigcheck.zip, and also for the self-update of the WSUS Offline Update installation.

On my system, unzip was installed with Xarchiver, but it may be missing on a basic command-line system. Then I'll add it to the list of needed packages.
hbuhrmester
 
Posts: 525
Joined: 11.10.2013, 20:59

Re: Running DownloadUpdates.sh in Cygwin

Postby slycordinator » 08.04.2019, 04:44

hbuhrmester wrote:There is also an unzip for Cygwin: https://cygwin.com/packages/x86_64/unzip/
Yes.

I just mentioned it, since it's not installed by default and isn't one of the packages/commands that the sh scripts check for before using.
slycordinator
 
Posts: 8
Joined: 23.02.2019, 07:48

Re: Running DownloadUpdates.sh in Cygwin

Postby slycordinator » 13.06.2019, 06:57

Cygwin can use the sysinternals files directly without wine. I've attached a diff for the sh/libraries/digital-file-signatures.bash script that allows this by checking the kernel and setting the commands to run directly.

Code: Select all
--- wsusoffline_11.7.2/sh/libraries/digital-file-signatures.bash        2019-03-13 19:42:36.000000000 +0900
+++ wsusoffline/sh/libraries/digital-file-signatures.bash       2019-06-13 14:31:11.537074300 +0900
@@ -107,11 +107,19 @@
         log_info_message "Verification of digital file signatures is disabled in preferences"
         return 0
     fi
-    if ! type -P wine > /dev/null
-    then
-        log_warning_message "Please install the package wine to verify digital file signatures with Sysinternals Sigcheck"
-        return 0
-    fi
+    kernel_name="$(uname -s)"
+       case "${kernel_name}" in
+        CYGWIN*)
+                       true
+               ;;
+               *)
+                       if ! type -P wine > /dev/null
+                       then
+                               log_warning_message "Please install the package wine to verify digital file signatures with Sysinternals Sigcheck"
+                               return 0
+                       fi
+               ;;
+       esac
     if [[ ! -f ../bin/"${sigcheck_bin}" ]]
     then
         log_warning_message "Verification of digital file signatures requires Sysinternals Sigcheck"
@@ -154,7 +162,14 @@
     #
     # The result code of sigcheck cannot be tested, because it is masked
     # by wine.
-    sigcheck_output="$(wine "../bin/${sigcheck_bin}" "${sigcheck_options[@]}" "${download_dir}" 2> /dev/null | tail -n +2 | unquote)" || true
+       case "${kernel_name}" in
+        CYGWIN*)
+                       sigcheck_output="$("../bin/${sigcheck_bin}" "${sigcheck_options[@]}" "${download_dir}" 2> /dev/null | tail -n +2 | unquote)" || true
+               ;;
+               *)
+                       sigcheck_output="$(wine "../bin/${sigcheck_bin}" "${sigcheck_options[@]}" "${download_dir}" 2> /dev/null | tail -n +2 | unquote)" || true
+                       ;;
+       esac
     log_debug_message "Sigcheck output:"
     log_debug_message "${sigcheck_output}"

@@ -173,7 +188,14 @@
         #
         # The resulting file path could be further shortened with
         # readlink -f.
-        linux_path="$(winepath --unix "${windows_path}")"
+               case "${kernel_name}" in
+        CYGWIN*)
+                       linux_path="${windows_path}"
+               ;;
+               *)
+                       linux_path="$(winepath --unix "${windows_path}")"
+                       ;;
+               esac
         filename="${linux_path##*/}"



I tried attaching the diff as a file but it seems that text files are disallowed.

:)
slycordinator
 
Posts: 8
Joined: 23.02.2019, 07:48


Return to Download

Who is online

Users browsing this forum: No registered users and 54 guests