Open dkneisz opened 1 month ago
Good catch! I've also had this issue when trying to package Notepad++ using Microsoft's Intune packaging utility. This may indeed have been due to my company's endpoint protection agent. I agree that doing a try and catch on the System.UnauthorizedAccessException exception, and waiting for some period of time could be a solution in this case. Ideally we would not be building Intune packages on machines without endpoint protection, so this is a necessary patch.
Since I can't ropen issue #67, I created a new one:
I still have this issue e.g. when trying this with Notepad++ (v8.7 in my case).
The output is:
My guess is, that this is caused by the virus scanner / endpoint protection. When I do the same on a device without virus scanner / endpoint protection it works. It looks like the IntuneWinAppUtil is trying to (re)move the file while the virus scanner / endpoint protection is still scanning the file. Maybe a solution could be to retry this operation a few times before throwing an error. In most cases people will not be able to deacitvate the virus scanner / endpoint protection to get around this.