Notices: This section not yet converted to new layout. Download stats are rolling back out.

14,487

Downloads

6,128

Downloads of v 1.66.0.20150407

4/8/2015

Last update

ANSICON

1.66.0.20150407

Package test results are passing.

Private CDN cached downloads available for licensed customers. Never experience 404 breakages again! Learn more...

This package was approved by moderator ferventcoder on 10/7/2015.

ANSICON provides ANSI escape sequences for Windows console programs. It provides much the same functionality as `ANSI.SYS' does for MS-DOS.

To install ANSICON, run the following command from the command line or from PowerShell:

C:\> choco install ansicon

To upgrade ANSICON, run the following command from the command line or from PowerShell:

C:\> choco upgrade ansicon

Files

Hide
  • tools\ansicon.ps1 Show
    # ANSICON -i produces a Command Processor AutoRun property with these attributes
    #
    #   * at the beginning of the property
    #   * surrounded by parenthesis
    #   * separated by a single & (when there are existing commands)
    #   * without the file extension
    #
    # Example without existing commands:
    # 
    #   (if %ANSICON_VER%==^%ANSICON_VER^% "path\to\ansicon" -p)
    #
    # Example with existing commands:
    # 
    #   (if %ANSICON_VER%==^%ANSICON_VER^% "path\to\ansicon" -p)&<other-commands>
    #
    $pattern = '(?<ansicon>\(if %ANSICON_VER%==\^%ANSICON_VER\^% ".*" -p\))'
    $pattern_greedy = '(?<ansicon>\(if %ANSICON_VER%==\^%ANSICON_VER\^% ".*" -p\)&*)'
    
    function Remove-AnsiconProperty($key) {
      $autorun = (Get-ItemProperty -Path $key).AutoRun
    
      Write-Debug "[ANSICON] Registry key: $key"
      Write-Debug "[ANSICON] AutoRun property: $autorun"
    
      if(-not $autorun) {
        return
      }
    
      if(-not($autorun -match $pattern_greedy)) {
        return
      }
    
      $match = $matches["ansicon"]
      $autorun = $autorun -replace [regex]::Escape($match), ""
    
      Write-Debug "[ANSICON] AutoRun property: $autorun"
    
      Set-ItemProperty -Path $key -Name "AutoRun" -Value $autorun -Type String
    }
    
    function Set-AnsiconProperty($key, $ansicon) {
      $statement = "(if %ANSICON_VER%==^%ANSICON_VER^% `"$ansicon`" -p)"
    
      $autorun = (Get-ItemProperty -Path $key).AutoRun
    
      Write-Debug "[ANSICON] Ansicon path: $ansicon"
      Write-Debug "[ANSICON] Registry key: $key"
      Write-Debug "[ANSICON] AutoRun property: $autorun"
    
      if(-not $autorun) {
        $autorun = $statement
      }
      elseif($autorun -match $pattern) {
        $match = $matches["ansicon"]
        $autorun = $autorun -replace [regex]::Escape($match), $statement
      }
      else {
        $autorun = $statement + '&' + $autorun
      }
    
      Write-Debug "[ANSICON] AutoRun property: $autorun"
    
      Set-ItemProperty -Path $key -Name "AutoRun" -Value $autorun -Type "String"
    }
    
  • tools\ChocolateyInstall.ps1 Show
    $id = "ansicon"
    $url = "https://github.com/adoxa/ansicon/releases/download/v1.66/ansi166.zip"
    
    $user_key = "HKCU:\Software\Microsoft\Command Processor"
    $machine_key_32 = "HKLM:\Software\Microsoft\Command Processor"
    $machine_key_64 = "HKLM:\Software\Wow6432Node\Microsoft\Command Processor"
    
    $is64bit = Get-ProcessorBits 64
    $subfolder = @{$true="x64";$false="x86"}
    
    $tools = Split-Path $MyInvocation.MyCommand.Definition
    $content = Join-Path (Split-Path $tools) "content"
    $ansicon = Join-Path $content (Join-Path $subfolder[$is64bit] $id)
    $ignore = Join-Path $content (Join-Path $subfolder[-not $is64bit] "$id.exe.ignore")
    
    Install-ChocolateyZipPackage $id $url $content
    
    New-Item $ignore -Type File -Force | Out-Null
    
    . (Join-Path $tools "ansicon.ps1")
    
    Remove-AnsiconProperty -Key $user_key
    Set-AnsiconProperty -Key $machine_key_32 -Ansicon $ansicon
    Set-AnsiconProperty -Key $machine_key_64 -Ansicon $ansicon
    
  • tools\chocolateyUninstall.ps1 Show
    $user_key = "HKCU:\Software\Microsoft\Command Processor"
    $machine_key_32 = "HKLM:\Software\Microsoft\Command Processor"
    $machine_key_64 = "HKLM:\Software\Wow6432Node\Microsoft\Command Processor"
    
    $tools = Split-Path $MyInvocation.MyCommand.Definition
    
    . (Join-Path $tools "ansicon.ps1")
    
    Remove-AnsiconProperty -Key $user_key
    Remove-AnsiconProperty -Key $machine_key_32
    Remove-AnsiconProperty -Key $machine_key_64
    
  • tools\test-colors.rb

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Dependencies

This package has no dependencies.

Maintainer(s)

Software Author(s)

  • Jason Hood

Tags

Release Notes

If you have an earlier version of this package installed, you may have to manually remove it if this package fails to install.

Open regedit and navigate to HKEYCURRENTUSER\Software\Microsoft\CommandProcessor. Open the AutoRun key and remove any references to ansicon.

In the chocolatey install folder, under lib, delete the ansicon folder. If you are unable to delete the folder, you will need to reboot.

Version History

Version Downloads Last updated Status
ANSICON 1.6.6 6107 Saturday, July 12, 2014 approved
ANSICON 1.6.4 853 Thursday, August 22, 2013  
ANSICON 1.6.1 410 Monday, April 29, 2013  
ANSICON 1.5.0.2 559 Monday, February 6, 2012  
ANSICON 1.5.0.1 229 Sunday, February 5, 2012  

Discussion for the ANSICON Package

Ground rules:

  • This discussion is only about ANSICON and the ANSICON package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or ANSICON, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus