DanGough / Nevergreen

This module is an alternative to Evergreen, and allows you to find the latest version and download URL for various Windows apps. Evergreen uses API queries to obtain its data whereas this module is more focussed on web scraping. This is more prone to breaking when websites are changed, hence the name.
The Unlicense
74 stars 18 forks source link

Add Druide Antidote patches #12

Closed JonathanPitre closed 2 years ago

JonathanPitre commented 3 years ago

It does require an enterprise account to download the main software but at least we could provide the patches for the latest update.

We can improve the following code with the Nevergreen standard.

$appURLVersion = "https://www.antidote.info/en/assistance/mises-a-jour/historique/antidote-10/windows"
$webRequest = Invoke-WebRequest -UseBasicParsing -Uri ($appURLVersion) -SessionVariable websession
$regexAppVersion = "Antidote \d\d v\d.+ Windows"
$webVersion = $webRequest.RawContent | Select-String -Pattern $regexAppVersion -AllMatches | ForEach-Object { $_.Matches.Value } | Select-Object -First 1
$appShortVersion = ($webVersion).Split(" ")[1]
$appPatchVersion = ($webVersion).Trim("Andidote $appShortVersion v").Trim(" Windows").Replace(" ", "")
$appVersion = "$appShortVersion.$appPatchVersion"
$appURLPatch = "https://telechargement12.druide.com/Win/antidote_$appShortVersion/Diff_Antidote_$($appShortVersion)_C_$($appShortVersion).$appPatchVersion.msp"
$appURLPatch2 = "https://telechargement12.druide.com/Win/antidote_$appShortVersion/Diff_Antidote_$($appShortVersion)_Module_F_$($appShortVersion).$appPatchVersion.msp"
$appURLPatch3 = "https://telechargement12.druide.com/Win/antidote_$appShortVersion/Diff_Antidote_$($appShortVersion)_Module_E_$($appShortVersion).$appPatchVersion.msp"
$appURLPatch4 = "https://telechargement12.druide.com/Win/antidote_$appShortVersion/Diff_Connectix_$($appShortVersion)_C_$($appShortVersion).$appPatchVersion.msp"
$appURLMultiMgr = "https://telechargement.druide.com/telecharger/Reseau/antidote_$appShortVersion/GestionnaireMultiposte_Antidote$appShortVersion.exe"
$appPatch = $appURLPatch.Split("/")[5]
$appPatch2 = $appURLPatch2.Split("/")[5]
$appPatch3 = $appURLPatch3.Split("/")[5]
$appPatch4 = $appURLPatch4.Split("/")[5]
DanGough commented 3 years ago

Hi, unsure about adding this at present as I can't verify any of the results. Are you sure that every single update has those specific names each time? Seems odd having C, Module E, and Module F here. Will the next release have Module D for example?!

Is there a web page hosting these MSP links we can scan? Also the FAQ says the app has an auto updater, which will surely check some API or a text file at their end. Try to capture the traffic from the auto updater using Fiddler. Apps that check APIs would be a good candidate for Evergreen, although I have done a few that use Invoke-RestMethod in this project as I find it easier to work with my own code.

JonathanPitre commented 3 years ago

Hi Dan, sorry for the late response.

Module_E stands for English Module_F stands for French and I think C is for Connectix

These names didn't change over the last few years so it's safe to assume they won't in the near future.

As for the download links, there's no root page that holds these msps. Unless you know the exact link you will not get the patches. Here's one for example:

https://telechargement12.druide.com/Win/antidote_10/Diff_Antidote_10_C_10.6.1.msp