canton7 / SyncTrayzor

Windows tray utility / filesystem watcher / launcher for Syncthing
MIT License
5.83k stars 400 forks source link

System.UnauthorizedAccessException: Attempted to perform an unauthorized operation. #336

Closed xenamorph closed 7 years ago

xenamorph commented 7 years ago
Version: 1.1.13.0; Variant: Installed; Arch: Amd64
Path: d:\Program Files\SyncTrayzor\SyncTrayzor.exe
System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
   at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
   at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
   at SyncTrayzor.Services.AutostartProvider.SetAutoStart(AutostartConfiguration config) in C:\projects\synctrayzor\src\SyncTrayzor\Services\AutostartProvider.cs:line 182
   at SyncTrayzor.Bootstrapper.Configure() in C:\projects\synctrayzor\src\SyncTrayzor\Bootstrapper.cs:line 138
   at Stylet.BootstrapperBase.Start(String[] args) in c:\projects\stylet\Stylet\BootstrapperBase.cs:line 81
   at System.Windows.Application.OnStartup(StartupEventArgs e)
   at System.Windows.Application.<.ctor>b__1_0(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
xenamorph commented 7 years ago

Run as administrator

canton7 commented 7 years ago

No, that shouldn't have caused a crash: it should grey out those options in the settings if your user doesn't have access to write to that registry key.