This project is read-only.

BlockExecution causing blocked window spam at end of installation.

Topics: Archive - Deployment Scripts
Apr 1, 2015 at 11:06 PM
I just started using the toolkit yesterday. I have read through the documentation and have been testing some installers. I am having an issue I am trying to get to the bottom of when using -BlockExecution

When the installer is almost finished, the user gets spammed with anywhere from 2-10 blocked execution windows. I am currently removing different blocked exes to see if I can narrow down which one is causing it. I am wondering if it might be Internet Explorer being triggered via Java Web extension being added via WEB_JAVA=1. I have not tried removing that one yet.

Here is the current script I am executing.
    If ($deploymentType -ine 'Uninstall') {
        ##*===============================================
        ##* PRE-INSTALLATION
        ##*===============================================
        [string]$installPhase = 'Pre-Installation'
        
        ## Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt
        Show-InstallationWelcome -CloseApps 'iexplore,javaw,chrome,firefox' -ForceCloseAppsCountdown 300 -AllowDefer -AllowDeferCloseApps -DeferTimes 3 -CheckDiskSpace -PersistPrompt -BlockExecution
        #,jusched,jp2launcher,java,jqs
        
        ## Show Progress Message (with the default message)
        Show-InstallationProgress "Installing Java 8 Update 40. Please wait..."
        
        ## <Perform Pre-Installation tasks here>
        New-Folder -Path "$envProgramData\Oracle\Java" -ContinueOnError $true
        Copy-File -Path "$dirSupportFiles\java.settings.cfg" -Destination "$envProgramData\Oracle\Java\java.settings.cfg" -ContinueOnError $true

        
        ##*===============================================
        ##* INSTALLATION 
        ##*===============================================
        [string]$installPhase = 'Installation'
        
        ## <Perform Installation tasks here>

        Execute-MSI -Action Install -Path "jre1.8.0_40.msi" -Parameters "STATIC=1 AUTOUPDATECHECK=0 DWUSINTERVAL=120 JAVAUPDATE=0 AUTO_UPDATE=0 WEB_JAVA=1 WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 REBOOT=0 /qn"


        ##*===============================================
        ##* POST-INSTALLATION
        ##*===============================================
        [string]$installPhase = 'Post-Installation'
        
        ## <Perform Post-Installation tasks here>
        
        # Unblock AppExecution
        Unblock-AppExecution
        
        # Copy Java config files
        New-Folder -Path "$envWindir\Sun\Java\Deployment" -ContinueOnError $true
        Copy-File -Path "$dirSupportFiles\deployment.config" -Destination "$envWindir\Sun\Java\Deployment\deployment.config" -ContinueOnError $true
        Copy-File -Path "$dirSupportFiles\deployment.properties" -Destination "$envWindir\Sun\Java\Deployment\deployment.properties" -ContinueOnError $true

        
        ## Remove Java Auto Updater
        Execute-MSI -Action Uninstall -Path "{4a03706f-666a-4037-7777-5f2748764d10}" -ContinueOnError $true
        ## Remove Java 8
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F83218000FF}" -ContinueOnError $true
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F86418000FF}" -ContinueOnError $true
        ## Remove Java 8u5
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F83218005FF}" -ContinueOnError $true
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F86418005FF}" -ContinueOnError $true
        ## Remove Java 8u11
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F83218011F0}" -ContinueOnError $true
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F86418011F0}" -ContinueOnError $true
        ## Remove Java 8u20
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F83218020F0}" -ContinueOnError $true
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F86418020F0}" -ContinueOnError $true
        ## Remove Java 8u25
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F83218025F0}" -ContinueOnError $true
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F86418025F0}" -ContinueOnError $true
        ## Remove Java 8u31
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F83218031F0}" -ContinueOnError $true
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F86418031F0}" -ContinueOnError $true
        ## Remove Java 8u40 x64
        Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F86418040F0}" -ContinueOnError $true
        
        Remove-MSIApplications "Java(TM)"
        Remove-MSIApplications "Java 7 Update"
        Remove-MSIApplications "Java Auto Updater"
I thought it might have been caused by my uninstall strings, but I added Unblock-AppExecution to the Post-Install portion and it did not change anything.

Anyone encountered this and know what might be going on? I will continue to try to figure out which one is causing the windows and post an update.

Currently I have not looked into all of the different methods you can deploy the toolkit. At the moment each revision takes a few minutes to get set up as I am zipping it all up and having a software distribution deploy it to a test device.
Apr 1, 2015 at 11:36 PM
It looks like it is being caused by javaw. Is there anyway to avoid this? I need to have the execution of it blocked, but also don't want the spam windows triggered at the end of the installation.
Apr 2, 2015 at 1:03 AM
You can find the path in the registry where the javaw app is blocked and get rid of the path to the script file that gets launched instead of the app. That will stop messages from appearing.

You can also do something with mutexes if you wanted but you'd have to figure that out:
http://learn-powershell.net/2014/09/30/using-mutexes-to-write-data-to-the-same-logfile-across-processes-with-powershell/
Apr 2, 2015 at 4:23 AM
Edited Apr 2, 2015 at 4:23 AM
I updated the latest 3.6.1 beta found under the "Source Code" section of the site to implement the mutex I mentioned above. The blocked app message dialog behavior has been improved so that only one message window can be shown at a time. This will prevent multiple message windows from showing up. However, if you don't want any message windows showing up, then you will have to modify that directly for the app by looking at the appropriate key under: HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options