gpt4 book ai didi

c# - Squirrel 没有创建快捷方式所针对的 .exe

转载 作者:行者123 更新时间:2023-12-02 20:29:06 25 4
gpt4 key购买 nike

我正在尝试通过 Squirrel 分发我的 C# 应用程序。通过 Squirrel releasify,我创建了一个安装程序 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

最佳答案

找到原因了;我的应用程序是一个控制台应用程序。

松鼠并不真正支持这一点;它不会为控制台应用程序创建执行 stub ,因此快捷方式也被破坏。似乎这没有记录在案,你不会真正看到它出现在任何日志中,但 Github 上有讨论,他们提到目前这是“故意的”。

关于c# - Squirrel 没有创建快捷方式所针对的 .exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49279627/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com