Closed alwaysharsha closed 2 years ago
You should create iso within au_BeforeUpdate
which is exactly there for such scenarios. In that step it is typical to change $Latest
, for example people often call here Get-RemoteFiles
which internally sets the checksums on it.
Your current solution will probably work but it is a mess and mixes concerns - GetLatest job is only to find latest version and url, not construct thing needed for eventual update. Adding things to SearchReplace might work or not, but it definitely smells bad.
Thanks @rismoney
We have a scenario where we download the vs_professional.exe (Visual Studio Professional) To detect the version. We create offline iso so that our installation is consistent. Downloading Visual studio components and iso takes lot of them around 20-30 mins. If there is no version change I can save that time without creating the iso file.
The current flow is au_GetLatest (Download .exe and creates .iso and returns the object including checksum and file path) -> au_SearchReplace -> au_AfterUpdate.
Instead of creating the iso at au_GetLatest if I move to a later stage like au_SearchReplace I would save time when there is no new version. During this step is it recommended to update the $global:Latest parameter with new values and reference them? Is that acceptable solution.
Please let me know your views.