ConEmu

This is not the latest version of ConEmu available.

19.3.31.0 | Updated: 3/31/2019

Downloads:

482,565

Downloads of v 19.3.31.0:

13,433

Software Author(s):

  • Maximus5

ConEmu 19.3.31.0

This is not the latest version of ConEmu available.

All Checks are Passing

2 Passing Test


Validation Testing Passed


Verification Testing Passed

Details

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

>

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

>

To uninstall ConEmu, run the following command from the command line or from PowerShell:

>

NOTE: This applies to both open source and commercial editions of Chocolatey.

1. Ensure you are set for organizational deployment

Please see the organizational deployment guide

  • Open Source or Commercial:
    • Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://chocolatey.org/api/v2. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
    • You can also just download the package and push it to a repository Download

3. Enter your internal repository url

(this should look similar to https://chocolatey.org/api/v2)

4. Choose your deployment method:


choco upgrade conemu -y --source="'STEP 3 URL'" [other options]

See options you can pass to upgrade.

See best practices for scripting.

Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.

If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:


choco upgrade conemu -y --source="'STEP 3 URL'" 
$exitCode = $LASTEXITCODE

Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
  Exit 0
}

Exit $exitCode

- name: Ensure conemu installed
  win_chocolatey:
    name: conemu
    state: present
    version: 19.3.31.0
    source: STEP 3 URL

See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.

Coming early 2020! Central Managment Reporting available now! More information...


chocolatey_package 'conemu' do
  action    :install
  version  '19.3.31.0'
  source   'STEP 3 URL'
end

See docs at https://docs.chef.io/resource_chocolatey_package.html.


Chocolatey::Ensure-Package
(
    Name: conemu,
    Version: 19.3.31.0,
    Source: STEP 3 URL
);

Requires Otter Chocolatey Extension. See docs at https://inedo.com/den/otter/chocolatey.


cChocoPackageInstaller conemu
{
   Name     = 'conemu'
   Ensure   = 'Present'
   Version  = '19.3.31.0'
   Source   = 'STEP 3 URL'
}

Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.


package { 'conemu':
  provider => 'chocolatey',
  ensure   => '19.3.31.0',
  source   => 'STEP 3 URL',
}

Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.


salt '*' chocolatey.install conemu version="19.3.31.0" source="STEP 3 URL"

See docs at https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.chocolatey.html.

5. If applicable - Chocolatey configuration/installation

See infrastructure management matrix for Chocolatey configuration elements and examples.

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

This package was approved as a trusted package on 5/1/2019.

Description

ConEmu-Maximus5 (short for Console Emulator) is a handy and full featured Windows console window (local terminal) with a lot of enhancements: panes, tabs, tasks, jump lists, quake style, handy text and block selection, handy paste of paths in either Unix or Windows notation, and much more.

ConEmu may work as either standalone window, or embeddable console control. And it may host two types of applications:

  • ‘console’: cmd, powershell, Far Manager, bash, and many others;
  • ‘graphical’ (GUI): Notepad, PuTTY, GVim, mintty and so on.

Short list of features:

  • predefined and user-defined tasks for different shells;
  • user friendly text and block selection and paste;
  • smooth and friendly window resizing;
  • Windows 7 Jump Lists and Progress on Taskbar buttons;
  • DosBox integration: run old DOS applications (games) in modern OS;
  • quake-style and full screen window modes;
  • ANSI sequences and Xterm 256 colors;
  • cursor: standard console (horizontal) or GUI (vertical);
  • customizable starting tabs;
  • Far Manager integration: drag-n-drop, tabs, truecolor, thumbnails;
  • unicode and CJK support;
  • explore much more features on the project site.

tools\chocolateyInstall.ps1
$package = 'ConEmu'
$version = '19.03.31'
$sha256 = 'B5EE280B36649288E1814B3827C7D5C7749387D6D35FCD4F3A4FCAA48967E09A'

