FanControl.Releases icon indicating copy to clipboard operation
FanControl.Releases copied to clipboard

Updating can fail due to lack of permission

Open ad08fee3 opened this issue 3 years ago • 3 comments

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.

ad08fee3 avatar Dec 09 '22 20:12 ad08fee3

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.

giulianob avatar May 10 '24 03:05 giulianob

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

Rem0o avatar May 10 '24 17:05 Rem0o

Pushed a new version of the updater.

Rem0o avatar May 12 '24 15:05 Rem0o