BlockExecution not unblocking the execution of applications in version 3.5

Topics: Archive - General
Nov 25, 2014 at 9:46 PM
Edited Nov 25, 2014 at 10:02 PM
Hi,

I just created a script with version 3.5 and it is not removing the block to execute applications after the installation.

Here is the part of the log that mentions it:
[Pre-Installation] :: [-BlockExecution] parameter specified.    Show-InstallationWelcome    11/25/2014 3:25:37 PM   1 (0x0001)
[Pre-Installation] :: Create scheduled task to cleanup blocked applications in case installation is interrupted.    Block-AppExecution  11/25/2014 3:25:38 PM   1 (0x0001)
[Pre-Installation] :: Retrieve Scheduled Tasks  Get-ScheduledTask   11/25/2014 3:25:38 PM   1 (0x0001)
[Pre-Installation] :: [C:\Windows\System32\schtasks.exe] is a valid path, continue  Execute-Process 11/25/2014 3:25:43 PM   1 (0x0001)
[Pre-Installation] :: Working Directory is [C:\Windows\System32]    Execute-Process 11/25/2014 3:25:43 PM   1 (0x0001)
[Pre-Installation] :: Executing [C:\Windows\System32\schtasks.exe /Create /TN .NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001_BlockedApps /RU "NT AUTHORITY\SYSTEM" /SC ONSTART /TR "C:\Program Files\XX\PSAppDeployToolkit\AppDeployToolkit_UnBlockApps.bat"]...   Execute-Process 11/25/2014 3:25:43 PM   1 (0x0001)
[Pre-Installation] :: Execution completed with exit code [0]    Execute-Process 11/25/2014 3:25:44 PM   1 (0x0001)
[Pre-Installation] :: Set the Image File Execution Option registry key to block execution of [iexplore.exe].    Block-AppExecution  11/25/2014 3:25:44 PM   1 (0x0001)
[Pre-Installation] :: Return fully qualified registry key path [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\iexplore.exe]    Convert-RegistryPath    11/25/2014 3:25:44 PM   1 (0x0001)
[Pre-Installation] :: Set registry key value: [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\iexplore.exe] [Debugger = wscript.exe "C:\Program Files\XX\PSAppDeployToolkit\AppDeployToolkit_BlockAppExecutionMessage.vbs"] Set-RegistryKey 11/25/2014 3:25:44 PM   1 (0x0001)
[Post-Installation] :: Remove the Image File Execution Options registry key to unblock execution of []. Unblock-AppExecution    11/25/2014 3:26:24 PM   1 (0x0001)
[Post-Installation] :: Retrieve Scheduled Tasks Get-ScheduledTask   11/25/2014 3:26:24 PM   1 (0x0001)
[Post-Installation] :: Delete Scheduled Task [.NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001_BlockedApps]. Unblock-AppExecution    11/25/2014 3:26:26 PM   1 (0x0001)
[Post-Installation] :: [C:\Windows\System32\schtasks.exe] is a valid path, continue Execute-Process 11/25/2014 3:26:26 PM   1 (0x0001)
[Post-Installation] :: Working Directory is [C:\Windows\System32]   Execute-Process 11/25/2014 3:26:26 PM   1 (0x0001)
[Post-Installation] :: Executing [C:\Windows\System32\schtasks.exe /Delete /TN .NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001_BlockedApps /F]...   Execute-Process 11/25/2014 3:26:26 PM   1 (0x0001)
[Post-Installation] :: Execution completed successfully with exit code [0]  Execute-Process 11/25/2014 3:26:26 PM   1 (0x0001)
When blocking it correctly identifies the process to block (Set the Image File Execution Option registry key to block execution of [iexplore.exe].). But that is not happening while unblocking (Remove the Image File Execution Options registry key to unblock execution of [].).
Developer
Nov 25, 2014 at 10:31 PM
Is this using the 3.5 final release from yesterday or with a beta release you may have downloaded prior to yesterday evening?
Nov 25, 2014 at 10:51 PM
The 3.5 final release. I downloaded it today.
Developer
Nov 25, 2014 at 11:09 PM
I'm testing with blocking "iexplore" right now on a Windows 8 x64 system and it is blocking and unblocking properly for me each time. I am running the deploy script directly from an elevated command prompt. Can you share some more details about your system and how you are executing the script?
Developer
Nov 25, 2014 at 11:10 PM
Actually, if you want to test with the same script I am running, it is the Testing script under the "Testing" folder of the toolkit download.
Nov 26, 2014 at 3:38 PM
I'm testing it using SCCM with ServiceUI.exe to run the installation.

This is the command line I'm using for the Welcome Screen:
Show-InstallationWelcome -CloseApps 'iexplore' -AllowDeferCloseApps -ForceCloseAppsCountdown 3600 -BlockExecution -DeferTimes 3 -PersistPrompt
Developer
Nov 26, 2014 at 7:15 PM
Does it work if you don't use ServiceUI.exe? Can you please test that?
Nov 26, 2014 at 9:33 PM
It also failed when running the script directly. I'm using a Windows 7 x64 system to test it.
Nov 26, 2014 at 9:51 PM
I am able to reproduce it in the Testing script if I only leave one process in the list:

Works:
Show-InstallationWelcome -CloseApps 'iexplore,winword,excel,powerpnt' -CloseAppsCountdown 60 -CheckDiskSpace -PersistPrompt -BlockExecution
Doesn't work:
Show-InstallationWelcome -CloseApps 'iexplore' -CloseAppsCountdown 60 -CheckDiskSpace -PersistPrompt -BlockExecution
Developer
Nov 26, 2014 at 10:48 PM
It works for me when I only specify 'iexplore' but good to know it doesn't work for you. We're getting somewhere. I'll test on Windows 7 and see if I can replicate your result as I'm currently on Windows 8.
Developer
Nov 26, 2014 at 10:51 PM
Edited Nov 26, 2014 at 10:51 PM
Can you check this registry key on your system and tell me what is listed for the "Debugger" value when the cleanup doesn't work?: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\iexplore.exe
Nov 26, 2014 at 10:56 PM
wscript.exe "C:\Program Files\XX\PSAppDeployToolkit\AppDeployToolkit_BlockAppExecutionMessage.vbs"
Nov 28, 2014 at 4:13 PM
I'm running Win7x64 and can confirm the same behavior as @dersonc only we're blocking winword.
Developer
Dec 2, 2014 at 2:15 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Developer
Dec 5, 2014 at 2:13 PM
The latest beta found under the "Source Code" tab of this site should have it fixed now. Please test and let me know if working OK.
Dec 8, 2014 at 4:36 PM
I just tested the last version and it worked.

Thanks for fixing it!