Seems that if one of the apps are still open when the script is running, it closes right away as he spose to. , but if I try to open one of the apps during installation, the script does not block it.
is this parameter -BlockExecution should not block the execution of these apps?
Hmmm?
I wonder if this is due to the behaviour of the -silent switch.
Personally I’d rather prompt the user that they need to close the apps so the install can run (or upgrade) rather than just silently close any open apps.
Reading your comment:
“…if I try to open one of the apps during installation, the script does not block it.”
Does this happen when you open every one of the apps listed in the -CloseApps list or just a specific one (or two)? - I’m just thinking that maybe the application process that is being blocked does not match the name of the executable?
Wonder if you could try the syntax slightly differently?
Maybe without the -Silent switch and maybe (optionally) add the -AllowDeferCloseApps switch
I believe you should also include a -CheckDiskSpace switch as the PSADT documentation (Show-InstallationWelcome · PSAppDeployToolkit) states -RequiredDiskSpace used in combination with CheckDiskSpace:
FYI: The -AllowDeferCloseApps switch will only prompt the user to defer the install if any of the apps listed in your -CloseApps list are open / running, or else the install should continue silently.
P.S. I’m not certain, but I think the Microsoft Office install may install OneDrive?
I wonder if you should add OneDrive to the -CloseApps list, so OneDrive is closed before the upgrade runs?
Sorry I’m not sure if the above is useful, give it a try and let us know