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

FEATURE REQUEST: Remove old extracted installation files #15

Closed
bcurran3 opened this issue Apr 25, 2018 · 4 comments
Closed

FEATURE REQUEST: Remove old extracted installation files #15

bcurran3 opened this issue Apr 25, 2018 · 4 comments

Comments

@bcurran3
Copy link

bcurran3 commented Apr 25, 2018

For a year plus now I've noticed that after the NVIDIA display drivers are installed I'm left with a C:\NVIDIA directory. Currently I have four old versions of the extracted installation files.

When I try to delete the folder to OCDly (I created a new word!) clean up my system volume, I get:

image

I can't delete it with my normal user/administrative account.

The fact it says SYSTEM is the owner might not be what everyone else gets. It might be due to the drivers being upgraded in the wee hours of the night by my https://chocolatey.org/packages/choco-upgrade-all-at package. I'm really not sure. (Someone please chime in and say if you have the same problem and if you installed manually or via Chocolatey under your normal admin account.)

It would be wonderful if you reset the permissions on the folder after install so that anyone can delete the files. It might be as is easy as changing the owner from SYSTEM to ADMINISTRATORS or USERS. (Needs some testing.)

After that a simple Remove-Item can clean up the files.

If you need help, here are some basic tutorials:
https://blogs.msdn.microsoft.com/johan/2008/10/01/powershell-editing-permissions-on-a-file-or-folder/
http://www.tomsitpro.com/articles/powershell-manage-file-system-acl,2-837.html
https://stackoverflow.com/questions/25779423/powershell-to-set-folder-permissions

Ironically I packaged this up a few months ago: https://chocolatey.org/packages/ntfssecurity-psmodule but haven't implemented it in any of my scripts yet. 😀

@bcurran3
Copy link
Author

CONFIRMED: Changing OWNER to local ADMINISTRATOR allows easy deletion of the files.

@AeliusSaionji
Copy link
Owner

hmm, my C:\NVIDIA is owned by the ADMINISTRATORS group already, not SYSTEM. I could just delete mine. I wonder: is your task running chocolatey as SYSTEM somehow?

@AeliusSaionji
Copy link
Owner

Seems like the drivers don't create a c:\NVIDIA folder anymore? You might be interested to know that NVIDIA does leave a significant chunk of files in C:\Program Files\NVIDIA Corporation\Installer2, and Windows itself holds on to previous versions of the driver (which can consume multiple GB) somewhere in the WINDOWS folder. You might want to keep those around since they are used in system restore, but you can use something like https://github.com/lostindark/DriverStoreExplorer to purge those.

Anyway, closing this.

@bcurran3
Copy link
Author

bcurran3 commented Apr 1, 2019

HEY! Thanks. It looks like you're right. The last set of drivers in my \NVIDIA directory are 397.41 whilst I've got 419.67 installed.

Now to go delete them... for good!

p.s.

hmm, my C:\NVIDIA is owned by the ADMINISTRATORS group already, not SYSTEM. I could just delete mine. I wonder: is your task running chocolatey as SYSTEM somehow?

Yes. my CUP ALL runs every morning at 2AM via SYSTEM account:
https://chocolatey.org/packages/choco-upgrade-all-at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants