Feature request (?) : Display Error popup if error encountered in script

//Feature request (?) : Display Error popup if error encountered in script
Feature request (?) : Display Error popup if error encountered in script 2015-10-07T08:37:56+00:00

The Toolkit Forums General Feature request (?) : Display Error popup if error encountered in script

  • Author
    Posts
  • jaegermaster
    Participant
    Post count: 29

    Hello,

    I am creating a script for an installation that has a very long run time.

    I would like to display a specific popup and not just the baloon when the script encounters an error.
    This is because many users leave their computer or do other stuff while installation is running, and miss the baloon sometimes.

    I had a look/search, instead of modifying the Main toolkit ps1 is there a way of doing it or is it not implemented ?

    Best regards

  • jaegermaster
    Participant
    Post count: 29

    can’t use the catch section of the deploy applciation PS1 i suppose ?

  • jaegermaster
    Participant
    Post count: 29

    bump ?

  • Michael
    Participant
    Post count: 12

    Does the code end up in the catch section of the Deploy-Applicaiton.ps1? You could call Show-Dialog in that section?

  • jaegermaster
    Participant
    Post count: 29

    hello

    No as its an Execute-Process error

    I might have forgotten to mention that I was to display a Show-Dialog if an action from the script fails

    (Execute-Msi , Remove-Folder, etc….)

  • Aman
    Keymaster
    Post count: 53

    I’m sorry, but could you elaborate a bit more, I’m not understanding your issue.

    In the Deploy-Application.ps1 script file, there’s a show dialog there by default. This will pop up if any function throws an error, unless you install in silent mode. You could modify the text there if you needed a custom message.

    Are you not seeing the dialog? If so, you may be encountering a bug, can you share a log file from one of your installations.

  • jaegermaster
    Participant
    Post count: 29

    [Installation] :: Update progress message: [Installing Office 2013 Professional Plus (Step 2/4).
    This might take some time. Please wait…] Show-InstallationProgress 12.10.2015 12:18:15 1 (0x0001)
    [Installation] :: [W:\2-Packaging\Microsoft-Office2013ProPlus_EN\Package\B\Files\Setup.exe] is a valid path, continue Execute-Process 12.10.2015 12:18:15 1 (0x0001)
    [Installation] :: Working Directory is [W:\2-Packaging\Microsoft-Office2013ProPlus_15.0.4569.1506_EN\Package\B\Files] Execute-Process 12.10.2015 12:18:15 1 (0x0001)
    [Installation] :: Executing [W:\2-Packaging\Microsoft-Office2013ProPlus_15.0.4569.1506_EN\Package\B\Files\Setup.exe /adminfile “W:\2-Packaging\Microsoft-Office2013ProPlus_15.0.4569.1506_EN\Package\B\Files\updates\Office2013ProPlus.MSP” /config “W:\2-Packaging\Microsoft-Office2013ProPlus_15.0.4569.1506_EN\Package\B\Files\ProPlus.WW\Config.xml”]… Execute-Process 12.10.2015 12:18:15 1 (0x0001)
    [Installation] :: Execution failed with exit code [-805306369] Execute-Process 12.10.2015 12:21:26 1 (0x0001)
    [Installation] :: Close the installation progress dialog. Close-InstallationProgress 12.10.2015 12:21:26 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [communicator.exe]. Unblock-AppExecution 12.10.2015 12:21:26 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [excel.exe]. Unblock-AppExecution 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [groove.exe]. Unblock-AppExecution 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [infopath.exe]. Unblock-AppExecution 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [lync.exe]. Unblock-AppExecution 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [mspub.exe]. Unblock-AppExecution 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [onenote.exe]. Unblock-AppExecution 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [outlook.exe]. Unblock-AppExecution 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [powerpnt.exe]. Unblock-AppExecution 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [visio.exe]. Unblock-AppExecution 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [winproj.exe]. Unblock-AppExecution 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Remove the Image File Execution Options registry key to unblock execution of [winword.exe]. Unblock-AppExecution 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Retrieve Scheduled Tasks Get-ScheduledTask 12.10.2015 12:21:27 1 (0x0001)
    [Installation] :: Delete Scheduled Task [Microsoft_Office2013ProPlus_15.0.4569.1506B_EN_B_BlockedApps]. Unblock-AppExecution 12.10.2015 12:21:28 1 (0x0001)
    [Installation] :: [C:\Windows\System32\schtasks.exe] is a valid path, continue Execute-Process 12.10.2015 12:21:28 1 (0x0001)
    [Installation] :: Working Directory is [C:\Windows\System32] Execute-Process 12.10.2015 12:21:28 1 (0x0001)
    [Installation] :: Executing [C:\Windows\System32\schtasks.exe /Delete /TN Microsoft_Office2013ProPlu_EN_B_BlockedApps /F]… Execute-Process 12.10.2015 12:21:28 1 (0x0001)
    [Installation] :: Execution completed successfully with exit code [0] Execute-Process 12.10.2015 12:21:28 1 (0x0001)
    [Installation] :: Microsoft_Office2013ProPlus_15.0.4569.1506B_EN_B Installation completed with exit code [-805306369]. Exit-Script 12.10.2015 12:21:28 1 (0x0001)
    [Installation] :: Display balloon tip notification asyhchronously with message [Installation failed.] Show-BalloonTip 12.10.2015 12:21:28 1 (0x0001)
    [Installation] :: [C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe] is a valid path, continue Execute-Process 12.10.2015 12:21:29 1 (0x0001)
    [Installation] :: Working Directory is [C:\Windows\System32\WindowsPowerShell\v1.0] Execute-Process 12.10.2015 12:21:29 1 (0x0001)
    [Installation] :: Executing [C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe [PowerShell ScriptBlock]]… Execute-Process 12.10.2015 12:21:29 1 (0x0001)
    [Installation] :: NoWait parameter specified. Continuing without waiting for exit code… Execute-Process 12.10.2015 12:21:29 1 (0x0001)
    [Installation] :: ——————————————————————————- Exit-Script 12.10.2015 12:21:29 1 (0x0001)

  • jaegermaster
    Participant
    Post count: 29

    I just got the baloon tip but I would like to give the user a big popup that the installation failed

  • Aman
    Keymaster
    Post count: 53

    Hi Jaegermaster,
    Can you please provide the text of your deploy-application.ps1 and also what command you’re using to launch the toolkit. I’m not seeing what I need in this log file.

  • jaegermaster
    Participant
    Post count: 29

    Hi thank you for your interest

    All you needed to know is :

    [Installation] :: Execution failed with exit code [-805306369] Execute-Process 12.10.2015 12:21:26 1 (0x0001)

    When this happens by builtin in PADT , we just get the little bubble in systray “installation failed”

    This happens with any action that fails in installation phase with execute-process or Execute-Msi , Copy-File , etc…

    I would like to create a dialog box to the user when one of these action fails “Installation failed, please try to relaunch Installation or call HelpDesk”

    I think the bubble is not “intrusive” enough 🙂

  • jaegermaster
    Participant
    Post count: 29

    If it is unclear don’t hesitate to ask me more 🙂

    I think this would be a nice addition to PADT , espacially if we could configure this in the xml

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    The way most people do deployments in an enterprise setting, I don’t think this feature would be desirable. If I deploy software to users, I don’t want users to see anything at all for the most part and certainly not any errors. They are not going to know what those errors mean and will probably call the help desk; something the business does not want as part of a large deployment. I think the feature you want will have to be something you implement in your own branch of the toolkit. All the pieces are already there for you to do so. In the Catch {} statements of a function, add a Show-Dialog function call that displays the error message that gets thrown.

  • jaegermaster
    Participant
    Post count: 29

    ok, will try thx

  • jaegermaster
    Participant
    Post count: 29

    Hello,

    Getting back , I try this and didn’t produce anything :

    ##*===============================================
    ##* END SCRIPT BODY
    ##*===============================================

    ## Call the Exit-Script function to perform final cleanup operations
    Exit-Script -ExitCode $mainExitCode
    }
    Catch {
    [int32]$mainExitCode = 60001
    [string]$mainErrorMessage = “$(Resolve-Error)”
    Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName
    Show-DialogBox -Text $mainErrorMessage -Icon ‘Stop’
    Show-InstallationPrompt -Message “Installation failed.nn Please relaunch installation or contact your LocalIT if needed.” -ButtonRightText ‘OK’ -Icon Information -NoWait
    Exit-Script -ExitCode $mainExitCode
    }

You must be logged in to reply to this topic.