Presenting… StartComponentCleanup for MSI (including Office)

Discussion in 'MDL Projects and Applications' started by 600415, Aug 11, 2018.

Tags:
  1. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    4,919
    5,848
    150
    ;):eek:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. MMIKEE

    MMIKEE MDL Senior Member

    Oct 6, 2012
    326
    295
    10
    I saved this script as: MSP (Office.msp Superseded Patches Uninstaller).vbs then Double Click it, and it works very well...
    I use this script each month after I install the WHDownloader updates for Office 2010..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    10,762
    44,791
    340
    From admin cmd?
    you don't get anything? no errors or output?
     
  4. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    6,655
    14,504
    210
    From admin cmd, yes.
    Nothing.
    No outputs or errors.

    I uninstalled all my sec programs, nothing.
    File location: D:\Dektop\office.vbs
    Tried double click on it and from admin cmd.

    Windows 8.1 x64
    I manually deleted a long time ago lots of Office folders within C:\Windows\Installer\$PatchCache$

    Damn!
     
  5. ch100

    ch100 MDL Senior Member

    Sep 11, 2016
    333
    297
    10
    What is actually not working?
    Even if you deleted the relevant folders, it should still execute and come up with something.
    It is not only Office, but anything based on msi, like Adobe Reader and its updates, although it normally would not clean anything unless editing the registry (or by using the -force flag which I avoid, but is there), but would still come up with a message.
    I even used this script with product like MS SQL Server and its patches and Service Packs and works perfectly.
     
  6. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    6,655
    14,504
    210
    I understand is not only Office but any msi stuff. When I double click on the vbs file or execute from admin cmd, nothing happens. Not a single msg box or anything showing a process has started...
     
  7. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    10,762
    44,791
    340
    @Mr.X

    You probably don't have any installed MSI patches (msp files)

    i just tested the script (i don't have any patches), and i got no output too :)
    you can remove ' from this line to get list of installed products
    Code:
     'Wscript.Echo productU & "\" & productN
     
  8. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    10,762
    44,791
    340
    Run from command prompt
    i don't see any msp files, all are folders :)

    anyway, maybe your registry is corrupted
    check or export this key:
    Code:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products
     
  9. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    6,655
    14,504
    210
    lol you didn't wait the gif when it shows the msp files down below...
     
  10. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    6,655
    14,504
    210
  11. ch100

    ch100 MDL Senior Member

    Sep 11, 2016
    333
    297
    10
    #34 ch100, Dec 3, 2019
    Last edited: Dec 3, 2019
    It is my turn now to say that your line of code is not working (with' or without) wscript.png . :)
    On what Operating System is this running?
    I am on Win10 - 1909.


    EDIT: Sorry @abbodi1406 I misinterpreted your post.
    @Mr.X clarified it for me.
     
  12. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    6,655
    14,504
    210
    That line is part of the original code (see first post). Just remove the ' from that specific line found in the original code to get list of installed products. Well, I understood in that manner. Anyway the code does not work for me.
     
  13. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    6,655
    14,504
    210
    Just run it now and this is the output:
    patch cleaner.png
     
  14. ch100

    ch100 MDL Senior Member

    Sep 11, 2016
    333
    297
    10
    It appears to be running. I used to run Patch Cleaner before discovering the script here.
    I can only think that there is a problem with your scripting engine, but I cannot assist further other than saying to try reinstalling OS in upgrade mode.
     
  15. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,733
    310
    60
    Doesn't DISM++ do this type of cleaning?
     
  16. Mouri_Naruto

    Mouri_Naruto MDL Developer

    Jul 10, 2014
    388
    1,297
    10
    #40 Mouri_Naruto, Dec 15, 2019
    Last edited: Dec 15, 2019
    Dism++ remove superseded msp patches. I am the author of Dism++'s Windows Installer Cleanup Item.

    But I remove the file and registry of the superseded msp patches directly instead of using Windows Installer API to remove the superseded msp patches. Because it's superseded.

    WICP.png

    Many MSP patches don't supersede the old one. For example, Microsoft Office. Or uninstalled automatically before installing the new one. For example, Visual Studio 2012/2013/2015.

    So it can't clean up a lot.

    But I have found a better way to save space.(I can streamline the msp file itself and make installing other updates and uninstall the app. But I can't promise it's OK when add the component for the app.) But that method haven't been verified a lot.

    P.S. Also, I have analysed the PatchCleaner from HomeDev. It does the same thing as my implementation in Dism++.

    Kenji Mouri