From 5475f65b28d25b7f97083309564ec5577c2fed90 Mon Sep 17 00:00:00 2001 From: Reyppp <1310590802zss@gmail.com> Date: Sun, 30 Aug 2026 03:29:03 +0800 Subject: [PATCH] Fix installer path and desktop shortcut handling --- PRODUCT.md | 2 +- README.md | 15 ++++----- RELEASE_NOTES.md | 12 ++++--- installer/LogAnalysis.iss | 66 ++++++++++++++++++++++++++++++++++++--- site/index.html | 22 ++++++------- test_analyzer.py | 12 +++++++ version.py | 2 +- 7 files changed, 103 insertions(+), 28 deletions(-) diff --git a/PRODUCT.md b/PRODUCT.md index 736e879..2740f90 100644 --- a/PRODUCT.md +++ b/PRODUCT.md @@ -34,7 +34,7 @@ Log Analysis 将连续工控log与逐层监控log只读汇总为可筛选、可 - 综合模式下 `Motor Speed` 以工控log为准,并保留监控log参考值用于审计。 - 中文界面为主,核心入口保持 `analyze_folder(path) -> AnalysisResult`。 - 第一版只支持 Windows x64,不提供在线分析、数据库、账号或自动更新。 -- 当前二进制版本是未签名测试版 `v0.1.0-beta.5`。 +- 当前二进制版本是未签名测试版 `v0.1.0-beta.6`。 ## Brand Commitments diff --git a/README.md b/README.md index 712dd7e..2a282f7 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,11 @@ ### 下载与校验 1. 升级前先关闭所有正在运行的 Log Analysis 窗口。 -2. 下载 [Log Analysis v0.1.0-beta.5 安装程序](https://github.com/Reyppp/log-analysis/releases/download/v0.1.0-beta.5/Log-Analysis-Setup-v0.1.0-beta.5-x64.exe) 和同一版本的 [SHA256SUMS.txt](https://github.com/Reyppp/log-analysis/releases/download/v0.1.0-beta.5/SHA256SUMS.txt)。也可以先查看[完整版本说明](https://github.com/Reyppp/log-analysis/releases/tag/v0.1.0-beta.5)。 +2. 下载 [Log Analysis v0.1.0-beta.6 安装程序](https://github.com/Reyppp/log-analysis/releases/download/v0.1.0-beta.6/Log-Analysis-Setup-v0.1.0-beta.6-x64.exe) 和同一版本的 [SHA256SUMS.txt](https://github.com/Reyppp/log-analysis/releases/download/v0.1.0-beta.6/SHA256SUMS.txt)。也可以先查看[完整版本说明](https://github.com/Reyppp/log-analysis/releases/tag/v0.1.0-beta.6)。 3. 在下载目录打开 PowerShell,运行: ```powershell -Get-FileHash -Algorithm SHA256 .\Log-Analysis-Setup-v0.1.0-beta.5-x64.exe +Get-FileHash -Algorithm SHA256 .\Log-Analysis-Setup-v0.1.0-beta.6-x64.exe Get-Content .\SHA256SUMS.txt ``` @@ -45,11 +45,12 @@ Get-Content .\SHA256SUMS.txt ### 安装与首次使用 -1. 双击 `Log-Analysis-Setup-v0.1.0-beta.5-x64.exe`。 -2. 按安装向导继续;程序默认安装到当前用户目录,不需要管理员权限,桌面快捷方式可选。 -3. 当前版本是未签名测试版。若 SmartScreen 显示“Windows 已保护你的电脑”,请先确认 SHA-256 已匹配,再选择“更多信息”,核对文件名后选择“仍要运行”。如果组织安全策略禁止运行,请联系管理员,不要关闭系统安全功能。 -4. 安装完成后,从开始菜单打开 **Log Analysis**。 -5. 点击“选择文件夹”,选择炉次日志目录,再点击“开始分析”。所有数据只在本机处理。 +1. 双击 `Log-Analysis-Setup-v0.1.0-beta.6-x64.exe`。 +2. 在安装向导中选择安装目录;程序默认安装到当前用户目录,不需要管理员权限,桌面快捷方式可选。 +3. 桌面位于其他磁盘或使用目录链接时,安装程序会使用 Windows 登记的真实桌面路径;快捷方式创建失败也不会中断应用安装,可改用开始菜单启动。 +4. 当前版本是未签名测试版。若 SmartScreen 显示“Windows 已保护你的电脑”,请先确认 SHA-256 已匹配,再选择“更多信息”,核对文件名后选择“仍要运行”。如果组织安全策略禁止运行,请联系管理员,不要关闭系统安全功能。 +5. 安装完成后,从开始菜单打开 **Log Analysis**。 +6. 点击“选择文件夹”,选择炉次日志目录,再点击“开始分析”。所有数据只在本机处理。 覆盖安装会保留上次选择的炉次路径。卸载默认保留设置,也可以在卸载时选择同时删除。 diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 950c52e..65b0841 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,9 +1,13 @@ -# Log Analysis v0.1.0-beta.5 +# Log Analysis v0.1.0-beta.6 -双日志分析与设备工作台更新。 +安装可靠性修复,保留 beta.5 的双日志分析与设备工作台功能。 ## 主要更新 +- 安装向导始终显示安装目录页面,可在安装前选择目标位置。 +- 桌面快捷方式使用 Windows 登记的真实桌面路径,兼容桌面移动到其他磁盘或使用目录链接的环境。 +- 桌面快捷方式创建失败时不再中断应用安装,可继续从开始菜单启动。 + - 自动识别日期命名的工控log和逐层监控log,并根据文件夹内容提供综合、监控log、工控log三种分析范围。 - 综合模式自动匹配镀膜层顺序并校正两类日志的时间偏移;关联失败时保留两类日志的独立分析,不强制合并。 - 综合设备支持层数和时间两种横坐标。时间图以监控log时间为基准,工控log与监控log共享每张图最多 8,000 个真实采样点。 @@ -26,7 +30,7 @@ - 工控log连续数据在服务端会话中缓存,指标与筛选切换不重复读取原始文件。 - 高密度采样保留真实边界点和桶内极值,不计算均值、不插值。 - 关联算法允许跳过夹在完整镀膜序列之间的非镀膜工作段,避免额外工控序列导致整炉关联失败。 -- 36 项自动测试覆盖单源、双源、时间对齐、8,000 点预算、筛选、桌面接口和公开网站。 +- 37 项自动测试覆盖单源、双源、时间对齐、8,000 点预算、筛选、桌面接口、安装器和公开网站。 ## 系统要求 @@ -35,7 +39,7 @@ ## 安装与校验 -同时下载 `Log-Analysis-Setup-v0.1.0-beta.5-x64.exe` 和 `SHA256SUMS.txt`。使用 PowerShell 的 `Get-FileHash` 核对 SHA-256 后运行安装程序。 +同时下载 `Log-Analysis-Setup-v0.1.0-beta.6-x64.exe` 和 `SHA256SUMS.txt`。使用 PowerShell 的 `Get-FileHash` 核对 SHA-256 后运行安装程序。 ## 已知限制 diff --git a/installer/LogAnalysis.iss b/installer/LogAnalysis.iss index 1f26a32..e668a80 100644 --- a/installer/LogAnalysis.iss +++ b/installer/LogAnalysis.iss @@ -1,6 +1,6 @@ #define MyAppName "Log Analysis" #ifndef MyAppVersion - #define MyAppVersion "0.1.0-beta.5" + #define MyAppVersion "0.1.0-beta.6" #endif #define MyNumericVersion "0.1.0.0" #define MyAppPublisher "Reyppp" @@ -17,6 +17,7 @@ AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL}/issues AppUpdatesURL={#MyAppURL}/releases DefaultDirName={localappdata}\Programs\{#MyAppName} +DisableDirPage=no DefaultGroupName={#MyAppName} DisableProgramGroupPage=yes PrivilegesRequired=lowest @@ -46,7 +47,6 @@ Source: "..\dist\Log Analysis\*"; DestDir: "{app}"; Flags: ignoreversion recurse [Icons] Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" -Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon [Run] Filename: "{app}\{#MyAppExeName}"; Description: "启动 {#MyAppName}"; Flags: nowait postinstall skipifsilent @@ -55,6 +55,23 @@ Filename: "{app}\{#MyAppExeName}"; Description: "启动 {#MyAppName}"; Flags: no var RemoveSettings: Boolean; +const + InstallerSettingsKey = 'Software\Log Analysis\Installer'; + +function GetDesktopDirectory(): String; +begin + Result := ''; + if not RegQueryStringValue(HKCU, + 'Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders', + 'Desktop', Result) or (Result = '') or (Pos('%', Result) > 0) then + Result := ExpandConstant('{userdesktop}'); +end; + +function GetDesktopShortcutPath(Param: String): String; +begin + Result := AddBackslash(GetDesktopDirectory()) + '{#MyAppName}.lnk'; +end; + function HasWebView2At(Base: String): Boolean; var Found: TFindRec; @@ -87,10 +104,51 @@ begin end; end; +procedure CurStepChanged(CurStep: TSetupStep); +var + ShortcutPath: String; +begin + if (CurStep = ssPostInstall) and WizardIsTaskSelected('desktopicon') then + begin + ShortcutPath := GetDesktopShortcutPath(''); + try + ForceDirectories(ExtractFileDir(ShortcutPath)); + CreateShellLink( + ShortcutPath, + '{#MyAppName}', + ExpandConstant('{app}\{#MyAppExeName}'), + '', + ExpandConstant('{app}'), + ExpandConstant('{app}\{#MyAppExeName}'), + 0, + SW_SHOWNORMAL); + RegWriteStringValue(HKCU, InstallerSettingsKey, + 'DesktopShortcut', ShortcutPath); + except + Log('Desktop shortcut creation failed: ' + GetExceptionMessage); + SuppressibleMsgBox( + 'Log Analysis 已完成安装,但桌面快捷方式创建失败。' + #13#10 + + '请从开始菜单启动应用。', + mbInformation, MB_OK, IDOK); + end; + end; +end; + procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); +var + ShortcutPath: String; begin if CurUninstallStep = usUninstall then RemoveSettings := SuppressibleMsgBox('是否同时删除 Log Analysis 保存的上次炉次路径?', mbConfirmation, MB_YESNO, IDNO) = IDYES; - if (CurUninstallStep = usPostUninstall) and RemoveSettings then - DelTree(ExpandConstant('{localappdata}\Log Analysis'), True, True, True); + if CurUninstallStep = usPostUninstall then + begin + if RegQueryStringValue(HKCU, InstallerSettingsKey, + 'DesktopShortcut', ShortcutPath) and FileExists(ShortcutPath) then + DeleteFile(ShortcutPath); + RegDeleteValue(HKCU, InstallerSettingsKey, 'DesktopShortcut'); + RegDeleteKeyIfEmpty(HKCU, InstallerSettingsKey); + RegDeleteKeyIfEmpty(HKCU, 'Software\Log Analysis'); + if RemoveSettings then + DelTree(ExpandConstant('{localappdata}\Log Analysis'), True, True, True); + end; end; diff --git a/site/index.html b/site/index.html index b90c973..a9dcc7c 100644 --- a/site/index.html +++ b/site/index.html @@ -38,14 +38,14 @@

