Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Update-Engines overwrites the files on 2nd run #2108

Open
christophvw opened this issue Jun 18, 2024 · 0 comments
Open

[Issue] Update-Engines overwrites the files on 2nd run #2108

christophvw opened this issue Jun 18, 2024 · 0 comments
Labels

Comments

@christophvw
Copy link

christophvw commented Jun 18, 2024

Describe the issue
Update-Engines.ps1 script version 23.11.21.1852 overwrites microsoft_fullpkg.cab when it already exists.

Expected behavior
Do not overwrite valid files as the download takes >15min.

proposed fix:

lines 595ff

When the file does not exists - or has a size different size: download it again - otherwise not

if (((Test-Path $fullPkgPath) -ne $true) -or ((Get-Item $fullPkgPath).Length -ne $manifest.ManifestFile.Package.FullPackage.Size)) {
	$wc.DownloadFile($fullPkgUrl, $fullPkgPath)

	# Detect if there are any subdirectories
	# needed for this engine
	$subDirCount = $manifest.ManifestFile.Package.Files.Dir.Count

	for ($i=0; $i -lt $subDirCount; $i++) {
		CreatePath ($fullPkgDir + $manifest.ManifestFile.Package.Files.Dir[$i].name)
	}

	ExtractCab $fullPkgPath $fullPkgDir

	# Copy the downloaded manifest to the package directory
	Copy-Item $manifestPath -Destination $fullPkgDir

	Write-Host "Download Complete: " $engine.Name
}
else {
	Write-Host "Engine already up to date: " $engine.Name
}
christophvw added a commit to christophvw/CSS-Exchange that referenced this issue Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant