Hi, I am deploying the Acrobbat Pro and STD, but before deployment starts I need to close the applications like Office, Outlook and some other which needs to be updated by application. What should I do in this case? Write VBScript to give a message box for users ? (If yes will that needs to be closed automatically ?? because I wrote a script to display a message but I have to click ok on that message to continue with the installation otherwise its stopping at that point)

For that can you provide a vb script to disply a message to users to close all the applicatiion before installation continues ?? How you guys doing in this case ? are u using vbscript to dispaly a message to users ? will that message box needs to be closed after some seconds like (display the message for 80 secs and close the display automatically??? by that way my installation will continues)

TY

Answer Summary:
'# Check for Office exes and prompt user again if necessary Do while ProcessIsRunning("winword.exe") or ProcessIsRunning("excel.exe") or ProcessIsRunning("powerpnt.exe") Msgbox "Word, Excel or Powerpoint is detected as running." & vbCrLf & vbCrLf & _ "If you have Excel, Word or Powerpoint open, please close these applications now," & vbCrLf &_ "THEN click OK to proceed." & vbCrLf & vbCrLf & _ "Please keep these applications closed until you are notfied this process is complete. ",vbInformation + vbSystemModal, strDialogTitle Wscript.Sleep 3000 Loop Function ProcessIsRunning(sProcessName) Dim objWMIService, objProcess, colProcess Dim sList On Error Resume Next Set objWMIService = GetObject("winmgmts:\root\cimv2") Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process") For Each objProcess in colProcess If LCase(objProcess.Name) = LCase(sProcessName) Then ProcessIsRunning = True End If Next End Function
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

1

Set the deployment to run upon login before they can fire up any programs.

You can also script out taskkill commands

This one kills the explorer.exe process:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process WHERE Name = 'explorer.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next

http://technet.microsoft.com/en-us/library/bb491009.aspx

 

Answered 08/13/2012 by: SMal.tmcc
Red Belt

  • This content is currently hidden from public view.
    Reason: Removed by user request
    For more information, visit our FAQ's.
  • Oops!! actually my framing of question confused you :))
    I am using this script for deployment
    @echo off
    start /wait cscript.exe msgBOX.vbs
    TASKKILL /F /IM iexplore.exe >NUL 2>&1
    TASKKILL /F /IM winword.exe >NUL 2>&1
    TASKKILL /F /IM outlook.exe >NUL 2>&1
    TASKKILL /F /IM excel.exe >NUL 2>&1
    TASKKILL /F /IM MSACCESS.exe >NUL 2>&1
    TASKKILL /F /IM NOTEPAD.exe >NUL 2>&1
    TASKKILL /F /IM POWERPNT.exe >NUL 2>&1
    TASKKILL /F /IM infopath.exe >NUL 2>&1
    TASKKILL /F /IM onenote.exe >NUL 2>&1
    TASKKILL /F /IM mspub.exe >NUL 2>&1
    TASKKILL /F /IM AcroRd32.exe >NUL 2>&1


    msiexec.exe /i "%~dp0AcroStan.msi" PATCH="%~dp0AcrobatUpd1013.msp" TRANSFORMS="%~dp0Acrobat_STD_10.mst" /qb /L*v "%SystemDrive%\install\logs\Acrobat_STD_10.log"

    In the above that msgBOX.vbs consists of this
    Option Explicit
    Dim MsgText, Title
    On Error Resume Next
    Title = "IMPORTANT MESSAGE : Please Read Carefully"
    MsgText="A software application is about to be installed by IT!"
    MsgText=MsgText+vbCrLf
    MsgText=MsgText+"Please save any open documents and close all Adobe & Microsoft Office Applications (IE, Word, Excel, Powerpoint and PDF...etc)"
    MsgText=MsgText+vbCrLf
    MsgText=MsgText+"Failure to do this may result in the loss of unsaved data!"

    strMbox = MsgBox(MsgText,48,Title)

    WScript.Quit

    but the installation is not continuing until and unless the msgBOX closed ??
    so is there any way to close the msg box automatically after some time?? and run the installation when only user logged in ??
  • The start /wait causes it not to continue till that function is satisfied
    you can remove the start /wait and put a sleep command prior to the taskills
    WScript.sleep 300 (in seconds)
  • got you let me try as you said, but the that sleep command will only pauses the vbscript but do not closes the msgBOX !!! am I right ? In that way how it will go for executing the next line??
  • you can tell the msgbox to time out also
    http://blogs.technet.com/b/heyscriptingguy/archive/2005/03/14/how-can-i-automatically-dismiss-a-message-box-after-a-specified-length-of-time.aspx
    http://www.visualbasicscript.com/Message-Box-with-Timeout-m51344.aspx
    • http://community.spiceworks.com/scripts/show/1061-dispaly-message-box-for-x-minutes-vbs
  • Okay that wscript.sleep did not give the positive results so changed the msgBOX.vbs script like this, its working well but need your suggestion whether use it or not?? This popup will be closed automatically after 10 seconds whether the user click on yes or not. After the i jus added ping -n 60 127.0.0.1 > NUL in main batch script to stop killing the processes till 60 sec to save users their work...

    Option Explicit
    On Error Resume Next
    Dim objshell, wshYesDialog, intReturn
    Const wshYes = 6
    Const wshNo = 7
    Const wshYesNoDialog = 4
    Const wshQuestionMark = 32

    Set objShell = CreateObject("Wscript.Shell")

    intReturn = objShell.Popup("A software application application is about to be installed by IT! Please save any open documents and close all Adobe & Microsoft Office Applications (IE, Word, Excel, Powerpoint and PDF...etc); Failure to do this may result in the loss of unsaved data.", _
    10, "IMPORTANT: Please Read Carefully!", wshYesDialog + wshQuestionMark)

    If intReturn = wshYes Then
    Wscript.Quit
    Else
    Wscript.Quit
    End If

    Just curious How do you do in your Orgn to execute this type of situation??
  • We try to push the apps like this when the machine checks into Kace or when the user logs in. Could you mark this as answered and post the solution you used and this will give you some extra ninja points
Please log in to comment
1

yes I checked during the silent Installation without closing them, I am getting a message saying like this so  am trying to kill the processes

Answered 08/13/2012 by: srikanth.deep
Purple Belt

  • Are you applying PATCH?
  • yes I am applying patch...
  • I mean I am installing the fresh app with patch included in it...
  • How are you installing patch? Have you created Admin Image for the base msi and then Patched admin image?
  • yes using this command to do that
    msiexec.exe /i "%~dp0AcroStan.msi" PATCH="%~dp0AcrobatUpd1013.msp" TRANSFORMS="%~dp0Acrobat_STD_10.mst" /qb /L*v "%SystemDrive%\install\logs\Acrobat_STD_10.log"
  • Instead, you can do like this..

    Create Admin Image for the base msi
    msiexec /a <PathToMSI>\AcroStan.msi SHORTFILENAMES=TRUE TARGETDIR=C:\AcroStan /qb


    Patch the Admin Image

    msiexec /p <PathToMSP>\AcrobatUpd1013.msp /a C:\AcroStan\AcroStan.msi SHORTFILENAMES=TRUE /qb


    Then Create Transform for the msi which is present in the C:\AcroStan\ folder..

    Then install the package like this

    msiexec /i "C:\AcroStan\AcroStan.msi" TRANSFORMS="C:\AcroStan\CreatedMST.mst" /qb
  • Instead, you can do like this..

    Create Admin Image for the base msi
    msiexec /a "<PathToMSI>\AcroStan.msi" SHORTFILENAMES=TRUE TARGETDIR="C:\AcroStan" /qb


    Patch the Admin Image

    msiexec /p "<PathToMSP>\AcrobatUpd1013.msp" /a "C:\AcroStan\AcroStan.msi" SHORTFILENAMES=TRUE /qb


    Then Create Transform for the msi which is present in the C:\AcroStan\ folder..

    Then install the package like this


    msiexec /i "C:\AcroStan\AcroStan.msi" TRANSFORMS="C:\AcroStan\CreatedMST.mst" /qb

    The above path is just an example.. you can keep them in your own folder and call it with %~dp0
  • okay, used the method as mentioned above, unfortunately this time during the main installation (msi mst) I am popping up with the same message if applications like Outlook, IE, office applications running :( I guess no luck for me...
  • Why are you installing the main msi and mst first...
    Please take a look at above post carefully... I'm not asking you to install the main msi without patching and creating mst...
    • Oops!!! Its my bad, wrong understanding of the post, My Apologies for that. Any ways Thanks a lot
  • When you create mst, check is there any custom action with the following names in ExecuteImmediate sequence

    CheckFileInUse"
    FileInUse
    something like this

    If you see any custom actions like this then comment that custom action in mst..
    Note: You have to create mst after patching the admin image
Please log in to comment
1

Hi Sri,

We handle this scanerio by giving the option to user to select Yes/No.Only if user selects yes we go ahead with the installation of the same and before that if the process is still running we would be keeping on displaying the promprt to user.

The idea behind it it ,it a human behaviour all users won't read prompt which is getting displayed first time but if it comes second time/3rd time they would definetly read the same.

 

Below is the sample script which we use

'# Check for Office exes and prompt user again if necessary
Do while ProcessIsRunning("winword.exe") or ProcessIsRunning("excel.exe") or ProcessIsRunning("powerpnt.exe")
  
    Msgbox "Word, Excel or Powerpoint is detected as running." & vbCrLf & vbCrLf & _
           "If you have Excel, Word or Powerpoint open, please close these applications now," & vbCrLf &_
           "THEN click OK to proceed." & vbCrLf & vbCrLf & _
           "Please keep these applications closed until you are notfied this process is complete.   ",vbInformation + vbSystemModal, strDialogTitle
    Wscript.Sleep 3000
Loop

 

Function ProcessIsRunning(sProcessName)
    Dim objWMIService, objProcess, colProcess
    Dim sList
    On Error Resume Next
    Set objWMIService = GetObject("winmgmts:\root\cimv2")
    Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process")
    For Each objProcess in colProcess
        If LCase(objProcess.Name) = LCase(sProcessName) Then
            ProcessIsRunning = True
        End If
    Next
   
End Function

 

 

Answered 08/13/2012 by: sumitsingh1984
Second Degree Green Belt

  • kool, Its working like a charm. Perfect for my scenario. Thank you so much
Please log in to comment
0

How about using MSIRESTARTMANAGERCONTROL=Disable ? I believe it is used for those kind of scenarios

Answered 01/07/2013 by: frack
White Belt

Please log in to comment
0

I don't think so you have to close all other applications before deploying Adobe Std/Pro.. Why do you want to close other application? Is there any specific reason behind that?

Answered 08/13/2012 by: jagadeish
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Share