单炉次镀膜日志分析

自动关联工控log与监控log,汇总逐层理论、光学与设备数据,定位需复核层。全程本地运行,原始日志只读。

- 下载 v0.1.0-beta.5 - SHA-256 校验文件 - 版本说明 + 下载 v0.1.0-beta.6 + SHA-256 校验文件 + 版本说明
运行方式
Windows 10/11 x64
数据边界
本地只读,不上传
-
当前版本
v0.1.0-beta.5
+
当前版本
v0.1.0-beta.6
@@ -234,20 +234,20 @@

双源关联

-

安装 Windows 测试版

v0.1.0-beta.5 新增工控log、双源关联与实际采样点设备趋势。当前版本未进行代码签名。已知问题:部分环境下单层详情图表或原始截图可能不显示。

+

安装 Windows 测试版

v0.1.0-beta.6 修复安装目录选择与重定向桌面快捷方式。当前版本未进行代码签名。已知问题:部分环境下单层详情图表或原始截图可能不显示。

  1. 1
    关闭旧版本

    升级前先退出所有正在运行的 Log Analysis 窗口。

  2. -
  3. 2
    下载两个文件

    同时下载 Log-Analysis-Setup-v0.1.0-beta.5-x64.exe 和 SHA256SUMS.txt。

  4. -
  5. 3
    核对 SHA-256

    在下载目录运行 Get-FileHash -Algorithm SHA256 .\Log-Analysis-Setup-v0.1.0-beta.5-x64.exe,与校验文件比较。

  6. -
  7. 4
    运行当前用户安装

    双击安装程序;不需要管理员权限,桌面快捷方式可选。

  8. +
  9. 2
    下载两个文件

    同时下载 Log-Analysis-Setup-v0.1.0-beta.6-x64.exe 和 SHA256SUMS.txt。

  10. +
  11. 3
    核对 SHA-256

    在下载目录运行 Get-FileHash -Algorithm SHA256 .\Log-Analysis-Setup-v0.1.0-beta.6-x64.exe,与校验文件比较。

  12. +
  13. 4
    选择安装目录

    双击安装程序并选择位置;桌面快捷方式可选,失败时不影响应用安装。

  14. 5
    处理测试版提示

    哈希匹配后,如 SmartScreen 警告可选择“更多信息”并核对文件名;组织策略阻止时请联系管理员。

  15. 6
    选择炉次并分析

    从开始菜单打开应用,点击“选择文件夹”,再点击“开始分析”。

diff --git a/test_analyzer.py b/test_analyzer.py index fc67cf4..a7f9513 100644 --- a/test_analyzer.py +++ b/test_analyzer.py @@ -871,6 +871,18 @@ def test_windows_launchers_use_crlf(self): self.assertIn(b"\r\n", content) self.assertNotIn(b"\n", content.replace(b"\r\n", b"")) + def test_installer_allows_directory_selection_and_tolerates_desktop_shortcut_failure(self): + script = (Path(__file__).parent / "installer" / "LogAnalysis.iss").read_text(encoding="utf-8") + self.assertIn("DisableDirPage=no", script) + self.assertNotIn('Name: "{autodesktop}\\{#MyAppName}"', script) + self.assertIn("User Shell Folders", script) + self.assertIn("WizardIsTaskSelected('desktopicon')", script) + self.assertIn("CreateShellLink(", script) + self.assertIn("except", script) + self.assertIn("已完成安装,但桌面快捷方式创建失败", script) + self.assertIn("RegWriteStringValue(HKCU, InstallerSettingsKey", script) + self.assertIn("DeleteFile(ShortcutPath)", script) + def test_public_site_is_local_only_and_links_to_releases(self): project = Path(__file__).parent html = (project / "site" / "index.html").read_text(encoding="utf-8") diff --git a/version.py b/version.py index 0903da1..a9ed438 100644 --- a/version.py +++ b/version.py @@ -1,5 +1,5 @@ APP_NAME = "Log Analysis" -APP_VERSION = "0.1.0-beta.5" +APP_VERSION = "0.1.0-beta.6" BUILD_CHANNEL = "beta" REPOSITORY_URL = "https://github.com/Reyppp/log-analysis" RELEASES_URL = f"{REPOSITORY_URL}/releases"