tis-opencode icon

OpenCode

Paquet d'installation silencieuse pour OpenCode

1.18.34-1
Development
Development

  • package: tis-opencode
  • name: OpenCode
  • version: 1.18.34-1
  • categories: Development
  • maintainer: Tranquil IT, WAPT TEAM, Kevin Cherel
  • editor: Anomaly Innovations
  • licence: MIT
  • locale: all
  • target_os: windows
  • impacted_process: OpenCode.exe
  • architecture: x64
  • signature_date:
  • size: 126.36 Mo
  • homepage : https://opencode.ai/
  • depends:

package           : tis-opencode
version           : 1.18.34-1
architecture      : x64
section           : base
priority          : optional
name              : OpenCode
categories        : Development
maintainer        : Tranquil IT, WAPT TEAM, Kevin Cherel
description       : OpenCode is an open source AI coding agent that helps you write code in your terminal, IDE or desktop app.
depends           : tis-7zip
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.3
sources           : https://opencode.ai/download
installed_size    : 
impacted_process  : OpenCode.exe
description_fr    : OpenCode est un agent de codage IA open source qui vous aide à écrire du code dans votre terminal, votre IDE ou une application de bureau.
description_pl    : OpenCode to open source'owy agent AI do programowania, który pomaga pisać kod w terminalu, IDE lub aplikacji desktopowej.
description_de    : OpenCode ist ein quelloffener KI-Coding-Agent, der Ihnen hilft, Code in Ihrem Terminal, Ihrer IDE oder einer Desktop-Anwendung zu schreiben.
description_es    : OpenCode es un agente de programación con IA de código abierto que le ayuda a escribir código en su terminal, su IDE o una aplicación de escritorio.
description_pt    : OpenCode é um agente de programação com IA de código aberto que ajuda você a escrever código no terminal, no IDE ou em um aplicativo de desktop.
description_it    : OpenCode è un agente di programmazione IA open source che ti aiuta a scrivere codice nel terminale, nell'IDE o in un'applicazione desktop.
description_nl    : OpenCode is een open source AI-programmeeragent die u helpt code te schrijven in uw terminal, IDE of desktopapplicatie.
description_ru    : OpenCode представляет собой ИИ-агента для программирования с открытым исходным кодом, который помогает писать код в терминале, IDE или настольном приложении.
audit_schedule    : 
editor            : Anomaly Innovations
keywords          : opencode,ai,agent,coding,code,assistant,llm,terminal
licence           : MIT
homepage          : https://opencode.ai/
package_uuid      : a2c9bdc0-aa6b-4755-9db6-b6b1063cfc86
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://github.com/anomalyco/opencode/releases
min_os_version    : 10.0
max_os_version    : 
icon_sha256sum    : 2ef8d582e62e65a55adf11d09f0ef621d56592cd7e319178dff4c968aae27ba2
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2026-10-11T12:28:32.000000
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
signature         : RJlEovlgKh4yMnZOkYMPykyWUAMLQ/WcL7IdP56kOwB5Ag46GoWu5CqTJyNphkcSAcGmGEoRC82ciaV2yP7/jxUlhH08Klomt/3tHl04IGt+4XZFpcyed3YfZp6S90NurN2A1yhJFIcLvrasGLlGUA37crsmvEjp+oWFK5j4QQ6j+7B0xUrkbNqezreSCba8gM30nwP6sSaoGbDap3uLpAJw9qXnWVc4UlQzAvZZS4TPKZQIWExNyISh4NfhvwzwyhQ1l2OuJLiCGoQ/cnH10ZSoGQzHDVA/7Zc/Jr+OYz6Srm2T83SsYsy0RTOL5CPWJLPnZDtk7qvjPoT6FHV52A==

# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *

app_name = "OpenCode"
app_dir = makepath(programfiles, app_name)
app_path = makepath(app_dir, "OpenCode.exe")
legacy_app_dir = makepath(programfiles32, app_name)
temp_dir = "OpenCode_temp"
installed_version = get_file_properties(app_path).get("ProductVersion", "")


