Hi all
For better user experience, I display the popup "Show-InstallationWelcome" only if there is a process launched.....
If the process not launch, toolkit blocks the process until the install be finished....
I known it's not recommended but this is the only way I found to reduce popup to users !
Here is the code :
[Pre-Installation] Executing [C:\WINDOWS\System32\schtasks.exe /Create /TN Manufacturer001_Application01_10.0_EN__BlockedApps /RU System /SC ONSTART /TR "powershell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -File 'C:\Users\Public\PSAppDeployToolkit\AppDeployToolkitMain.ps1' -CleanupBlockedApps -InstallTitle 'Manufacturer001 Application01 10.0' -InstallName 'Manufacturer001_Application01_10.0_EN_'"]
[Pre-Installation] Standard error output from the process []: Error: The value for the option '/ TR' can not contain more than 261 characters.
Do you think it's possible :
Thanks a lot
For better user experience, I display the popup "Show-InstallationWelcome" only if there is a process launched.....
If the process not launch, toolkit blocks the process until the install be finished....
I known it's not recommended but this is the only way I found to reduce popup to users !
Here is the code :
#*===============================================
#* PRE-INSTALLATION
If ($deploymentType -ne "uninstall") { $installPhase = "Pre-Installation"
#*===============================================
# =========================================================
# If proccess open = Show-InstallationWelcome
# If proccess NOT open = Block-AppExecution
# =========================================================
if (Get-Process -Name ProcessName1,ProcessName2,ProcessName3 -ErrorAction SilentlyContinue)
{
Show-InstallationWelcome -CloseApps "ProcessName1,ProcessName2,ProcessName3" -BlockExecution -AllowDefer -DeferTimes "20" -CheckDiskSpace -PersistPrompt
}
Block-AppExecution -ProcessName ProcessName1,ProcessName2,ProcessName3
# =========================================================
# Install
# =========================================================
Whatever
# =========================================================
# Unblock
# =========================================================
UnBlock-AppExecution
#*===============================================
#* POST-INSTALLATION
$installPhase = "Post-Installation"
#*===============================================
it works great only if the command line that blocks applications does not exceed 261 characters :[Pre-Installation] Executing [C:\WINDOWS\System32\schtasks.exe /Create /TN Manufacturer001_Application01_10.0_EN__BlockedApps /RU System /SC ONSTART /TR "powershell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -File 'C:\Users\Public\PSAppDeployToolkit\AppDeployToolkitMain.ps1' -CleanupBlockedApps -InstallTitle 'Manufacturer001 Application01 10.0' -InstallName 'Manufacturer001_Application01_10.0_EN_'"]
[Pre-Installation] Standard error output from the process []: Error: The value for the option '/ TR' can not contain more than 261 characters.
Do you think it's possible :
-
Block applications if the proccess are not launched ?
Thanks a lot