Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to the path 'IntunePackage.intunewin' is denied #67

Open
josephgibbs opened this issue Feb 14, 2022 · 5 comments
Open

Access to the path 'IntunePackage.intunewin' is denied #67

josephgibbs opened this issue Feb 14, 2022 · 5 comments
Labels
obsolete Old or outdated issue. If this is still occurring, please reopen or re-file.

Comments

@josephgibbs
Copy link

I receive the following error when attempting to create a driver installation package. This seems to happen when there are zip files included in the source folder.

ERROR System.UnauthorizedAccessException: Access to the path 'IntunePackage.intunewin' is denied. at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data) at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost) at Microsoft.Management.Service.IntuneWinAppUtil.PackageUtil.CreatePackage(String folder, String setupFile, String outputFolder, String catalogFolder) at Microsoft.Management.Service.IntuneWinAppUtil.Program.Main(String[] args)

@ameltzer-MSFT ameltzer-MSFT added the obsolete Old or outdated issue. If this is still occurring, please reopen or re-file. label Jun 10, 2024
@ameltzer-MSFT
Copy link
Collaborator

If this is still occurring, please reopen and provide a repro package if possible.

@dkneisz
Copy link

dkneisz commented Oct 17, 2024

I still have this issue e.g. when trying this with Notepad++ (v8.7 in my case). The output is:

INFO   Computed SHA256 hash for 'C:\Users\<user>\AppData\Local\Temp\6ffb452b-4e08-4528-b6d4-38b4936b18ae\IntuneWinPackage\Contents\cef925a8-ce7a-4d97-ad72-d5825090ef0e' within 61 milliseconds
INFO   Computing SHA256 hash for C:\Users\<user>\AppData\Local\Temp\6ffb452b-4e08-4528-b6d4-38b4936b18ae\IntuneWinPackage\Contents\IntunePackage.intunewin
INFO   Computed SHA256 hash for C:\Users\<user>\AppData\Local\Temp\6ffb452b-4e08-4528-b6d4-38b4936b18ae\IntuneWinPackage\Contents\IntunePackage.intunewin within 63 milliseconds
INFO   Copying encrypted file from 'C:\Users\<user>\AppData\Local\Temp\6ffb452b-4e08-4528-b6d4-38b4936b18ae\IntuneWinPackage\Contents\cef925a8-ce7a-4d97-ad72-d5825090ef0e' to 'C:\Users\<user>\AppData\Local\Temp\6ffb452b-4e08-4528-b6d4-38b4936b18ae\IntuneWinPackage\Contents\IntunePackage.intunewin'
INFO   Removing temporary files
ERROR  System.UnauthorizedAccessException: Access to the path 'IntunePackage.intunewin' is denied.
   at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
   at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
   at Microsoft.Management.Service.IntuneWinAppUtil.PackageUtil.CreatePackage(String folder, String setupFile, String outputFolder, String catalogFolder)
   at Microsoft.Management.Service.IntuneWinAppUtil.Program.Main(String[] args)

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.

@ameltzer-MSFT
Copy link
Collaborator

ameltzer-MSFT commented Oct 17, 2024

Thanks for the additional information! We can look into improving the error handling here. In this case, is it just cleanup that's failing and the intunewin is otherwise usable? Or, is this actually preventing the intunewin from being created?

@dkneisz
Copy link

dkneisz commented Oct 18, 2024

It is not just the cleanup that is failing. There is nothing created in the output folder. The mentioned IntunePackage.intunewin file in the temp folder does exist, but seems to be unusable. It does only contain the installer, but not the folder structure and other files the successful intunewin file has.

@ameltzer-MSFT
Copy link
Collaborator

ameltzer-MSFT commented Oct 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
obsolete Old or outdated issue. If this is still occurring, please reopen or re-file.
Projects
None yet
Development

No branches or pull requests

3 participants