Skip to content

build(windows): during installation remove autostart entry before updating/reinstalling, to prevent duplicates - #1061

Open
ErikBjare wants to merge 1 commit into
masterfrom
dev/clean-up-iss-autostart-windows-on-update
Open

ErikBjare wants to merge 1 commit into
masterfrom
dev/clean-up-iss-autostart-windows-on-update

Conversation

@ErikBjare

@ErikBjare ErikBjare commented May 20, 2024 •

Copy link
Copy Markdown
Member

No idea if this fixes it.


🚀 This description was created by Ellipsis for commit a00b53a

Summary:

This PR updates the activitywatch-setup.iss script to remove existing autostart entries during installation, preventing duplicates.

Key points:

  • Updated activitywatch-setup.iss to remove existing autostart entry during installation.
  • Prevents duplicate autostart entries on reinstall/update.

Generated with ❤️ by ellipsis.dev

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to a00b53a in 1 minute and 12 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. scripts/package/activitywatch-setup.iss:67
  • Draft comment:
    Ensure that the deletion of the autostart entry is handled gracefully even if the file does not exist. Consider adding a check or a flag to avoid errors or warnings during the installation process if the file is not found.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_W8fkdYCafGGTgbND


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

⌛ 8 hours left in your free trial, upgrade for $20/seat/month or contact us.

@TimeToBuildBob

TimeToBuildBob commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI code review

Adds an [InstallDelete] section to the Inno Setup script that removes the autostart shortcut file at {userstartup}\ActivityWatch before installation, intended to prevent duplicate autostart entries on reinstall/update. The existing commented-out [InstallDelete] block for {app} remains unchanged.

Not safe to merge — 1 P1 open

Confidence 3/5

1 finding · ❌ 1 P1

❌ P1 high — scripts/package/activitywatch-setup.iss:67

The new [InstallDelete] entry uses Type: files with Name: "{userstartup}{#MyAppName}". In Inno Setup, the {userstartup} constant resolves to the current user's Startup folder, and the shortcut created by the [Icons] section is named "ActivityWatch.lnk" (the .lnk extension is appended automatically). The InstallDelete entry specifies the path without the .lnk extension. Inno Setup's file deletion for a name without an extension will not match the .lnk file, so the autostart shortcut is not removed. As a result, on reinstall/update, the old shortcut remains and a new one is created, producing the duplicate autostart entries the PR aims to prevent. The fix should include the .lnk extension: Name: "{userstartup}{#MyAppName}.lnk".

Type: files; Name: "{userstartup}\{#MyAppName}.lnk"

How this was verified: Checked the [Icons] section line 55: Name: "{userstartup}{#MyAppName}"; Filename: "{app}{#MyAppExeName}" — Inno Setup creates a shortcut with the .lnk extension. The InstallDelete entry lacks the .lnk extension, so it will not match the shortcut file. Inno Setup documentation states that InstallDelete Type: files deletes files matching the given name; without a wildcard, it is an exact match.

Files changed (1) — the diff as I read it
  • scripts/package/activitywatch-setup.iss — Adds an [InstallDelete] entry that deletes the file {userstartup}\ActivityWatch during install.

Reviewed a00b53a83a61 · openrouter/deepseek/deepseek-v4-flash-0731 · llm engine · 19s · about this reviewer

Maintainer commands

@TimeToBuildBob review (own line) — fresh review · @TimeToBuildBob fix — a worker acts on the findings. Once per comment; 👀 = received.


; Removes the previously installed version before installing the new one
[InstallDelete]
Type: files; Name: "{userstartup}\{#MyAppName}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ P1 — The new [InstallDelete] entry uses Type: files with Name: "{userstartup}{#MyAppName}". In Inno Setup, the {userstartup} constant resolves to the current user's Startup folder, and the shortcut created by the [Icons] section is named "ActivityWatch.lnk" (the .lnk extension is appended automatically). The InstallDelete entry specifies the path without the .lnk extension. Inno Setup's file deletion for a name without an extension will not match the .lnk file, so the autostart shortcut is not removed. As a result, on reinstall/update, the old shortcut remains and a new one is created, producing the duplicate autostart entries the PR aims to prevent. The fix should include the .lnk extension: Name: "{userstartup}{#MyAppName}.lnk".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants