[SOLVED] Package for Eraser (Windows)

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
bastien30
Messages: 38
Registration: March 8, 2024 - 3:21 PM

November 20, 2025 - 12:30

Good morning,

I created a package for the Eraser software under Windows, with update_package() working.

setup.py:

Code: Select all

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

def install():
    appver = control.version.split('-',1)[0]
    install_msi_if_needed(r'Eraser_%s.msi' % appver)
    remove_desktop_shortcut("Eraser")

def update_package():
    url = control.sources
    appver = control.version.split('-',1)[0]
    bin_zip = "Eraser.exe"
    bin_msi = r'Eraser (x64).msi'
    found = False
    if isfile(bin_zip):
        remove_file(bin_zip)
    for releases in bs_find_all(url, "a", "href"):
        if not "Eraser%20" in releases["href"]:
            continue
        if releases["href"].endswith(r'.exe/download'):
            if any(s in releases["href"] for s in ("Alpha", "Beta", "Runtime", "runtime")):
                continue
            else:
                version = releases["href"].split("%20")[2].split(".exe")[0]
                if Version(version) > Version(appver):
                    url_dl = releases["href"]
                    found = True
                    break
    
    if found:
        print(r'Latest version is %s' % version)
        wget(url_dl, bin_zip)
        bin_version = get_version_from_binary(bin_zip)
        if bin_version != version:
            error("Installer version is not the same as specified on download page !")
        else:
            unzip_with_7zip(filename=bin_zip, target=".", filenames=bin_msi, extract_with_full_paths=False)
            os.rename(bin_msi, r'Eraser_%s.msi' % version)
            remove_file(bin_zip)

            # Changing version of the package
            control.version = '%s-%s'%(version, control.version.split('-')[-1])
            control.save_control_to_wapt()
    else:
        print("Already up to date")
    
    remove_outdated_binaries(version)
control:

Code: Select all

package           : xxx-eraser
version           : 6.2.0.2996-2
architecture      : x64
section           : base
priority          : optional
name              : Eraser
categories        : Security,Utilities
maintainer        : XXXX
description       : Eraser permet de supprimer de façon sécurisé des fichiers ou des dossiers
depends           : 
conflicts         : 
maturity          : 
locale            : all
target_os         : windows
min_wapt_version  : 
sources           : https://eraser.heidi.ie/download/
installed_size    : 
impacted_process  : Eraser
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : The Eraser Project
keywords          : 
licence           : GNU GPL
homepage          : https://eraser.heidi.ie/
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
italbot
Messages: 61
Registration: Sep 26, 2023 - 3:50 p.m.

November 21, 2025 - 3:42 PM

Hello,

Thank you for sharing.
We've just packaged the software; it will be on the store in 5 days.

Sincerely,

Ingrid
Tranquil IT
Locked