def install():
    bin_name = glob.glob("opencode-desktop-win-*.exe")[0]

    # Removing the install made by previous package revisions in Program Files (x86)
    if isdir(legacy_app_dir):
        print(f"Removing: {legacy_app_dir}")
        killalltasks(ensure_list(control.impacted_process))
        remove_tree(legacy_app_dir)
        remove_programs_menu_shortcut(app_name)

    # Uninstall older version before new one
    if installed_version and Version(installed_version) < Version(control.get_software_version()):
        uninstall()

    # The NSIS installer only supports a per-user install, extracting the application archive instead
    if isdir(temp_dir):
        remove_tree(temp_dir)
    print(f"Extracting: {bin_name}")
    unzip_with_7zip(bin_name, temp_dir)
    app_7z = glob.glob(makepath(temp_dir, "$PLUGINSDIR", "app-*.7z"))[0]

    print(f"Extracting: {app_7z}")
    killalltasks(ensure_list(control.impacted_process))
    unzip_with_7zip(app_7z, app_dir)
    remove_tree(temp_dir)

    create_programs_menu_shortcut(app_name, target=app_path)


def audit():
    # Auditing software
    audit_status = "OK"
    if Version(installed_version) < Version(control.get_software_version()):
        print(f"{app_name} is installed in version ({installed_version}) instead of ({control.get_software_version()})")
        audit_status = "WARNING"
    elif isdir(app_dir) and not dir_is_empty(app_dir):
        print(f"{app_name} ({installed_version}) is installed")
        audit_status = "OK"
    else:
        print(f"{app_name} is not installed")
        audit_status = "ERROR"
    return audit_status


def uninstall():
    # Uninstalling software
    killalltasks(ensure_list(control.impacted_process))
    if isdir(app_dir):
        remove_tree(app_dir)

    # Removing shortcuts
    remove_programs_menu_shortcut(app_name)

# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *
import waptlicences


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name

    api_url = "https://api.github.com/repos/anomalyco/opencode/releases/latest"
    print("API used is: %s" % api_url)
    json_load = wgets(api_url, proxies=proxies, as_json=True)
    version = json_load["tag_name"].replace("v", "")

    update_dict = {
        "windows-x64": "-win-x64.exe",
        "windows-arm64": "-win-arm64.exe",
        "darwin-x64": "-mac-x64.dmg",
        "darwin-arm": "-mac-arm64.dmg",
        "debian-x64": "-linux-amd64.deb",
        "debian-arm64": "-linux-arm64.deb",
        "redhat_based-x64": "-linux-x86_64.rpm",
        "redhat_based-arm64": "-linux-aarch64.rpm",
    }
    os_type = control.target_os.split("(")[0] + "-" + ensure_list(control.architecture)[0]

    print(f"Latest {app_name} version is: {version}")

    for to_download in json_load["assets"]:
        if to_download["name"].endswith(update_dict[os_type]):
            download_url = to_download["browser_download_url"]
            latest_bin = to_download["name"]
            latest_bin_extension = latest_bin.rsplit(".", 1)[-1]
            break

    if isfile(latest_bin):
        remove_file(latest_bin)
    print(f"Downloading: {latest_bin}")
    wget(download_url, latest_bin, proxies=proxies)

    # Only the Windows installers are Authenticode-signed
    if latest_bin_extension == "exe":
        expected_issuer = "Anomaly Innovations, Inc https://anoma.ly/"
        sign_name = waptlicences.check_exe_signing_certificate(latest_bin)[0]
        if sign_name != expected_issuer:
            error(f"Bad issuer {sign_name} != {expected_issuer}")

    # Deleting outdated binaries
    for f in glob.glob(f"*.{latest_bin_extension}"):
        if f != latest_bin:
            remove_file(f)

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print(f"Software version updated (from: {control.get_software_version()} to: {Version(version)})")
        package_updated = True
    else:
        print(f"Software version up-to-date ({Version(version)})")
    control.set_software_version(version)
    control.save_control_to_wapt()

    return package_updated

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
68ee79eadf296b74614adba1de5db15b0a4e88e08e9b4ebf136b83b67d55f574 : WAPT/control
2ef8d582e62e65a55adf11d09f0ef621d56592cd7e319178dff4c968aae27ba2 : WAPT/icon.png
2b997e4686fe62d7278bbbc154579d668eb8fb23904cc7da921f2126e1c2ad23 : luti.json
403d446d6ca9a9f2edb694d0ecf64c2be7468facade100b9d6e9e65430672bd2 : opencode-desktop-win-x64.exe
5f4ecc0a68857c266219a325d7a5924ab62a5ac1556b6ce8aab1589bd51eb96c : setup.py
fae3d1ce0595b89b09114a696b5c5819971aff87281244c98111e6e9b6dd45b0 : update_package.py