Usage instructions and get-it-all script

Usage instructions and get-it-all script

Postby hbuhrmester » 20.12.2015, 16:25

Much of the parameter processing for the script wsusoffline/sh/DownloadUpdates.sh is actually done by the sourced file commonparts.inc. There is even a helpful function printusage() in it, but there is no way, how this function could ever be called:

  • If the script DownloadUpdates.sh is called without any parameters, it will start the interactive setup of parameters.
  • If the script DownloadUpdates.sh is called with wrong parameters, it will only show short error messages like:

    Code: Select all
    system o2k16 does not exist.
    language glb does not exist.

If the function printusage() could actually be called, its output would look like:

Code: Select all
Usage: DownloadUpdates.sh [system] [language] [parameter]

Supported systems:
w60 w60-x64 w61 w61-x64 w62 w62-x64 w63 w63-x64 w100 w100-x64 all-x86 all-x64 o2k7 o2k10 o2k13 ofc all-61 all-62 all-63 all-100

Supported languages:
enu deu nld esn fra ptg ptb ita rus plk ell csy dan nor sve fin jpn kor chs cht hun trk ara heb

Parameters:
/excludesp - do not download servicepacks
/dotnet    - download .NET framework
/msse      - download Microsoft Security Essentials files
/wddefs    - download Windows Defender definition files
/nocleanup - do not cleanup client directory
/wle       - download Essentials
/proxy     - define proxy server (/proxy http://[username:password@]<server>:<port>)
/makeiso   - create ISO image

Example: bash DownloadUpdates.sh w61 deu /dotnet /excludesp


You can verify this yourself, if you create a small helper script "printusage.sh" with only two instructions in it:

Code: Select all
#!/bin/bash

source ./commonparts.inc
printusage


Then call it with:

Code: Select all
$ ./printusage.sh


Some remarks:

The language for Windows Vista and higher is supposed to be "glb", but this is not supported as a command line parameter. Instead, the function evaluateparams() in the file commonparts.inc sets two language variables, dependent on the system:

Code: Select all
Origlang=$lang
case $sys in
    w6[0-3]*)
#    echo "Setting language to glb..."
    lang="glb"
    ;;
esac


So, there are two variables with language settings:

  • $Origlang as set on the command line
  • $lang as set by evaluateparams()

Of course, the case switch should include Windows 10.0 (w100*) as well.

The optional parameter /wddefs is treated internally as /msse for Windows 8. This is the same approach as in the Windows script DownloadUpdates.cmd.

Code: Select all
if grep -q /wddefs <<< $Cmdline ; then
    case $sys in
        w62*)
            param5=/msse
            msse="1"
        ;;
        *)
            param7=/wddefs
            wddefs="1"
        ;;
    esac
fi


Again, the case switch should also include Windows 8.1 (w63*) and Windows 10.0 (w100*).

According to these rules, a simple script to download all updates for all systems, using German and English as default languages, could look like:

Code: Select all
#!/bin/sh

for update in w60 w60-x64; do
    for language in deu enu; do
        ./DownloadUpdates.sh ${update} ${language} /dotnet /msse /wddefs /wle
    done
done

for update in w61 w61-x64; do
    for language in deu enu; do
        ./DownloadUpdates.sh ${update} ${language}
    done
done

for update in w62 w62-x64 w63 w63-x64 w100 w100-x64; do
    ./DownloadUpdates.sh ${update} deu
done

for update in o2k7 o2k10 o2k13; do
    for language in deu enu; do
        ./DownloadUpdates.sh ${update} ${language}
    done
done


Notes:

The optional downloads like /dotnet should only be added once, otherwise they will be processed repeatedly.

Using the original language could actually be useful to include localized installers for:

  • Internet Explorer 8 and higher for Windows Vista
  • Internet Explorer 9 and higher for Windows 7
  • .NET Frameworks
  • Microsoft Security Essentials
  • Windows Essentials 2012 (Windows Live Essentials)

But I don't know, if the script DownloadUpdates.sh uses the original language this way.

For Windows 8, 8.1 and 10.0 the language parameter should not make any difference, but the script still won't accept "glb" as command line parameter.
hbuhrmester
 
Posts: 217
Joined: 11.10.2013, 20:59

Return to Linux

Who is online

Users browsing this forum: No registered users and 1 guest

cron