tis-malwarebytes
4.5.2.260-4
Malwarebytes is an anti-malware software that finds and removes malware
4144 downloads
View on


Description
- package : tis-malwarebytes
- version : 4.5.2.260-4
- architecture : all
- categories : Security
- maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
- description : Malwarebytes is an anti-malware software that finds and removes malware
- locale : all
- target_os : windows
- min_wapt_version : 2.0
- sources : https://www.malwarebytes.com/mwb-download
- installed_size : 250847232
- impacted_process : mbam,MbamBgNativeMsg,MBAMInstallerService,MbamPt,MBAMService,mbamtray,MBAMWsc,mbuns,malwarebytes_assistant
- description_fr : Malwarebytes est un logiciel créé pour détecter et supprimer les logiciels malveillants
- description_pl :
- description_de :
- description_es :
- description_pt :
- description_it :
- description_nl :
- description_ru :
- editor : Malwarebytes
- licence : freemium
- signature_date : 2022-01-30T13:03:44.064593
- Homepage : https://fr.malwarebytes.com/
Setup.py
# -*- coding: utf-8 -*-
from setuphelpers import *
import platform
r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()
"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
bin_name = "MBSetup.exe"
silentflags = "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART"
app_uninstallkey = "{35065F43-4BB2-439A-BFF7-0F1014F2E0CD}_is1"
app_editor_dir = makepath(programfiles, "Malwarebytes")
app_dir = makepath(programfiles, "Malwarebytes", "Anti-Malware")
bin_path = makepath(app_dir, "mbuns.exe")
def install():
# Declaring local variables
package_version = control.get_software_version()
# Installing the software
print("Installing: %s (%s)" % (control.name, package_version))
install_exe_if_needed(
bin_name,
silentflags=silentflags,
key=app_uninstallkey,
min_version="",
)
# Avoiding the usage by WAPT of the app built-in Uninstallstring
uninstallkey.remove(app_uninstallkey)
def audit():
# Declaring local variables
package_version = control.version.split("-", 1)[0]
app_name = control.name
# Getting installed software version
if installed_softwares(uninstallkey=app_uninstallkey):
installed_version = installed_softwares(uninstallkey=app_uninstallkey)[0]["version"]
else:
installed_version = None
# Auditing software
print("Auditing: %s" % control.package)
if installed_version is None:
print("%s is not installed" % (app_name, installed_version))
return "ERROR"
else:
print("%s is installed in correct version (%s)" % (app_name, installed_version))
return "OK"
def uninstall():
# Uninstalling the software
for to_uninstall in installed_softwares(app_uninstallkey):
print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
killalltasks(control.impacted_process.split(","))
run([bin_path] + ["/VERYSILENT"] + ["/NORESTART"])
wait_uninstallkey_absent(to_uninstall["key"])
""" if service_installed("MBAMService"):
service_delete("MBAMService") """
""" if isdir(app_dir):
killalltasks(control.impacted_process.split(","))
print("Removing: %s" % (app_dir))
remove_tree(app_dir)
if isdir(app_editor_dir) and dir_is_empty(app_editor_dir):
print("Removing: %s since he is empty" % (app_editor_dir))
remove_tree(app_editor_dir) """
def update_package():
# Declaring local variables
result = False
proxies = get_proxies()
if not proxies:
proxies = get_proxies_from_wapt_console()
url = "https://www.malwarebytes.com/mwb-download"
download_url = "https://data-cdn.mbamupdates.com/web/mb4-setup-consumer/MBSetup.exe"
latest_bin = download_url.split("/")[-1]
# Downloading latest binaries
if not isfile(latest_bin):
remove_file(latest_bin)
if not isfile(latest_bin):
print("Downloading: %s" % latest_bin)
wget(download_url, latest_bin, proxies=proxies)
# Checking version from file
version = get_version_from_binary(latest_bin, "FileVersion")
# Changing version of the package
if Version(version) > Version(control.get_software_version()):
print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
result = True
else:
print("Software version up-to-date (%s)" % Version(version))
control.version = "%s-%s" % (Version(version), control.version.split("-", 1)[-1])
# control.set_software_version(version)
control.save_control_to_wapt()
# Deleting outdated binaries
remove_outdated_binaries(version)
# Validating update-package-sources
return result
def remove_outdated_binaries(version, list_extensions=["exe", "msi", "deb", "rpm", "dmg", "pkg"], filename_contains=None):
r"""Remove files based on the version contained in his filename, failing over on file version on compatible OSes
Args:
version (str): version number of keeped files
list_extensions (str or list of str): file extensions of compared files
filename_contains (str or list of str): Part of the filename that must be contained (useful for distinguishing architecture and os)
Returns:
list: list of deleted files
.. versionadded:: 2.0
.. versionchanged:: 2.2
Now returns removed files, now checking .exe and .msi file versions
"""
files = []
if type(list_extensions) != list:
list_extensions = [list_extensions]
if filename_contains:
if type(filename_contains) != list:
filename_contains = [filename_contains]
list_extensions = ["." + ext for ext in list_extensions if ext[0] != "."]
for file_ext in list_extensions:
for bin_in_dir in glob.glob("*%s" % file_ext):
if not version in bin_in_dir:
if platform.system() == "Windows":
if file_ext == ".exe" or file_ext == ".msi":
if Version(version) == Version(get_version_from_binary(bin_in_dir, "FileVersion")) or Version(version) == Version(
get_version_from_binary(bin_in_dir, "ProductVersion")
):
print("%s file or product version is correct (%s)" % (bin_in_dir, version))
continue
remove_file(bin_in_dir)
files.append(bin_in_dir)
if filename_contains:
for filename_contain in filename_contains:
if not filename_contain in bin_in_dir:
remove_file(bin_in_dir)
files.append(bin_in_dir)
return [fn for fn in files]