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

    Joined:
    Oct 18, 2014
    Messages:
    6,206
    Likes Received:
    7,533
    Trophy Points:
    210
    ;):eek:
     
  2. MMIKEE

    MMIKEE MDL Senior Member

    Joined:
    Oct 6, 2012
    Messages:
    352
    Likes Received:
    313
    Trophy Points:
    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..
     
  3. abbodi1406

    abbodi1406 MDL KB0000001

    Joined:
    Feb 19, 2011
    Messages:
    12,067
    Likes Received:
    55,424
    Trophy Points:
    340
    From admin cmd?
    you don't get anything? no errors or output?
     
  4. Mr.X

    Mr.X MDL Guru

    Joined:
    Jul 14, 2013
    Messages:
    7,625
    Likes Received:
    14,952
    Trophy Points:
    240
    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 Addicted

    Joined:
    Sep 11, 2016
    Messages:
    629
    Likes Received:
    523
    Trophy Points:
    30
    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

    Joined:
    Jul 14, 2013
    Messages:
    7,625
    Likes Received:
    14,952
    Trophy Points:
    240
    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

    Joined:
    Feb 19, 2011
    Messages:
    12,067
    Likes Received:
    55,424
    Trophy Points:
    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. Mr.X

    Mr.X MDL Guru

    Joined:
    Jul 14, 2013
    Messages:
    7,625
    Likes Received:
    14,952
    Trophy Points:
    240
  9. abbodi1406

    abbodi1406 MDL KB0000001

    Joined:
    Feb 19, 2011
    Messages:
    12,067
    Likes Received:
    55,424
    Trophy Points:
    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
     
  10. Mr.X

    Mr.X MDL Guru

    Joined:
    Jul 14, 2013
    Messages:
    7,625
    Likes Received:
    14,952
    Trophy Points:
    240
    lol you didn't wait the gif when it shows the msp files down below...
     
  11. Mr.X

    Mr.X MDL Guru

    Joined:
    Jul 14, 2013
    Messages:
    7,625
    Likes Received:
    14,952
    Trophy Points:
    240
  12. abbodi1406

    abbodi1406 MDL KB0000001

    Joined:
    Feb 19, 2011
    Messages:
    12,067
    Likes Received:
    55,424
    Trophy Points:
    340
  13. Mr.X

    Mr.X MDL Guru

    Joined:
    Jul 14, 2013
    Messages:
    7,625
    Likes Received:
    14,952
    Trophy Points:
    240
  14. ch100

    ch100 MDL Addicted

    Joined:
    Sep 11, 2016
    Messages:
    629
    Likes Received:
    523
    Trophy Points:
    30
    #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.
     
  15. Mr.X

    Mr.X MDL Guru

    Joined:
    Jul 14, 2013
    Messages:
    7,625
    Likes Received:
    14,952
    Trophy Points:
    240
    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.
     
  16. ch100

    ch100 MDL Addicted

    Joined:
    Sep 11, 2016
    Messages:
    629
    Likes Received:
    523
    Trophy Points:
    30
  17. Mr.X

    Mr.X MDL Guru

    Joined:
    Jul 14, 2013
    Messages:
    7,625
    Likes Received:
    14,952
    Trophy Points:
    240
    Just run it now and this is the output:
    patch cleaner.png
     
  18. ch100

    ch100 MDL Addicted

    Joined:
    Sep 11, 2016
    Messages:
    629
    Likes Received:
    523
    Trophy Points:
    30
    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.
     
  19. MonarchX

    MonarchX MDL Expert

    Joined:
    May 5, 2007
    Messages:
    1,732
    Likes Received:
    310
    Trophy Points:
    60
    Doesn't DISM++ do this type of cleaning?
     
  20. Mouri_Naruto

    Mouri_Naruto MDL Developer

    Joined:
    Jul 10, 2014
    Messages:
    416
    Likes Received:
    1,409
    Trophy Points:
    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