tis-thebrain icon

TheBrain

Silent install package for TheBrain

14.0.101.0-1

  • package: tis-thebrain
  • name: TheBrain
  • version: 14.0.101.0-1
  • maintainer: Amel FRADJ
  • licence: https://www.thebrain.com/about/legal/terms/
  • target_os: windows
  • architecture: x64
  • signature_date:
  • size: 63.93 Mo
  • homepage : https://www.thebrain.com/

package           : tis-thebrain
version           : 14.0.101.0-1
architecture      : x64
section           : base
priority          : optional
name              : TheBrain
categories        : 
maintainer        : Amel FRADJ
description       : TheBrain organizes and finds everything the way you think it is
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : TheBrain organisez et trouvez tout comme vous le pensez
description_pl    : TheBrain organizuje i znajduje wszystko tak, jak myślisz
description_de    : TheBrain organisieren und finden Sie alles so, wie Sie es sich vorstellen
description_es    : TheBrain organiza y encuentra todo como tú crees
description_pt    : TheBrain organiza e encontra tudo da forma como pensa que está
description_it    : TheBrain organizza e trova tutto nel modo in cui pensate che sia
description_nl    : TheBrain organiseert en vindt alles zoals jij denkt dat het is
description_ru    : TheBrain организует и находит все так, как вы думаете
audit_schedule    : 
editor            : 
keywords          : 
licence           : https://www.thebrain.com/about/legal/terms/
homepage          : https://www.thebrain.com/
package_uuid      : 0b73cef6-3050-44a5-9c79-8aff7f01ed5c
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 01bfc5dbbd94d46fb483b61445d5028a00f5b04e768b578bacc75f2ef422ae0a
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : F7pjmiFwfX8ouDM+tLOU+a7EvgoGDO609H3Aw0YbKjLmmFUML9LWujc+tNeGsiU0gR3G+C1FtCW7z1RDZ5+aJe61XKJcYDa753Rno4ghNKVmm3QfeUWLBryP3b9ZkGJgcDVm9mYY9oj85BP/ySfOYFS8pMSO3UaumIRQerUQ/SS+oF2ODZYzHFSiq7BDAXLTMBXIVwySqDVldYgHwa2vSEP7LqvBzVw+4OOEyr3+GsEztRJiQZY16dVt59aF6C0JWDa5UwnJiCkDvO3iHeOiEc6SxUcFJGEh8pGIrAIbyUKthI6dv9ALPb+GgIeSLJo+ab05lQFWqF0PtSpCWcW2qg==
signature_date    : 2024-07-29T17:00:58.847603
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

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

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()
{
   "key":"{AB4CE2D7-88FB-4879-899C-91200A553A55}",
   "name":"TheBrain",
   "version":"14.0.101.0",
   "install_date":"2024-07-24 00:00:00",
   "install_location":"",
   "uninstall_string":"MsiExec.exe /I{AB4CE2D7-88FB-4879-899C-91200A553A55}",
   "publisher":"TheBrain Technologies LP",
   "system_component":0,
   "win64":true
  }


{
   "key":"{04A8069A-36CA-4F77-9683-1A99BE2D5A83}",
   "name":"TheBrain",
   "version":"14.0.101.0",
   "install_date":"2024-07-24 00:00:00",
   "install_location":"",
   "uninstall_string":"\"C:\\ProgramData\\Package Cache\\{04A8069A-36CA-4F77-9683-1A99BE2D5A83}\\TheBrain 14.0.101.0 Installer.exe\" /burn.clean.room  /uninstall",
   "publisher":"TheBrain Technologies LP",
   "system_component":0,
   "win64":true
  }
 ]
}
"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls


def install():
    # Declaring local variables
    bin_name = glob.glob('TheBrain*Installer.exe')[0]
    # Installing the software
    
    install_exe_if_needed(bin_name,
        silentflags='-q -overwrite',
        key='{AB4CE2D7-88FB-4879-899C-91200A553A55}',
        min_version=control.get_software_version(),
    )



def uninstall():
    # Définir les clés de registre à désinstaller
    keys_to_uninstall = [
        {
            "key": "{AB4CE2D7-88FB-4879-899C-91200A553A55}",
            "uninstall_string": "MsiExec.exe /I{AB4CE2D7-88FB-4879-899C-91200A553A55} /quiet /norestart"
        },
        {
            "key": "{04A8069A-36CA-4F77-9683-1A99BE2D5A83}",
            "uninstall_string": "\"C:\\ProgramData\\Package Cache\\{04A8069A-36CA-4F77-9683-1A99BE2D5A83}\\TheBrain 14.0.101.0 Installer.exe\" /burn.clean.room /uninstall /quiet /norestart"
        }
    ]

    # Boucle à travers les clés pour désinstaller
    for entry in keys_to_uninstall:
        key = entry["key"]
        uninstall_string = entry["uninstall_string"]
        
        # Vérification si le logiciel est installé en utilisant le nom
        installed = False
        for soft in installed_softwares():
            if soft['key'] == key:
                installed = True
                break
        
        if installed:
            print(f"Désinstallation de TheBrain avec la clé {key}")
            run(uninstall_string)
        else:
            print(f"La clé {key} n'est pas trouvée. Rien à désinstaller pour cette clé.")


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




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

  
    url_base = "https://www.thebrain.com/download"
    response = requests.get(url_base,allow_redirects=True, proxies=proxies)
    # Extract the correct div using bs_find_all
    divs = bs_find_all(response.text, "div","class","is-win", proxies=proxies)
    zip_file = None
    for div in divs:
        if zip_file:
            break
        links = div.find_all('a', href=True)
        for link in links:
            if 'Download for Windows' in link.text :
                href = link['href']
                zip_file = href
                download_url = requests.get(zip_file,allow_redirects=True, proxies=proxies).url
                latest_bin = download_url.split('/')[-1].replace("%"," ")
                version = latest_bin.split(" ")[-2]
                break


    # Downloading latest binaries
    print("Download URL is: %s" % download_url)
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(download_url, latest_bin, proxies=proxies)
        package_updated = True
    else:
        print("Binary is present: %s" % latest_bin)


    # Deleting outdated binaries
    for f in glob.glob('*.exe'):
        if f != latest_bin:
            remove_file(f)

      
    version = get_version_from_binary(latest_bin)
    # Mettre à jour le package
    control.set_software_version(version)
    control.save_control_to_wapt()    
        

7062688ad2455e1550c5a3c2bd0c2d4bcd41da0683abbecb1909013b338bf60f : setup.py
2c0db18ddb58f5833d5b1c9d6cc11f055d7d472c33dc4c906dabfee6a308ec26 : update_package.py
01bfc5dbbd94d46fb483b61445d5028a00f5b04e768b578bacc75f2ef422ae0a : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
c44b9c72df3a481f4b8ca06a6a50c59bf192027db2b6466722180690422db062 : luti.json
f01d934e5a247163cd6e5aeecc3977cf9a433266226510954856597734b43b9a : TheBrain 2014.0.101.0 20Installer.exe
0825a7b8419c15703a91f842aba5822e2cfdea6c84ef552cd122a5fef152e709 : WAPT/control