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

Updating can fail due to lack of permission #1356

Open
mozilla2012 opened this issue Dec 9, 2022 · 3 comments
Open

Updating can fail due to lack of permission #1356

mozilla2012 opened this issue Dec 9, 2022 · 3 comments

Comments

@mozilla2012
Copy link

Describe the bug
I put the FanControl files in my C:\Program Files directory.

PS C:\Program Files\FanControl> .\Updater.exe
Downloading Fan Control v139...
Extracting archive...
Extract failed: System.UnauthorizedAccessException: Access to the path 'C:\Program Files\FanControl\Emoji.Wpf.dll' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at Updater.Program.Extract(Stream zipStream, String extractDirectoryPath)

Mitigation:

Right click the affected file (Emoji.Wpf.dll) --> Properties --> Security tab --> Edit... -->
Allow "Full control" for ALL APPLICATION PACKAGES.

Then repeat with all files until the update succeeds. This was 5 files for me:

  • C:\Program Files\FanControl\Emoji.Wpf.dll
  • C:\Program Files\FanControl\FanControl.Plugins.dll
  • C:\Program Files\FanControl\FanControl.Plugins.dll
  • C:\Program Files\FanControl\Typography.GlyphLayout.dll
  • C:\Program Files\FanControl\Typography.OpenFont.dll

Is this a security/premssions faux pax? Probably. But it worked.

@mozilla2012 mozilla2012 changed the title Updating fails due to lack of permission Updating can fail due to lack of permission Dec 9, 2022
@giulianob
Copy link

I have this issue on every update but it's because the app doesnt close fast enough so the file is still in use when the updater runs. What I do is click into the terminal window of the update to pause it (b/c windows console pauses the script when you focus into the console) then wait a few seconds. Works every time but seems like the updater script should make sure the app closes before continuing.

@Rem0o
Copy link
Owner

Rem0o commented May 10, 2024

@giulianob just realized there wasn't a proper waiting mechanism in place. I will add that to the updater.

@Rem0o
Copy link
Owner

Rem0o commented May 12, 2024

Pushed a new version of the updater.

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

3 participants