Compile executables under Linux

Compile executables under Linux

Postby joew » 26.09.2023, 12:41

I'm trying to update last version of windows, release 22H2, using wsusoffline.
But I want to get windows updates working on a Linux system, it should work fine, I read manual in "sh" directory and so on...

Issues:

1. with "Community Edition 12.6.1 -- 24.12.2021" ("Hotfix 6" - https://gitlab.com/wsusoffline/wsusoffl ... ityEdition) the bash script update-generator.bash doesn't have any choice for "Windows 10 x64, release 22H2".

2. on the other hand, using source package from master branch of gitlab, for instance:

https://gitlab.com/wsusoffline/wsusoffl ... ter.tar.gz

update-generator.bash seems to work properly and download all upades. But when I transfer the "client" directory on the target windows system, "we have a problem": there is no UpdateInstaller.exe executable, because I didn't build source package (bash script used within linux don't need any compile procedure, so they just work, but when I want to install the downloaded updates on windows we need "client\UpdateInstaller.exe." executable.

I see 3 solutions for this issue:

- build source tree (but is it possible under linux?) so that we have all executables needed by the install procedure of updates when we will work on windows target system.

- using somehow the ".cmd" script present within client directory: "Update.cmd"

As recap, my questions:

1. How build sources of master branch?
Is it possible under linux?

2. Alternatively is it correct to get sources master branch and run update-generator.bash on the working linux machine, transfer "client" subdir on the target windows PC, and here directly run Update.com instead of the executable "UpdateInstaller.exe" (that is not present because this was the wsusoffline source package) ?

Answers and comments are really really appreciated. Thanks in advance! :)

PS.
I tried to run Update.com as administrator on windows target, It apparently worked fine, then tried to run system windows update and it found various device drivers and few updates for .NET Framework and little more updates. Ideally wsusoffline should have install also cpp, dotnet, and windefender definitions, becaus I had selected them at download stage from linux update-generator.bash. But maybe Update.cmd dosen't install all updates, maybe it is possible by running it with some command line options? I don't know.
Anyway Update.cmd has worked and installed something, I don't know if my system is now up to date properly after this testing procedure, but without UpdateInstaller.exe I didn't have many other options.
joew
 
Posts: 12
Joined: 27.04.2019, 11:24

Re: Compile executables under Linux

Postby Gerby » 27.09.2023, 15:16

Hello joew,

I want to give you at least an answer but don't have any experience with the Linux scripts for WSUS Offline.

Just a guess: You could use Wine in your Linux environment to run the AutoIt compiler (a Windows program), so you could produce the exe file. Use the Windows batch "CompileAutoItScripts.cmd" for this task. It would even make sense to run the whole build batch file "MakeRelease.cmd" for the WSUS Offline files coming from the GitLab trunk.

About Windows: Windows 11 22H2 isn't actually supported by WSUS Offline and probably never won't. This refers to the Windows scripts of WSUS Offline. Don't know the latest state of Linux scripts.

Regards
Gerby
Mach mit - der Übersichtlichkeit wegen! Füge Log-Auszüge als [Code] ein.
Make it clear! Insert log excerpts as [Code].
Gerby
 
Posts: 504
Joined: 11.09.2009, 15:57
Location: DE > SH > SE

Re: Compile executables under Linux

Postby hbuhrmester » 28.09.2023, 23:10

How build sources of master branch?
Is it possible under linux?


I once tried to run the Windows script DownloadUpdates.cmd under wine, but it never worked. You could try to run the script CompileAutoItScripts.cmd alone, which just creates the applications UpdateGenerator.exe and UpdateInstaller.exe.


Ideally wsusoffline should have install also cpp, dotnet, and windefender definitions, becaus I had selected them at download stage from linux update-generator.bash. But maybe Update.cmd dosen't install all updates, maybe it is possible by running it with some command line options?


Running the script Update.cmd directly could be a valid option. Note, that the script Update.cmd is very short. It just calls cmd/DoUpdate.cmd and passes all command-line parameters.

https://gitlab.com/wsusoffline/wsusoffline/-/blob/master/client/Update.cmd?ref_type=heads
https://gitlab.com/wsusoffline/wsusoffline/-/blob/master/client/cmd/DoUpdate.cmd?ref_type=heads


In DoUpdate.cmd, lines 65 - 91, we can recognize a loop, which parses all supported command-line parameters:

