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

Deleting read-only files fails #338

Closed
qzo opened this issue Jun 20, 2015 · 0 comments
Closed

Deleting read-only files fails #338

qzo opened this issue Jun 20, 2015 · 0 comments

Comments

@qzo
Copy link

qzo commented Jun 20, 2015

There seems to be a problem removing files with read-only attribute during upgrade and uninstall. Warnings look like this (in this case, "Clock.ico" is the read-only file):
https://gist.github.com/qzo/e4965ecdbb6e8ca773a3
(upgrade log, the directory was not removed before due to unsuccessful uninstall, see below)
https://gist.github.com/qzo/5e77b1844f87b4bef915
(uninstall log)

How to reproduce:

  1. Create a simple package which downloads and extracts an archive containing a file with read-only attribute using Install-ChocolateyZipPackage - an example of such package is here:
    https://github.com/qzo/chocolatey-packages/tree/6b892168b853ce537cf9f1b25aa2009f5f266a5a/packages/manual/farr_m/find-and-run-robot.portable
    (instead of
    http://www.donationcoder.com/Software/Mouser/findrun/downloads/FindAndRunRobotPortable.zip
    which might point to a new version of the application you can use this link:
    https://drive.google.com/uc?export=download&id=0B87Bx4rkw5f6d0NSODBUeUMyOHc
    ).
  2. Install the package.
  3. Uninstall the package - You get the warnings and read-only files are not removed from either lib or lib-bkp. (And unless you remove them manually, subsequent installation / upgrade won't be able to remove the old files either, causing the same warnings.)
@ferventcoder ferventcoder added this to the 0.9.9.8 milestone Jun 21, 2015
@ferventcoder ferventcoder self-assigned this Jun 21, 2015
@ferventcoder ferventcoder modified the milestones: 0.9.9.8, 0.9.9.9 Jun 26, 2015
ferventcoder added a commit to ferventcoder/choco that referenced this issue Jul 30, 2015
ferventcoder added a commit to ferventcoder/choco that referenced this issue Sep 17, 2015
Ensure file attribute set is ignoring the attributes passed in and only
looking at Hidden. Fix that to use the attributes passed in.
ferventcoder added a commit to ferventcoder/choco that referenced this issue Sep 17, 2015
Add the following methods to IFileSystem

- ensure_file_attribute_removed
- is_readonly_file
- is_hidden_file
- delete_directory overriding attributes
- delete_directory_if_exists overriding attributes
ferventcoder added a commit to ferventcoder/choco that referenced this issue Sep 17, 2015
Enhance IFilesService to look at a package and clean up the attributes
of all files in the package. Also refactor some of the methods to use
the same install location verification.
ferventcoder added a commit to ferventcoder/choco that referenced this issue Sep 17, 2015
When performing install/upgrade/uninstall, ensure that the attributes
in the package files do not cause the action to fail. Remove ReadOnly,
Hidden, and System attributes if found from any files in the package.
ferventcoder added a commit to ferventcoder/choco that referenced this issue Sep 17, 2015
- DotNetFileSystem.when_setting_file_attributes_with_dotNetFileSystem
-
DotNetFileSystem.when_removing_readonly_attributes_with_dotNetFileSystem
- UpgradeScenarios.when_upgrading_a_package_with_readonly_files
- UninstallScenarios.when_uninstalling_a_package_with_readonly_files
ferventcoder added a commit that referenced this issue Sep 17, 2015
ferventcoder added a commit that referenced this issue Sep 17, 2015
* stable:
  (GH-338) Specs
  (GH-338) Remove incompatible attributes in files
  (GH-338) IFilesService.ensure_compatible_file_attributes
  (GH-338) IFileSystem enhancements
  (GH-338) Fix ensure_file_attribute_set
  (maint) remove debug message
  (GH-406) rename function
  (GH-406) Passed powershell args retain quotes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants