Downloads:

726,809

Downloads of v 18.1.31.0:

2,770

Last Update:

31 Jan 2018

Package Maintainer(s):

Software Author(s):

  • Maximus5

Tags:

graphical console emulator tabs farmanager powershell cmd bash cygwin msys git

ConEmu

This is not the latest version of ConEmu available.

  • 1
  • 2
  • 3

18.1.31.0 | Updated: 31 Jan 2018

Downloads:

726,809

Downloads of v 18.1.31.0:

2,770

Maintainer(s):

Software Author(s):

  • Maximus5

  • 1
  • 2
  • 3
ConEmu 18.1.31.0

This is not the latest version of ConEmu available.

  • 1
  • 2
  • 3

All Checks are Passing

3 Passing Tests


Validation Testing Passed


Verification Testing Passed

Details

Scan Testing Successful:

No detections found in any package files

Details
Learn More

Deployment Method: Individual Install, Upgrade, & Uninstall

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:

>

Deployment Method:

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

1. Enter Your Internal Repository Url

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


2. Setup Your Environment

1. Ensure you are set for organizational deployment

Please see the organizational deployment guide

2. Get the package into your environment

  • 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://community.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. Copy Your Script

choco upgrade conemu -y --source="'INTERNAL REPO URL'" --version="'18.1.31.0'" [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="'INTERNAL REPO URL'" --version="'18.1.31.0'" 
$exitCode = $LASTEXITCODE

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

Exit $exitCode

- name: Install conemu
  win_chocolatey:
    name: conemu
    version: '18.1.31.0'
    source: INTERNAL REPO URL
    state: present

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


chocolatey_package 'conemu' do
  action    :install
  source   'INTERNAL REPO URL'
  version  '18.1.31.0'
end

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


cChocoPackageInstaller conemu
{
    Name     = "conemu"
    Version  = "18.1.31.0"
    Source   = "INTERNAL REPO URL"
}

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


package { 'conemu':
  ensure   => '18.1.31.0',
  provider => 'chocolatey',
  source   => 'INTERNAL REPO URL',
}

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


4. 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 31 Jan 2018.

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 = '18.01.31'
$sha256 = '94D25E12A583B9C57D06DDCDB7B4942DA828C4FC5434AA88DB66AC22E606CC33'

$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 = '18.01.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

Log in or click on link to see number of positives.

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.

Add to Builder Version Downloads Last Updated Status
ConEmu 22.4.18.0 10817 Monday, April 18, 2022 Approved
ConEmu 22.3.8.0 6936 Wednesday, March 9, 2022 Approved
ConEmu 21.9.12.0 17276 Monday, September 13, 2021 Approved
ConEmu 21.9.5.0 2765 Sunday, September 5, 2021 Approved
ConEmu 21.8.22.0 4384 Sunday, August 22, 2021 Approved
ConEmu 21.8.16.0 3394 Monday, August 16, 2021 Approved
ConEmu 21.7.18.0 7147 Sunday, July 18, 2021 Approved
ConEmu 21.6.27.0 6440 Sunday, June 27, 2021 Approved
ConEmu 21.6.24.0 1759 Thursday, June 24, 2021 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