Ho uno strano problema con il mio pacchetto SolidWorks 2024. Si installa correttamente e si disinstalla. Ma se provo a reinstallarlo sullo stesso PC, "finge" di installarsi. La funzione install() del pacchetto non restituisce un errore (il controllo è disabilitato), ma in realtà non si reinstalla nulla. Se eseguo un'installazione manuale della stessa versione di SolidWorks, si installa correttamente sul computer.
Ecco il file setup.py:
Codice: Seleziona tutto
# -*- coding: utf-8 -*-
from setuphelpers import *
app_name = 'SOLIDWORKS 2024'
app_dir = makepath(programfiles, 'SOLIDWORKS Corp')
app_dir_binaries = makepath(app_dir,'SOLIDWORKS')
binary_name = "SLDWORKS.exe"
kill_list = [binary_name]
def install():
print('Installation de : %s' % control.name)
install_exe_if_needed(r'SW2024\startswinstall.exe',silentflags='/install /now',timeout=1800)
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 CEF for SOLIDWORKS Applications')
run_notfatal(r'MsiExec.exe /X{A3731044-38ED-44A1-AA43-0819B422AADB} /passive /norestart')
print('Uninstalling SOLIDWORKS 2024 French Resources')
run_notfatal(r'MsiExec.exe /X{12E5ACE4-6D44-444C-BCA4-679A861D0711} /passive /norestart')
print('Uninstalling SOLIDWORKS eDrawings 2024 SP02.1')
run_notfatal(r'MsiExec.exe /X{3835B6E2-CC35-4F45-900A-5AE9772B8B24} /passive /norestart')
print('Uninstalling SOLIDWORKS Flow Simulation 2024 SP02.1')
run_notfatal(r'MsiExec.exe /X{5D202678-5697-45BE-B4DF-3208EBFE8415} /passive /norestart')
print(r'Desinstallation de SOLIDWORKS 2024 SP02.1')
run_notfatal(r'MsiExec.exe /X{E9661DF2-E1B0-423F-BFFA-1A6EF0B1307B} /passive /norestart')
print(r'Uninstalling SolidWorks Installation Manager 20240-40200-1100-100')
run_notfatal(r'"C:\WINDOWS\SolidWorks\IM_20240-40200-1100-100\sldim\sldim.exe" /remove "C:\WINDOWS\SolidWorks\IM_20240-40200-1100-100\sldim\sldIM_installed.xml"')
if reg_key_exists(HKEY_LOCAL_MACHINE,r'SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\SolidWorks Installation Manager 20240-40200-1100-100'):
registry_deletekey(HKEY_LOCAL_MACHINE,r'SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall',r'SolidWorks Installation Manager 20240-40200-1100-100')
remove_tree(r'C:\Windows\Solidworks')
print(r'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')
remove_tree(r'C:\Windows\Solidworks')
def audit():
return("OK")MODIFICA: Credo che il problema derivi dal file "SW2024\64bit\sldim\admin.dat" mancante, che ho rimosso dal pacchetto perché causava un errore di mancata corrispondenza SHA (rilevamento antivirus?). Dovrebbe essere ricreato nella cartella SW2024 subito prima dell'installazione.
