Squirrel 未创建快捷方式将针对的 .exe
Squirrel not creating .exe that the shortcut would target
我正在尝试通过 Squirrel 分发我的 C# 应用程序。通过 Squirrel releasify,我创建了一个 Setup exe 来安装它。这大部分工作 - 安装程序提取我的应用程序的文件并启动应用程序(当前版本为 0.0.1)。
完成后,%localappdata%\MyApp 确实包含 "app-0.0.1" 子文件夹及其所有数据,并且还在其根文件夹中包含 Update.exe。
但是,主文件夹中没有 MyApp.exe,即:
- %localappdata%\MyApp\app-0.0.1\MyApp.exe 存在,但是
- %localappdata%\MyApp\MyApp.exe 不存在。
我在任何地方都没有看到任何错误消息 - 有人知道那里发生了什么吗?松鼠的日志说:
2018-03-14 13:47:56> Program: Starting Squirrel Updater: --install .
2018-03-14 13:47:56> Program: Starting install, writing to C:\Users\MyUsername\AppData\Local\SquirrelTemp
2018-03-14 13:47:56> Program: About to install to: C:\Users\MyUsername\AppData\Local\MyApp
2018-03-14 13:47:56> CheckForUpdateImpl: Couldn't write out staging user ID, this user probably shouldn't get beta anything: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\MyUsername\AppData\Local\MyApp\packages\.betaId'.
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, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
at System.IO.File.WriteAllText(String path, String contents, Encoding encoding)
at Squirrel.UpdateManager.CheckForUpdateImpl.getOrCreateStagedUserId()
2018-03-14 13:47:56> CheckForUpdateImpl: Failed to load local releases, starting from scratch: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\MyUsername\AppData\Local\MyApp\packages\RELEASES'.
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)
at Squirrel.Utility.LoadLocalReleases(String localReleaseFile)
at Squirrel.UpdateManager.CheckForUpdateImpl.<CheckForUpdate>d__2.MoveNext()
2018-03-14 13:47:56> CheckForUpdateImpl: Reading RELEASES file from C:\Users\MyUsername\AppData\Local\SquirrelTemp
2018-03-14 13:47:56> CheckForUpdateImpl: First run or local directory is corrupt, starting from scratch
2018-03-14 13:47:56> ApplyReleasesImpl: Writing files to app directory: C:\Users\MyUsername\AppData\Local\MyApp\app-0.0.1
2018-03-14 13:47:57> ApplyReleasesImpl: Squirrel Enabled Apps: [C:\Users\MyUsername\AppData\Local\MyApp\app-0.0.1\MyApp.exe]
2018-03-14 13:47:59> ApplyReleasesImpl: Starting fixPinnedExecutables
2018-03-14 13:47:59> ApplyReleasesImpl: Examining Pin: Internet Explorer.lnk
2018-03-14 13:47:59> ApplyReleasesImpl: Examining Pin: Outlook 2013.lnk
2018-03-14 13:47:59> ApplyReleasesImpl: Examining Pin: Windows Explorer.lnk
2018-03-14 13:47:59> ApplyReleasesImpl: Fixing up tray icons
2018-03-14 13:47:59> ApplyReleasesImpl: cleanDeadVersions: for version 0.0.1
2018-03-14 13:47:59> ApplyReleasesImpl: cleanDeadVersions: exclude folder app-0.0.1
找到原因;我的应用是控制台应用。
squirrel 并不真正支持它;它不会为控制台应用程序创建执行存根,因此快捷方式也被破坏了。似乎这是未记录的,您不会真正看到它出现在任何日志中,但在 Github 上有讨论,他们提到这是 "intentional" 目前。
杀毒软件删除软件也会出现类似问题
在我的情况下,我可以在桌面上看到快捷方式,但它不起作用,而且目标已经消失。 BitDefender 误报是原因。将 %LOCALAPPDATA%\MyApp 文件夹列入白名单,等待 BitDefender 客户端更新,然后重启,问题解决。
我正在尝试通过 Squirrel 分发我的 C# 应用程序。通过 Squirrel releasify,我创建了一个 Setup exe 来安装它。这大部分工作 - 安装程序提取我的应用程序的文件并启动应用程序(当前版本为 0.0.1)。
完成后,%localappdata%\MyApp 确实包含 "app-0.0.1" 子文件夹及其所有数据,并且还在其根文件夹中包含 Update.exe。 但是,主文件夹中没有 MyApp.exe,即:
- %localappdata%\MyApp\app-0.0.1\MyApp.exe 存在,但是
- %localappdata%\MyApp\MyApp.exe 不存在。
我在任何地方都没有看到任何错误消息 - 有人知道那里发生了什么吗?松鼠的日志说:
2018-03-14 13:47:56> Program: Starting Squirrel Updater: --install .
2018-03-14 13:47:56> Program: Starting install, writing to C:\Users\MyUsername\AppData\Local\SquirrelTemp
2018-03-14 13:47:56> Program: About to install to: C:\Users\MyUsername\AppData\Local\MyApp
2018-03-14 13:47:56> CheckForUpdateImpl: Couldn't write out staging user ID, this user probably shouldn't get beta anything: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\MyUsername\AppData\Local\MyApp\packages\.betaId'.
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, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
at System.IO.File.WriteAllText(String path, String contents, Encoding encoding)
at Squirrel.UpdateManager.CheckForUpdateImpl.getOrCreateStagedUserId()
2018-03-14 13:47:56> CheckForUpdateImpl: Failed to load local releases, starting from scratch: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\MyUsername\AppData\Local\MyApp\packages\RELEASES'.
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)
at Squirrel.Utility.LoadLocalReleases(String localReleaseFile)
at Squirrel.UpdateManager.CheckForUpdateImpl.<CheckForUpdate>d__2.MoveNext()
2018-03-14 13:47:56> CheckForUpdateImpl: Reading RELEASES file from C:\Users\MyUsername\AppData\Local\SquirrelTemp
2018-03-14 13:47:56> CheckForUpdateImpl: First run or local directory is corrupt, starting from scratch
2018-03-14 13:47:56> ApplyReleasesImpl: Writing files to app directory: C:\Users\MyUsername\AppData\Local\MyApp\app-0.0.1
2018-03-14 13:47:57> ApplyReleasesImpl: Squirrel Enabled Apps: [C:\Users\MyUsername\AppData\Local\MyApp\app-0.0.1\MyApp.exe]
2018-03-14 13:47:59> ApplyReleasesImpl: Starting fixPinnedExecutables
2018-03-14 13:47:59> ApplyReleasesImpl: Examining Pin: Internet Explorer.lnk
2018-03-14 13:47:59> ApplyReleasesImpl: Examining Pin: Outlook 2013.lnk
2018-03-14 13:47:59> ApplyReleasesImpl: Examining Pin: Windows Explorer.lnk
2018-03-14 13:47:59> ApplyReleasesImpl: Fixing up tray icons
2018-03-14 13:47:59> ApplyReleasesImpl: cleanDeadVersions: for version 0.0.1
2018-03-14 13:47:59> ApplyReleasesImpl: cleanDeadVersions: exclude folder app-0.0.1
找到原因;我的应用是控制台应用。
squirrel 并不真正支持它;它不会为控制台应用程序创建执行存根,因此快捷方式也被破坏了。似乎这是未记录的,您不会真正看到它出现在任何日志中,但在 Github 上有讨论,他们提到这是 "intentional" 目前。
杀毒软件删除软件也会出现类似问题
在我的情况下,我可以在桌面上看到快捷方式,但它不起作用,而且目标已经消失。 BitDefender 误报是原因。将 %LOCALAPPDATA%\MyApp 文件夹列入白名单,等待 BitDefender 客户端更新,然后重启,问题解决。