Code: Select all
:EvalParams
if "%1"=="" goto NoMoreParams
for %%i in (/upgradebuilds /updatercerts /instdotnet35 /instdotnet4 /instwmf /updatedotnet5 /updatecpp /skipieinst /skipdefs /skipdynamic /all /excludestatics /seconly /verify /autoreboot /shutdown /showlog /showdismprogress /monitoron /instmsi) do (
  if /i "%1"=="%%i" call :Log "Info: Option %%i detected"
)
if /i "%1"=="/upgradebuilds" set DO_UPGRADES=/upgradebuilds
if /i "%1"=="/updatercerts" set UPDATE_RCERTS=/updatercerts
if /i "%1"=="/instdotnet35" set INSTALL_DOTNET35=/instdotnet35
if /i "%1"=="/instdotnet4" set INSTALL_DOTNET4=/instdotnet4
if /i "%1"=="/instwmf" set INSTALL_WMF=/instwmf
if /i "%1"=="/updatedotnet5" set UPDATE_DOTNET5=/updatedotnet5
if /i "%1"=="/updatecpp" set UPDATE_CPP=/updatecpp
if /i "%1"=="/skipieinst" set SKIP_IEINST=/skipieinst
if /i "%1"=="/skipdefs" set SKIP_DEFS=/skipdefs
if /i "%1"=="/skipdynamic" set SKIP_DYNAMIC=/skipdynamic
if /i "%1"=="/all" set LIST_MODE_IDS=/all
if /i "%1"=="/excludestatics" set LIST_MODE_UPDATES=/excludestatics
if /i "%1"=="/seconly" set LIST_MODE_IDS=/seconly
if /i "%1"=="/verify" set VERIFY_MODE=/verify
if /i "%1"=="/autoreboot" set BOOT_MODE=/autoreboot
if /i "%1"=="/shutdown" set FINISH_MODE=/shutdown
if /i "%1"=="/showlog" set SHOW_LOG=/showlog
if /i "%1"=="/showdismprogress" set DISM_MODE=/showdismprogress
if /i "%1"=="/monitoron" set MONITOR_ON=/monitoron
if /i "%1"=="/instmsi" set INSTALL_MSI=/instmsi
shift /1
goto EvalParams


Most of these parameters should correspond to some options in the applications UpdateGenerator.exe and UpdateInstaller.exe. Then we can just guess their meaning:

  • /updatercerts - Install Trusted Root Certificates and Certificate revocation lists

  • /upgradebuilds - Feature upgrades via enablement package
    This is for Windows 10, versions 2004/20H2/21H1/21H2/22H2, which belong to the related builds 19041 - 19045.

  • /updatecpp - Update C++ runtimes

  • /updatedotnet5 - Update dotNET 5 (and newer)
    Update the current version of the .NET Frameworks

  • /instdotnet35 - Install .NET Framework 3.5 SP1
    /instdotnet4 - Install .NET Framework 4
    These are older versions of the .NET Frameworks. They should only be installed, if needed to solve some compatibility issues with older applications.

  • /instwmf - Install Windows Management Framework

  • /skipdefs - Skip Windows Defender definitions
    So the default should be to install Windows Defender definition files, if present.

  • /instmsi - Install MSI packages and custom software


About Windows: Windows 11 22H2 isn't actually supported by WSUS Offline and probably never won't.


Windows 11, version 22H2 was added as a download option to the Windows script DownloadUpdates.cmd and the UpdateGenerator.exe. The source file UpdateGenerator.au3 has these options:

Code: Select all
Dim Const $win11_versions               = "22000,22621"
Dim Const $win11_displayversions        = "21H2,22H2"
Dim Const $win11_defaults               = "Enabled,Enabled"


https://gitlab.com/wsusoffline/wsusoffline/-/blob/master/client/UpdateInstaller.au3?ref_type=heads

The installation was difficult, because Microsoft introduced partial or incremental updates. This included a new archive format, which was difficult to dissect. I don't know, if this has ever been resolved.

Of course, the Linux download script can't help here, because they can only resemble the download part of WSUS Offline update.

Regards,
hbuhrmester
hbuhrmester
 
Posts: 525
Joined: 11.10.2013, 20:59


Return to Linux

Who is online

Users browsing this forum: No registered users and 190 guests