The app doesn't start with the system while autostart is switch on.
Please check registry \HKCU\Software\Microsoft\Windows\CurrentVersion\Run,There is a Shadowsocks_xxxxxxxx entry?
Yes, there is such entry
I tested on my Windows 10 1909 (18363.720), But it can't be repeated. It can repeated.
It's your computer install some computer manager software, Like 360 Security Center or Tencent PC Manager?
Nothing installed and with ver. 4.1.9.2 all was fine.
Odd, Please quit Shadowsocks, Open registry and delete Shadowsocks_xxxxxx from \HKCU\Software\Microsoft\Windows\CurrentVersion\Run, And start Shadowsocks again to set auto-start ?
Still not starting, works only manual start
This should not happen.
If you manually create an entry name something else like test with your Shadowsocks path, It's can work?
example:

I think this is somehow refer with new localization
What is your operating system language or location settings?
Russian, is it possible to switch back to english?
Russian, is it possible to switch back to english?
Help-> Write translate template, then delete Russian column in generated file.
Is there anything in logfile?
Is there anything in logfile?
Nothing
tag as bug for tracking.
It is possible that this new binary release is not trusted by the anti-virus and does not allowed to be added in startup?
There is an error in system log:
Контейнер ошибки , тип 0
Имя события: CLR20r3
Отклик: Нет данных
Идентификатор CAB: 0
Сигнатура проблемы:
P1: Shadowsocks.exe
P2: 4.1.9.3
P3: 5e835a75
P4: mscorlib
P5: 4.8.4150.0
P6: 5e176d21
P7: 1693
P8: 12e
P9: System.UnauthorizedAccess
P10:
And another:
Приложение: Shadowsocks.exe
Версия платформы: v4.0.30319
Описание. Процесс был завершен из-за необработанного исключения. (The process was completed due to an unhandled exception.)
Сведения об исключении: System.UnauthorizedAccessException
в System.IO.__Error.WinIOError(Int32, System.String)
в System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean)
в System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions, System.String, Boolean, Boolean, Boolean)
в System.IO.StreamWriter.CreateFile(System.String, Boolean, Boolean)
в System.IO.StreamWriter..ctor(System.String, Boolean, System.Text.Encoding, Int32, Boolean)
в System.IO.File.InternalWriteAllText(System.String, System.String, System.Text.Encoding, Boolean)
в System.IO.File.WriteAllText(System.String, System.String)
в Shadowsocks.Model.NLogConfig.TouchAndApplyNLogConfig()
в Shadowsocks.Program.Main(System.String[])
Имя сбойного приложения: Shadowsocks.exe, версия: 4.1.9.3, метка времени: 0x5e835a75
Имя сбойного модуля: KERNELBASE.dll, версия: 10.0.18362.719, метка времени: 0x4061c730
Код исключения: 0xe0434352
Смещение ошибки: 0x00114192
Идентификатор сбойного процесса: 0x1280
Время запуска сбойного приложения: 0x01d608cae86c08b2
Путь сбойного приложения: E:\Downloads\Shadowsocks\Shadowsocks.exe
Путь сбойного модуля: C:\WINDOWS\System32\KERNELBASE.dll
Идентификатор отчета: 19675f09-69a5-4833-b542-d9cafa01c016
Полное имя сбойного пакета:
Код приложения, связанного со сбойным пакетом:
I think problem is in NLog
The exception comes from your own code:
Maybe add some exception handling like this:
```c#
public static void TouchAndApplyNLogConfig()
{
try
{
if (File.Exists(NLOG_CONFIG_FILE_NAME))
return; // NLog.config exists, and has already been loaded
File.WriteAllText(NLOG_CONFIG_FILE_NAME, Properties.Resources.NLog_config);
}
catch (Exception ex)
{
NLog.Common.InternalLogger.Error(ex, "[shadowsocks] Failed to setup default NLog.config: {0}", NLOG_CONFIG_FILE_NAME)
return;
}
LogManager.LoadConfiguration(NLOG_CONFIG_FILE_NAME); // Load the new config-file
}
```
我也有一样的问题,Windows 10 1809 x64
Hello,
OS 名称: Microsoft Windows 10 专业版 Insider Preview
OS 版本: 10.0.19592 暂缺 Build 19592
系统区域设置: zh-cn;中文(中国)
Have the same problem.
same problem on windows10x64 1903
Sorry for my fault, I'm using the wrong version.
The 4.1.9.3 have some issue, It's unable auto-start.
错误应用程序名称: Shadowsocks.exe,版本: 4.1.9.3,时间戳: 0x5e835a75
错误模块名称: KERNELBASE.dll,版本: 10.0.18362.719,时间戳: 0x4061c730
异常代码: 0xe0434352
错误偏移量: 0x00114192
错误进程 ID: 0x2a10
错误应用程序启动时间: 0x01d6097a24e57d83
错误应用程序路径: C:\Software\Shadowsocks\Shadowsocks.exe
错误模块路径: C:\Windows\System32\KERNELBASE.dll
报告 ID: b8fa373a-eca2-4f99-9bfc-fc6d25fc2ec2
错误程序包全名:
错误程序包相对应用程序 ID:
应用程序: Shadowsocks.exe
Framework 版本: v4.0.30319
说明: 由于未经处理的异常,进程终止。
异常信息: System.UnauthorizedAccessException
在 System.IO.__Error.WinIOError(Int32, System.String)
在 System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean)
在 System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions, System.String, Boolean, Boolean, Boolean)
在 System.IO.StreamWriter.CreateFile(System.String, Boolean, Boolean)
在 System.IO.StreamWriter..ctor(System.String, Boolean, System.Text.Encoding, Int32, Boolean)
在 System.IO.File.InternalWriteAllText(System.String, System.String, System.Text.Encoding, Boolean)
在 System.IO.File.WriteAllText(System.String, System.String)
在 Shadowsocks.Model.NLogConfig.TouchAndApplyNLogConfig()
在 Shadowsocks.Program.Main(System.String[])
故障存储段 1613589829736366270,类型 5
事件名称: CLR20r3
响应: 不可用
Cab ID: 0
问题签名:
P1: Shadowsocks.exe
P2: 4.1.9.3
P3: 5e835a75
P4: mscorlib
P5: 4.8.4150.0
P6: 5e176d21
P7: 1693
P8: 12e
P9: System.UnauthorizedAccess
P10:
the same problem
Hi All,
Just need to confirm, manual start still works when auto start has problem?
yes
https://www.codeproject.com/Questions/262575/Start-on-windows-logon-results-in-System-Unauthori
Does your app open or create a file using relative path?
If so, the cause of the problem is a difference of current directory.If you run the app yourself, the current directory is the directory where the app is located.
If you use either HKLM...\Run or HKCU...\Run the current directory is the root of your login account.
The solution: set a proper current directory before accessing any file or always use absolute path.
move this line to the top of Main() may solve our problem
既然修复了,可以发个版本吗
@ningsibuqu https://ci.appveyor.com/project/celeron533/shadowsocks-windows-3j4p4/builds/31946869/job/r9wyrr944ykga4el/artifacts try this
这个版本可以开机启动了,谢谢你
After all is done check also verbose logging, there may too be issues.
yes, verbose logging is too verbose in release config.
I'll adjust the "verbose" from Trace to Debug
config.nLogConfig.SetLogLevel(config.isVerboseLogging? NLogConfig.LogLevel.Trace: NLogConfig.LogLevel.Info);
Then prepare a new release with autostart code fix
I'll adjust the "verbose" from
TracetoDebugconfig.nLogConfig.SetLogLevel(config.isVerboseLogging? NLogConfig.LogLevel.Trace: NLogConfig.LogLevel.Info);Then prepare a new release with autostart code fix
Some log is at wrong level, like AEADEncryptor's internal state logging, they're at Debug level.
I suggest use this, in Debug config, log level is Trace, in Release it is Debug. Also adjusted some log's level.
0001-adjust-log-level.zip (My computer is broken, I'm working on public device, so I can't push at this moment...)
Hi @studentmain , your patch has been applied on 23ce58aa34103051e514b38834a9f3dc84331e88 .
LogForm.cs is not changed. I think it is useful for normal end-user
@celeron533 got it
All is working with 4.1.10.0. Many thanks!
Most helpful comment
All is working with 4.1.10.0. Many thanks!