$isSytem32Bit = (($Env:PROCESSOR_ARCHITECTURE -eq 'x86') -and `
  ($Env:PROCESSOR_ARCHITEW6432 -eq $null))

$os = if ($isSytem32Bit) { "x86" } else { "x64" }

$url = "https://github.com/Maximus5/ConEmu/releases/download/v$version/ConEmuSetup.$($version.replace('.','')).exe"

# MSI installer, but packed inside wrapper to select x86 or x64
# version. Therefore, treat it as EXE type.
$params = @{
  PackageName = $package;
  FileType = 'exe';
  SilentArgs = "/p:$os /quiet /norestart";
  Url = $url;
  Url64bit = $url;
  checksum      = $sha256
  checksumType  = 'sha256'
  checksum64    = $sha256
  checksumType64= 'sha256'
}

$script:CE_PID = 0
$script:CE_SRV = 0
$script:CE_WND = 0
$script:CE_DIR = ""

$script:ConEmuC = ""

$script:CE_FILES = @()

function log($s) {
  # Write-Host $s
}

function initWinApi() {
    Add-Type @"
      using System;
      using System.Text;
      using System.Runtime.InteropServices;
      public class ConEmuApi
      {
        [DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)]
        public static extern int IsWindow(IntPtr hwnd);

        [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
        static extern bool MoveFileEx(string lpExistingFileName, string lpNewFileName, int dwFlags);

        public static bool MarkFileDelete(string sourcefile)
        {
          return MoveFileEx(sourcefile, null, 4);
        }
      }
"@
}

function isWindowAlive($hwnd) {
  if (("ConEmuApi" -as [type]) -eq $null) {
    initWinApi
  }

  $rc = [ConEmuApi]::IsWindow($hwnd)
  # log "HWND=$hwnd, rc=$rc"
  return ($rc -ne 0)
}

function isProcessAlive($id) {
  if ((Get-Process -Id $id -ErrorAction Ignore) -eq $Null) {
    return $False
  }
  return $True
}

function isConEmu() {
  if (($env:ConEmuDrawHWND -eq $Null) -Or ($env:ConEmuPID -eq $Null) -Or
      ($env:ConEmuServerPID -eq $Null) -Or ($env:ConEmuBaseDir -eq $Null)) {
    return $False
  }

  $id = [convert]::ToInt32($env:ConEmuPID)
  $srv = [convert]::ToInt32($env:ConEmuServerPID)
  $wnd = [convert]::ToInt32($env:ConEmuDrawHWND, 16)

  if (-Not (isProcessAlive $id)) {
    return $False
  }

  if (-Not (isWindowAlive $wnd)) {
    return $False
  }

  if (Test-Path -path (Join-Path $env:ConEmuBaseDir "ConEmuC.exe") -pathtype leaf) {
    $script:ConEmuC = Join-Path $env:ConEmuBaseDir "ConEmuC.exe"
  } elseif (Test-Path -path (Join-Path $env:ConEmuBaseDir "ConEmuC64.exe") -pathtype leaf) {
    $script:ConEmuC = Join-Path $env:ConEmuBaseDir "ConEmuC64.exe"
  } else {
    return $False
  }

  $script:CE_PID = $id
  $script:CE_SRV = $srv
  $script:CE_WND = $wnd
  $script:CE_DIR = $env:ConEmuBaseDir
  return $True
}

function unlockFiles($files) {
  $suffix = Get-Date -format yyMMddHHmmss
  foreach ($fn in $files) {
    $f = @{src_name=$fn; tmp_name=".$fn.$suffix";}
    $f.Add("src", (Join-Path $script:CE_DIR $f.src_name))
    $f.Add("tmp", (Join-Path $script:CE_DIR $f.tmp_name))
    try {
      if (Test-Path -path $f.src -pathtype leaf) {
        Rename-Item -Path $f.src -NewName $f.tmp_name -ErrorAction Stop
        $script:CE_FILES += $f
      }
    } catch {
    }
  }
}

function removeTempFiles() {
  foreach ($f in $script:CE_FILES) {
    try {
      Remove-Item $f.tmp -ErrorAction Stop
    } catch {
      $deleteResult = [ConEmuApi]::MarkFileDelete($f.tmp)
    }
  }
}

function restoreFiles() {
  foreach ($f in $script:CE_FILES) {
    try {
      Rename-Item -Path $f.tmp -NewName $f.src_name -ErrorAction Stop
    } catch {
      log "Failed to restore file: $($f.src_name)"
    }
  }
}

function ConEmuPreUpdate() {
  # Checking
  if (isConEmu) {
    # Note, old ConEmu versions weren't able to detach without confirmation
    log "Detaching from ConEmu"
    $warn_msg = "Please choose <Yes> in the confirmation dialog"
    Write-Host -ForegroundColor Green -NoNewLine $warn_msg
    $macro_rc = & $script:ConEmuC -GuiMacro:$script:CE_PID detach 3
    Write-Host -NoNewLine ("`r".PadRight($warn_msg.length+1)+"`r")

    $wait_delay = 10000
    $wait_ms = 250
    $wait_count = $wait_delay/$wait_ms

    # log "Code=$LASTEXITCODE" # may be always 0 and "OK"
    # Sleep for 10 sec waiting for detach
    $warn_msg = "Waiting for detach"
    Write-Host -ForegroundColor Green -NoNewLine $warn_msg
    for ($i = 0; $i -lt $wait_count; $i++) {
      if (-Not (isWindowAlive $script:CE_WND)) {
        log "Detached successfully"
        break
      }
      # Write-Host -NoNewLine "."
      Sleep -m $wait_ms
    }
    Write-Host -NoNewLine ("`r".PadRight($warn_msg.length+1)+"`r")
    if ($i -eq $wait_count) {
      throw "Detach failed, please try to run update outside of ConEmu"
    }
    

    if (isProcessAlive $script:CE_PID) {
      Sleep -s 1
      if (isProcessAlive $script:CE_PID) {
        $warn_msg = "Requesting ConEmu termination"
        Write-Host -ForegroundColor Green -NoNewLine $warn_msg
        $macro_rc = & $script:ConEmuC -GuiMacro:$script:CE_PID close 2
        for ($i = 0; $i -lt $wait_count; $i++) {
          if (-Not (isProcessAlive $script:CE_PID)) {
            log "Terminated successfully"
            break
          }
          # Write-Host -NoNewLine "."
          Sleep -m $wait_ms
        }
        Write-Host -NoNewLine ("`r".PadRight($warn_msg.length+1)+"`r")
        if ($i -eq $wait_count) {
          throw "ConEmu process still alive, please try to run update outside of ConEmu"
        }
      }
    }

    if (isProcessAlive $script:CE_SRV) {
      log "Terminating console server process PID=$($script:CE_SRV)"
      Stop-Process -Force -Id $script:CE_SRV
    }

    log "Renaming hooks libraries"
    unlockFiles @("ConEmuHk.dll", "ConEmuHk64.dll")

    log "Console is ready to update ConEmu"

  } else {
    $is_conemu = $FALSE
    try {
      & ConEmuC.exe -IsConEmu
      $is_conemu = ($LASTEXITCODE -eq 1)
    } catch {
    }
    if ($is_conemu) {
      throw "Can't detect proper ConEmu environment variables! Please restart console!"
    }

    log "PowerShell was not stared from ConEmu"
  }
}

function ConEmuPostUpdate() {
  if ($script:CE_FILES.Count -ne 0) {
    if (Test-Path -path $script:CE_FILES[0] -pathtype leaf) {
      # On Success
      removeTempFiles
    } else {
      # On Failure
      restoreFiles
    }
  }
  if ($script:CE_PID -ne 0) {
    Write-Host -ForegroundColor Green "Console restart is strongly recommended to gain proper ConEmu environment"
    # Reattach
    $rc = Start-Process -FilePath $script:ConEmuC -ArgumentList @("/ATTACH","/NOCMD") -NoNewWindow
    for ($i = 0; $i -lt 100; $i++) {
      $rc = & $script:ConEmuC -IsConEmu
      if ($LASTEXITCODE -eq 1) { break }
      Sleep -m 100
    }
  }
}

# Unlock ConEmu binaries
ConEmuPreUpdate

# Do installation/update
Install-ChocolateyPackage @params

# Try to restore files if update has failed
ConEmuPostUpdate

# Done
tools\chocolateyUninstall.ps1
$package = 'ConEmu'
$version = '19.03.31'


$isSytem32Bit = (($Env:PROCESSOR_ARCHITECTURE -eq 'x86') -and `
  ($Env:PROCESSOR_ARCHITEW6432 -eq $null))

