[SOLVED] SolidWorks 2022 SP3.1 Package

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:31 PM

I am sharing my package for installing SolidWorks 2022 SP3.1 software with an educational network license.

First, you need to create an administrative image from the SolidWorks installation sources and copy the folder from this image into the wapt packagehttps://help.solidworks.com/2019/Englis...deploy.htm)

The command "startswinstall.exe /uninstall" cannot be used in the uninstall() function because the sources are no longer accessible at that time.
:!: The order in which dependencies are uninstalled in the uninstall() function is not left to chance. :!:

Code: Select all

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

def install():
    print('Installing: %s' % control.name)
    install_exe_if_needed(r'SOLIDWORKS 2022 SP3.1\startswinstall.exe',silentflags='/install /now',timeout=900)

def uninstall():
    # Remove software and all dependances installed by my custom Administrative SolidWorks Image. You should probably adapt this function to your Administrative Image.
    print('Uninstalling SOLIDWORKS Flow Simulation 2022 SP03.1')
    run(r'"MsiExec.exe" /X{A9F14961-697D-455C-B48B-FCE9E22664A5} /passive') # SOLIDWORKS Flow Simulation 2022 SP03.1
    print('Uninstalling SOLIDWORKS eDrawings 2022 SP03.1')
    run(r'"MsiExec.exe" /X{08A73D4E-3FD0-4242-B08F-A41D8969C5B4} /qb') # SOLIDWORKS eDrawings 2022 SP03.1
    print('Uninstalling SOLIDWORKS 2022 French Resources')
    run(r'"MsiExec.exe" /X{EBFF07B4-D9ED-4395-B6C7-D83C44FF2216} /qb') # SOLIDWORKS 2022 French Resources
    print('Uninstalling Bonjour')
    run(r'"MsiExec.exe" /X{6E3610B2-430D-4EB0-81E3-2B57E8B9DE8D} /qb') # Bonjour
    print('Uninstalling WPTx64')
    run(r'"MsiExec.exe" /X{0B2C58EB-67A2-225B-60B2-D1990E55DD33} /qb') # WPTx64
    print('Uninstalling Microsoft Visual C++ 2010  x64 Redistributable - 10.0.40219')
    run(r'"MsiExec.exe" /X{1D8E6291-B0D5-35EC-8441-6616F567A0F7} /qb') # Microsoft Visual C++ 2010  x64 Redistributable - 10.0.40219
    print('Uninstalling Microsoft Visual C++ 2010  x86 Redistributable - 10.0.40219')
    run(r'"MsiExec.exe" /X{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5} /qb') # Microsoft Visual C++ 2010  x86 Redistributable - 10.0.40219
    print('Uninstalling Microsoft Visual Studio Tools for Applications 2015')
    run(r'"C:\ProgramData\Package Cache\{ab213ab7-4792-4c6f-a3fa-8485d06c3475}\vsta_setup.exe"  /uninstall /S') # Microsoft Visual Studio Tools for Applications 2015
    print('uninstalling: %s' % control.package)
    run(r'"MsiExec.exe" /X{26EA0056-4BAD-4F9E-BDCE-A72E25C7D06D} /passive') # SOLIDWORKS 2022 SP03.1
    print('Uninstalling SolidWorks Installation Manager')
    if reg_key_exists(HKEY_LOCAL_MACHINE,r'SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\SolidWorks Installation Manager 20220-40301-1100-100'):
        registry_deletekey(HKEY_LOCAL_MACHINE,r'SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall',r'SolidWorks Installation Manager 20220-40301-1100-100')
        remove_tree(r'C:\Windows\Solidworks')
    print('Remove extra folders and data')
    remove_tree(r'C:\Program Files\SOLIDWORKS Corp')
    remove_tree(r'C:\SOLIDWORKS Data')
    remove_tree(r'C:\ProgramData\SOLIDWORKS')
:!: This package meets my needs, feel free to adapt it. :!:

To go further, it might be relevant to separate all the modules installed by the administrative image into different wapt packages... (https://help.solidworks.com/2022/englis ... d_line.htm)
- Installed WAPT version: 2.6.0.16795 Enterprise
- Server OS: Linux / Debian Bookworm
- Administration/package creation machine OS: Windows 10
Locked