[Cleanup] Uninstalled versions of ecu.test or trace.check waste space on system
Issue
After uninstalling a previously installed version of ecu.test or trace.check, I notice that not all of the disk space is freed up.
Where does your .msi
or .exe
installer or your product store data?
Solution
Redundant product installers in the Package Cache directories of Windows
During the installation of ecu.test or trace.check a copy of the .msi
or .exe
setup file is stored in a subfolder of %ProgramData%\Package Cache
or %LocalAppData%\Package Cache
. Microsoft Windows uses these files to repair, uninstall, modify or reinstall the program.
Thus, it is strongly recommended to keep these files for all versions of ecu.test or trace.check currently installed on the system. Due to a bug these cached installers are not deleted when uninstalling or updating existing products, nor when installing recent product versions.
You can search for files containing ecu.test or trace.check within these folders and delete those that belong to product versions that are currently not installed.
Conveniently, you may automate this error-prone process with the following script.
However, please note that we cannot guarantee or warrant the intended functionality of the script.
Any execution of this open source script is at your own risk.
Preconditions
Python is installed, preferably in a recent 3.10 version like https://www.python.org/downloads/release/python-31013/
Cleanup script has been downloaded from here
Script execution
Save the script on your computer, e.g. in
%USERPROFILE%\Downloads
Open a command prompt in this location (for instance by typing cmd in the address bar of Windows Explorer)
Execute the script:
python CleanUpPackageCacheETTC.py --dry-run
During a dry-run no files will be removed, instead you will obtain output like this:
C:\Users\<USER>\Downloads>python CleanUpPackageCacheETTC.py --dry-run
Dry run: files are not removed!
Removed C:\ProgramData\Package Cache\{3747CED2-FC49-59A0-9C84-626A634BBCDD}v2022.4.3.0 [OK]
Skipped C:\ProgramData\Package Cache\{51898C5F-12DD-5EDA-ADDB-2724696C7B7A}v2023.3.0.0\setup ECU-TEST 2023.3.0-RC.msi
Removed C:\Users\<USER>\AppData\Local\Package Cache\{66CEA3C0-9CDA-58A0-97F6-8B87D1F96772}v2023.3.0.0 [OK]
Skipped C:\ProgramData\Package Cache\{E8171865-8903-597F-BE6B-1FCE01624D64}v2023.2.0.0\setup ECU-TEST 2023.2.0-RC.msi
Skipped C:\ProgramData\Package Cache\{F90C432D-607C-54AB-A08D-F028A2F8132C}v2023.1.4.0\setup ECU-TEST 2023.1.4-RC.msi
Skipped C:\ProgramData\Package Cache\{8E82C380-88E5-5D0C-BBD6-49146440395A}v2021.3.0.0\setup TRACE-CHECK 2021.3-RC.msi
The lines starting with Removed can safely be deleted as the corresponding versions of ecu.test or trace.check are no longer installed on the system.
The lines starting with Skipped correspond to currently installed versions of ecu.test or trace.check and must remain on the system.
In order to delete these files automatically, open a command prompt
a) with administrator privileges to cleanup the installation files of products installed for all users of the system.
b) without administrator privileges to cleanup the installation files of products installed for the current Windows user only.
Navigate to the script location and execute the script:
python CleanUpPackageCacheETTC.py
The script output will look like that of step 4, but the --dry-run-line will not be displayed and the files are actually removed along with the folder that contains them.
If you run the script without administrator privileges, only installation files of products installed for the current Windows user are cleaned. In this case, for system-wide
installed products, you will get the status [ERROR] instead of [OK]. This indicates that the script was unable to delete these files because of missing permissions.
Still missing some megabytes?
ecu.test or trace.check stores several data locally. For instance, cached bus data bases are used across workspaces and thus need to be saved outside of it.
The exact storage location depends on your operating system and user specific or computer specific settings.
The default locations can be found in the help under Workspace / File management / Local data within the installation directory of ecu.test.Per default configuration in Microsoft Windows our products ecu.test and trace.check are installed within
C:\Program Files
if the installer is executed with administrator privileges.
Otherwise the program files are stored in%LocalAppData%
per default.It is strongly recommended not to simply delete these files, but to use the uninstaller instead (e.g. via the Start menu or using Windows Settings > Apps & features).