$os = if ($isSytem32Bit) { "x86" } else { "x64" }

$displayName = "ConEmu $($version.replace('.','')).$os"

$installerRoot = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer'
$productsRoot = "$installerRoot\UserData\S-1-5-18\Products"


# To avoid unexpected PC reboot, prohibit ConEmu uninstall from ConEmu
$is_conemu = $FALSE
try {
  & ConEmuC.exe -IsConEmu
  $is_conemu = ($LASTEXITCODE -eq 1)
} catch {
}
if ($is_conemu) {
  throw "Can't detect proper ConEmu environment variables! Please restart console!"
}


Write-Host "Searching for installed msi-packet..."

# ConEmu packages do not have fixed GUIDs
$pkg = ""
Get-ChildItem $productsRoot |
  % { ($productsRoot + "\" + (Split-Path -Leaf $_.Name) + "\InstallProperties") } |
  ? { ($pkg -eq "") -And (Test-Path $_) } |
  ? { ((Get-ItemProperty $_).DisplayName -eq $displayName) } |
  % {
    $pkg = (Get-ItemProperty $_).LocalPackage
  }
if ($pkg -ne "") {
  # Write-Host "Found at $pkg"
  Write-Host "Uninstalling '$displayName' via 'msiexec /x $pkg'"
  Start-Process -Wait msiexec -ArgumentList @("/x", $pkg, "/qb-!")
}

# Done

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.

Version Downloads Last Updated Status
ConEmu 19.7.14.0 28348 Sunday, July 14, 2019 Approved
ConEmu 19.6.23.0 9749 Sunday, June 23, 2019 Approved
ConEmu 19.5.26.0 9470 Sunday, May 26, 2019 Approved
ConEmu 19.3.31.0 13433 Sunday, March 31, 2019 Approved
ConEmu 19.3.26.0 3045 Wednesday, March 27, 2019 Approved
ConEmu 19.3.24.0 2389 Sunday, March 24, 2019 Approved
ConEmu 19.3.10.0 7373 Sunday, March 10, 2019 Approved
ConEmu 19.3.3.0 5812 Sunday, March 3, 2019 Approved
ConEmu 19.3.1.0 1674 Friday, March 1, 2019 Approved

This package has no dependencies.

Discussion for the ConEmu Package

Ground Rules:

  • This discussion is only about ConEmu and the ConEmu 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 ConEmu, 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