Windows 10 cleanup and upgrade
Published: July 21, 2020 - 10:32 AM
WAPT 1.8.2.7269
Server OS: Debian
OS DEV: Windows 10
Good morning,
I just updated my Windows10 upgrade package to v2004 and everything works perfectly.
I wanted to know if anyone had a solution via WAPT to clean up the residues from the update installation.
Because after installation I find myself with 16.3GB of space for temporary files "Previous Windows installations" which I would like to delete to free up space and put it in the audit section.
I found this which works, but not silently:
I also noticed that the windows10-upgrade package in the audit section was not working because it did not delete the "Windows Upgrade" folder.
By adding the variable upgrade_path = makepath(systemdrive,'WindowsUpgrade') in def audit and removing the try, the folder is deleted correctly.
Here is my modification:
Thank you
Server OS: Debian
OS DEV: Windows 10
Good morning,
I just updated my Windows10 upgrade package to v2004 and everything works perfectly.
I wanted to know if anyone had a solution via WAPT to clean up the residues from the update installation.
Because after installation I find myself with 16.3GB of space for temporary files "Previous Windows installations" which I would like to delete to free up space and put it in the audit section.
I found this which works, but not silently:
Code: Select all
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Setup Files' -PropertyType 'DWORD' -Force -Name 'StateFlags1337' -Value 0x2
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Previous Installations' -PropertyType 'DWORD' -Force -Name 'StateFlags1337' -Value 0x2
cleanmgr.exe /SAGERUN:1337By adding the variable upgrade_path = makepath(systemdrive,'WindowsUpgrade') in def audit and removing the try, the folder is deleted correctly.
Here is my modification:
Code: Select all
def audit():
# Declaring specific app values
package_version = control.version.split('-')[0]
latest_version = package_version
upgrade_path = makepath(systemdrive,'WindowsUpgrade')
if Version(windows_version()) < Version(latest_version):
print('Windows Upgrade has not succeed')
return 'ERROR'
elif isdir(upgrade_path):
print('Windows %s already up-to-date' % windows_version())
print('Cleanup as upgrade suceeded..')
print('remove WindowsUpgrade')
remove_tree(upgrade_path)
else:
print('Windows %s already up-to-date' % windows_version())
return 'OK'