none
How to install MSP on selected computers via GPO Startup VBscript RRS feed

  • Question

  • Hi folks,

    I'm trying to write a vbscript that will run on startup and do the following:

    1) Detect whether or not a particular application is installed

    2) Determine if the latest version of said application is installed

    3) If not, run the MSP update from a server and apply the patch before login.

    I'm on a domain, and the script works when manually run from a command prompt.  I also have the script added to a test GPO under Computer Config>Windows Settings>Startup, but since this is my first real attempt at scripting, I'm not sure how to determine why the *.MSP file isn't running and get this working.

    Here's my code so far:

    Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
    
        strComputer = "."
        strKey = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"
        strEntry1a = "DisplayName"
        strEntry1b = "QuietDisplayName"
        strEntry1c = "DisplayVersion"
        strEntry1d = "UninstallString"
    
    
    '    Set args = Wscript.Arguments	' Get Command Line Argument
    '    strVersion = WScript.Arguments.Item(0)
    
        Set objReg = GetObject("winmgmts://" & strComputer & "/root/default:StdRegProv")
        objReg.EnumKey HKLM, strKey, arrSubkeys
    intVersionNum="1.0"
        For Each strSubkey In arrSubkeys
        intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, strEntry1a, strValue1)
    if intRet1 <> "" Then
    objReg.GetExpandedStringValue HKLM, strKey & strSubkey, strEntry1a, strValue1
    intCompare=StrComp("Adobe Acrobat XI Pro",strValue1,vbTextCompare)
        IF intCompare = 0 THEN
    objReg.GetExpandedStringValue HKLM, strKey & strSubkey, strEntry1c, intVersionNum
        END IF
    End If
    Next
    
    IF intVersionNum="1.0" THEN
            WScript.Quit 2			' Not Found 
    END IF
    
    intVersionCompare=StrComp("11.0.06",intVersionNum,vbTextCompare)
    IF intVersionCompare = 0  THEN		' Everything OK
    WScript.Quit 0
    ELSE					' Run Update
    Set oShell = WScript.CreateObject("WSCript.shell")
    oShell.run "msiexec.exe /update \\RedactedServer\gpo\Acrobat\AcrobatXIPro\AcrobatUpd11006.msp /quiet"
    WScript.Quit 1
    END IF


    Note: RedactedServer isn't a variable; I removed our servername.  Also, I'm reasonably certain there isn't a permissions issue because we use the \\RedactedServer\GPO\ to successfully deliver all of our MSI GPO updates.

    When I restart, it looks like the script starts to run(?), but the update isn't installed.  In the Application log, all I see is this:

    But, there's no follow-up entry indicating that it was successful or even completed.

    Ideally, I'd also like to be able to pass in a command line parameter from the GPO so I can update it without having to edit the script every time a new update comes out, but I'd prefer to run before I fly.

    Lastly, yes, the script is looking for Adobe Acrobat XI Pro.  I'm aware I can slipstream the MSP into an AIP and push it that way, but I don't want to redeploy a 2.3 GB installation to each computer that needs an update every 3 months when this will accomplish the goal much quicker and more efficiently.

    Does anyone have ideas?  I've beat my head against this all day, and my search-fu doesn't seem to be helping me find the answers I need.

    Thanks,

    Rick

    Wednesday, February 5, 2014 9:44 PM

Answers

  • Not possible?  Interesting, because, as it turns out, my script is correct and runs successfully.  I just wasn't giving it long enough to complete.  I even added in the command line parameter I was hoping for.

    • Marked as answer by useq Thursday, February 6, 2014 1:41 PM
    Thursday, February 6, 2014 1:41 PM

All replies

  • Post in Adobe forum.  You will find that this is not possible.  Adobe will get you connected to the deployment service and you can download the MSI that is used to install or update Adobe.  It has to be prepped first and cannot be installed by WMI.

    Adobe has the documents explaining how to do this.


    ¯\_(ツ)_/¯

    Wednesday, February 5, 2014 10:40 PM
  • Not possible?  Interesting, because, as it turns out, my script is correct and runs successfully.  I just wasn't giving it long enough to complete.  I even added in the command line parameter I was hoping for.

    • Marked as answer by useq Thursday, February 6, 2014 1:41 PM
    Thursday, February 6, 2014 1:41 PM
  • Microsoft note that Office 2013 cannot be installed by Software Distribution.  The MSP you have is a patch file.  The script is a cleaner.

    I do not know what is waiting for what or what script you may be referring to.

    If you think it is fixed then good but I do not really understand what you are saying has worked.


    ¯\_(ツ)_/¯

    Thursday, February 6, 2014 2:36 PM