[SOLVED] Meca3D package sw2019 x64 build v19.0.0.113

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
olaplanche
Messages: 178
Registration: January 26, 2017 - 11:11

August 23, 2022 - 1:58 PM

I'm sharing my Meca3d package, which usually goes hand in hand with SolidWorks software:
The license variable needs to be updated, taking into account that an evaluation license exists: MSD-9903999-A

Code: Select all

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

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

licence = 'MSD-9903XXX-A'

def install():
    # Declaring local variables
    import tempfile
    import codecs
    pathinstallfile = makepath(tempfile.gettempdir(),'Meca3d_v19.inf')
    data = r"""[Setup]
Lang=mytrans
Dir=C:\Program Files\Meca3d SolidWorks v19.0
Group=Meca3d SolidWorks v19.0
NoIcons=0
Tasks="""
    fichier = codecs.open(pathinstallfile, "w")
    fichier.write(data)
    fichier.close()

    # Installing the software
    print("Installing: %s" % control.package)
    registry_set(HKEY_LOCAL_MACHINE,r'Software\Atemi\Meca3d SolidWorks','Serial Number',licence,type=REG_SZ)
    install_exe_if_needed('Meca3d_Sw2019_x64_Rollout_v19.0.0.113.exe',
        silentflags='/verysilent /supressmsgboxes /loadinf=%s' % pathinstallfile,
        key='{E4C0044A-A35D-4545-B766-84D0AA148D22}_is1',
        min_version='19.0.0.113'
    )
    uninstallkey.remove('{E4C0044A-A35D-4545-B766-84D0AA148D22}_is1')
    remove_file(pathinstallfile)

def uninstall():
    run(r'"%s\Meca3d SolidWorks v19.0\unins000.exe" /verysilent' % programfiles64)
    if reg_key_exists(HKEY_LOCAL_MACHINE,r'Software\Atemi'):
        registry_deletekey(HKEY_LOCAL_MACHINE,r'Software\Atemi\Meca3d SolidWorks','v19')
        registry_deletekey(HKEY_LOCAL_MACHINE,r'Software\Atemi','Meca3d SolidWorks')
        registry_deletekey(HKEY_LOCAL_MACHINE,r'Software','Atemi')
- Installed WAPT version: 2.6.0.16795 Enterprise
- Server OS: Linux / Debian Bookworm
- Administration/package creation machine OS: Windows 10
Locked