<commit_before>﻿$packageName = '{{PackageName}}'
$version = '{{PackageVersion}}'

try {

  $versionsHtmlFile = "$env:TEMP\libreoffice-versions.html"
  $versionsHtmlUrl = 'http://download.documentfoundation.org/libreoffice/stable/'

  Get-ChocolateyWebFile 'libreoffice-versions-html' $versionsHtmlFile $versionsHtmlUrl

  $matchArray = (Get-Content $versionsHtmlFile) -match 'href="([\d\.]+)\/"'

  Remove-Item $versionsHtmlFile

  $downloadableVersions = @()

  for ($i = 0; $i -lt $matchArray.Length; $i += 1) {
    $matchArray[$i] -match '[\d\.]+'
    $downloadableVersions += $Matches[0]
  }

  if (-not($downloadableVersions -match $version)) {

    Write-Output 'The version of LibreOffice specified in the package is no longer available to download. This package will download the latest available version instead.'

    if ([System.Version]$downloadableVersions[0] -gt [System.Version]$downloadableVersions[1]) {
      $version = $downloadableVersions[0]
    } else {
      $version = $downloadableVersions[1]
    }
  }

  $downUrl = "http://download.documentfoundation.org/libreoffice/stable/${version}/win/x86/LibreOffice_${version}_Win_x86.msi"


  # Check if LibreOffice in the same version is already installed
  $alreadyInstalled = Get-WmiObject -Class Win32_Product | Where-Object {($_.Name -match '^LibreOffice [\d\.]+$') -and ($_.Version -match "^$version")}

  if ($alreadyInstalled) {
    Write-Host "LibreOffice $version is already installed on the computer. Skipping download."
  } else {
    Install-ChocolateyPackage $packageName 'msi' '/passive /norestart' $downUrl -validExitCodes @(0)
  }

} catch {
  Write-ChocolateyFailure $packageName $($_.Exception.Message)
  throw
}<commit_msg>Added exitCode 3010<commit_after>$packageName = '{{PackageName}}'
$version = '{{PackageVersion}}'
$validExitCodes = @(0,3010)


try {

  $versionsHtmlFile = "$env:TEMP\libreoffice-versions.html"
  $versionsHtmlUrl = 'http://download.documentfoundation.org/libreoffice/stable/'

  Get-ChocolateyWebFile 'libreoffice-versions-html' $versionsHtmlFile $versionsHtmlUrl

  $matchArray = (Get-Content $versionsHtmlFile) -match 'href="([\d\.]+)\/"'

  Remove-Item $versionsHtmlFile

  $downloadableVersions = @()

  for ($i = 0; $i -lt $matchArray.Length; $i += 1) {
    $matchArray[$i] -match '[\d\.]+'
    $downloadableVersions += $Matches[0]
  }

  if (-not($downloadableVersions -match $version)) {

    Write-Output 'The version of LibreOffice specified in the package is no longer available to download. This package will download the latest available version instead.'

    if ([System.Version]$downloadableVersions[0] -gt [System.Version]$downloadableVersions[1]) {
      $version = $downloadableVersions[0]
    } else {
      $version = $downloadableVersions[1]
    }
  }

  $downUrl = "http://download.documentfoundation.org/libreoffice/stable/${version}/win/x86/LibreOffice_${version}_Win_x86.msi"


  # Check if LibreOffice in the same version is already installed
  $alreadyInstalled = Get-WmiObject -Class Win32_Product | Where-Object {($_.Name -match '^LibreOffice [\d\.]+$') -and ($_.Version -match "^$version")}

  if ($alreadyInstalled) {
    Write-Host "LibreOffice $version is already installed on the computer. Skipping download."
  } else {
    Install-ChocolateyPackage $packageName 'msi' '/passive /norestart' $downUrl -validExitCodes $validExitCodes
  }

} catch {
  Write-ChocolateyFailure $packageName $($_.Exception.Message)
  throw
}
{'fraction_non_alphanumeric': 0.1445887445887446, 'fraction_numerical': 0.01038961038961039, 'mean_word_length': 4.424100156494522, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '669100', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1090, 'n_words': 250}