Page 1 of 1

[SOLVED] SolidWorks 2022 SP3.1 Package

Published: August 23, 2022 - 1:31 PM
by olaplanche
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)