Delete Empty Components

Description:

This script will delete empty components from a Windows Installer.

Usage

CScript.exe {Script} {MSI}

Script

 

11 thoughts on “Delete Empty Components

  1. Hi,

    i have tried using this script to remove empty component, but its not removing them, i am not getting any error it say just processing MSI.

    WriteLog “Deleting Empty Components”

    WriteLog “Processing: “ & MSIPath.Name

     

    i have updated the script with

    Dim Test : Set Test = dataView.Fetch ‘after line 51.

    Script is deleting some components with file along with empty components.

    Kindly Help.

    Many Thanks,

    Shashi

  2. Hmmm. I’ve just repositioned ’emptyComponent = True’. Try again – perhaps use WriteLog to debug the code. Let me know how you get on.

  3. If the MSI isn’t too big you can zip it and mail it to me. If it is big, strip out all the cabs/streams first…. Give me an example of a component that it is not removing.

  4. My Test MSI has some empty components i tried using the write log, the script is not going in to the below condition.

    If emptyComponent  Then
    WriteLog ” component name: ” & tempComponent
    WriteLog “Deleting empty component: ” & tempComponent
    End If

  5. If i add the below after line 51 in the script,

    Dim Test : Set Test = dataView.Fetch

    Script enters the loop :

    If emptyComponent  Then
    WriteLog ” component name: ” & tempComponent
    WriteLog “Deleting empty component: ” & tempComponent
    End If

    Log Output:

    9/27/2016 4:39:49 PM: Deleting Empty Components
    9/27/2016 4:39:49 PM: Processing: Test.msi
    9/27/2016 4:39:49 PM: component name: NewComponent2
    9/27/2016 4:39:49 PM: Deleting empty component: NewComponent2
    9/27/2016 4:39:49 PM: component name: NewComponent1
    9/27/2016 4:39:49 PM: Deleting empty component: NewComponent1
    9/27/2016 4:39:49 PM: component name: LendingBBLOracleConnect_old.dll
    9/27/2016 4:39:49 PM: Deleting empty component: LendingBBLOracleConnect_old.dll
    9/27/2016 4:39:49 PM: component name: OraOps10.dll
    9/27/2016 4:39:49 PM: Deleting empty component: OraOps10.dll
    9/27/2016 4:39:49 PM: component name: gacutil.exe
    9/27/2016 4:39:49 PM: Deleting empty component: gacutil.exe
    9/27/2016 4:39:49 PM: component name: LendingBBLOracleConnect_SELEX.dll
    9/27/2016 4:39:49 PM: Deleting empty component: LendingBBLOracleConnect_SELEX.dl

  6. Sorry, I can’t debug without seeing the MSI Tables. All I can suggest is that you use WriteLog to debug the SQL queries and the Loops/If statements…

  7. I have one query component having ini table entry I want move to different component   and then want delete that component ,

    For example ;

    A&B having two components

    A component having exe file

    B component having ini table entry

    Just I want to move ini file to A component

    Then I want delete B component

    Can you please add this point to delete component script

  8. Empty component having entry in create table, then that empty component will not be able to delete form the script, could please help

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.