Skip to content

fix: Add /FORCEREGISTRY flag to windows installer#5517

Merged
kalleep merged 4 commits intomainfrom
kalleep/windows-installer-force-flag
Feb 19, 2026
Merged

fix: Add /FORCEREGISTRY flag to windows installer#5517
kalleep merged 4 commits intomainfrom
kalleep/windows-installer-force-flag

Conversation

@kalleep
Copy link
Contributor

@kalleep kalleep commented Feb 12, 2026

Pull Request Details

When using the windows installer to upgrade alloy it's not possible to update arguments, environment etc if it was previously written. I added a flag that will force set these in windows registry.

Issue(s) fixed by this Pull Request

Notes to the Reviewer

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated

@kalleep kalleep requested review from a team and clayton-cornell as code owners February 12, 2026 14:14
@kalleep
Copy link
Contributor Author

kalleep commented Feb 12, 2026

I don't have much experience with nsis scripts and maybe there is a better way to do this

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

💻 Deploy preview deleted (fix: Add /FORCEREGISTRY flag to windows installer).

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Feb 13, 2026
@clayton-cornell
Copy link
Contributor

Doc changes look OK to me.

Copy link
Contributor

@ptodev ptodev left a comment

Choose a reason for hiding this comment

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

This feels like a workaround. Can we just recommend to users to run the uninstaller if they want to reset the installation?

If the uninstaller isn't an option because certain things need to be preserved, then could we just add an installer option to delete all Alloy registry keys prior to the installation?

@ptodev ptodev self-assigned this Feb 16, 2026
@kalleep
Copy link
Contributor Author

kalleep commented Feb 17, 2026

This feels like a workaround. Can we just recommend to users to run the uninstaller if they want to reset the installation?

Yes that's the point. No if we uninstall the data directory will be removed so we lose WAL, position files etc.

then could we just add an installer option to delete all Alloy registry keys prior to the installation?

Sure that could work but then the updating alloy is two steps no? One to prune registry and then one to update it again or did you have something else in mind?

@clayton-cornell
Copy link
Contributor

Would it help to add a little clarification around upgrade behavior? Maybe something like this (just below the install options and above the note)?

### Upgrade behavior

On a fresh install, the installer writes all options you pass to the Windows registry.

On an upgrade, the installer preserves registry values by default.
The installer ignores options you pass during an upgrade unless you use `/FORCEREGISTRY=yes`.

When you use `/FORCEREGISTRY=yes`, the installer writes all options to the registry.
To change one setting while preserving others, include all the options you want to keep along with the changed setting.

Copy link
Contributor

@ptodev ptodev left a comment

Choose a reason for hiding this comment

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

we lose WAL, position files etc

By default the "data" files are in a different directory from the one the Alloy executable resides in. I don't know if the uninstaller will remove it. If it doesn't then this could be a problem in itself, since people would expect the uninstaller to remove that too.

Sure that could work but then the updating alloy is two steps no? One to prune registry and then one to update it again or did you have something else in mind?

No, what I mean is that if FORCEREGISTRY is set, then install_script.nsis can delete all the Alloy registry keys at the start of the installation. Then the rest of the installation can proceed as normal. It'd make the script cleaner and easier to understand. I'd also clean up the registry from keys that are old or unused.

@kalleep
Copy link
Contributor Author

kalleep commented Feb 18, 2026

By default the "data" files are in a different directory from the one the Alloy executable resides in. I don't know if the uninstaller will remove it. If it doesn't then this could be a problem in itself, since people would expect the uninstaller to remove that too.

It will

@kalleep
Copy link
Contributor Author

kalleep commented Feb 18, 2026

No, what I mean is that if FORCEREGISTRY is set, then install_script.nsis can delete all the Alloy registry keys at the start of the installation. Then the rest of the installation can proceed as normal. It'd make the script cleaner and easier to understand. I'd also clean up the registry from keys that are old or unused.

Sure I guess that could work

@kalleep
Copy link
Contributor Author

kalleep commented Feb 19, 2026

@ptodev I change to the suggestion you made, much simpler

@github-actions
Copy link
Contributor

TruffleHog Scan Results

Summary: Found 11 potential secrets (0 verified, 11 unverified)

  • Possible secret (DatadogToken) at collector/go.sum:99vYIv***Th0O
  • Possible secret (DatadogToken) at collector/go.sum:39apjx***uJsA
  • Possible secret (DatadogToken) at collector/go.sum:78gnoy***ANOi
  • Possible secret (DatadogToken) at extension/alloyengine/go.sum:99vYIv***Th0O
  • Possible secret (DatadogToken) at extension/alloyengine/go.sum:3gnoy***ANOi
  • Possible secret (DatadogToken) at extension/alloyengine/go.sum:107gnoy***ANOi
  • Possible secret (DatadogToken) at extension/alloyengine/go.sum:39apjx***uJsA
  • Possible secret (DatadogToken) at go.sum:101vYIv***Th0O
  • Possible secret (DatadogToken) at go.sum:41apjx***uJsA
  • Possible secret (DatadogToken) at go.sum:118gnoy***ANOi
  • Possible secret (DatadogToken) at go.sum:12gnoy***ANOi

Review: Check if unverified secrets are false positives.

@kalleep kalleep merged commit f081e28 into main Feb 19, 2026
49 of 50 checks passed
@kalleep kalleep deleted the kalleep/windows-installer-force-flag branch February 19, 2026 14:51
@grafana-alloybot grafana-alloybot bot mentioned this pull request Feb 19, 2026
jharvey10 pushed a commit that referenced this pull request Feb 26, 2026
### Pull Request Details
When using the windows installer to upgrade alloy it's not possible to
update arguments, environment etc if it was previously written. I added
a flag that will force set these in windows registry.

### Issue(s) fixed by this Pull Request

<!-- Fixes #issue_id -->

### Notes to the Reviewer

<!-- Add any relevant notes for the reviewers and testers of this PR.
-->

### PR Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to
[x]. -->

- [x] Documentation added
- [ ] Tests updated
- [ ] Config converters updated

---------

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age type/docs Docs Squad label across all Grafana Labs repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants