Skip to content

fix(nsis): prefix StrReplaceAll with un. for uninstall section#119

Merged
iamvirul merged 3 commits into
mainfrom
fix/nsis-uninstall-function-prefix
May 3, 2026
Merged

fix(nsis): prefix StrReplaceAll with un. for uninstall section#119
iamvirul merged 3 commits into
mainfrom
fix/nsis-uninstall-function-prefix

Conversation

@iamvirul
Copy link
Copy Markdown
Owner

@iamvirul iamvirul commented May 3, 2026

Problem

`makensis` aborted with:

```
Call must be used with function names starting with "un." in the uninstall section.
Usage: Call function_name | [:label_name]
Error in script "installer.nsi" on line 115 -- aborting creation process
```

NSIS enforces that any function called from an `Uninstall` section must be defined as `Function un.FunctionName` and called as `Call un.FunctionName`. `StrReplaceAll` was defined as a plain `Function` but called from the `Uninstall` section.

Fix

Rename `Function StrReplaceAll` → `Function un.StrReplaceAll` and update both `Call` sites in the uninstall section.

`StrContains` is only called from the install section and stays unprefixed.

Function Called from Prefix needed
`StrContains` Install section none
`un.StrReplaceAll` Uninstall section `un.` ✅

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows uninstaller to properly clean up system PATH entries when removing the application.

NSIS requires functions called from an Uninstall section to be
defined as Function un.FunctionName. StrReplaceAll is only called
from the Uninstall section, so rename it to un.StrReplaceAll and
update both call sites. StrContains is only called from the Install
section and stays unprefixed.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 3, 2026

Warning

Rate limit exceeded

@iamvirul has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 55 minutes and 16 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1c15aa14-c4b0-4740-bf6c-83595070a330

📥 Commits

Reviewing files that changed from the base of the PR and between 04bd60b and ce0ff36.

📒 Files selected for processing (1)
  • CHANGELOG.md
📝 Walkthrough

Walkthrough

The Windows installer script's uninstaller section now calls a prefixed helper function un.StrReplaceAll instead of the generic StrReplaceAll to remove the installation directory from the system PATH during uninstallation. The corresponding function definition is updated to use the uninstaller prefix.

Changes

Uninstaller PATH Cleanup Refactoring

Layer / File(s) Summary
Function Definition
\.github/windows-installer.nsi (lines 165–168)
Function declaration changes from StrReplaceAll to un.StrReplaceAll with uninstaller-specific semantics and updated comments.
Uninstall Section Call Site
\.github/windows-installer.nsi (lines 112–120)
PATH removal logic is updated to call un.StrReplaceAll with the corrected argument sequence for removing ;${INSTDIR} from the system Path string.

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A path once tangled, now pristine and clear,
The uninstaller hops with function so dear,
From generic to prefixed, we clean up with care,
No traces remain when we hop out of there!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: renaming StrReplaceAll to un.StrReplaceAll for use in the uninstall section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nsis-uninstall-function-prefix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 55 minutes and 16 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@iamvirul iamvirul self-assigned this May 3, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 3, 2026
@iamvirul iamvirul merged commit af7e8ab into main May 3, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation github-actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant