Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: backup and restore registry with update install #776

Closed
wants to merge 1 commit into from

Conversation

Watson1978
Copy link
Contributor

No description provided.

@daipom
Copy link
Contributor

daipom commented Jan 29, 2025

Thanks!
Note: this fixes:

@daipom
Copy link
Contributor

daipom commented Jan 30, 2025

Looks like this restores the all registry values in HKLM\System\CurrentControlSet\Services\fluentdwinsvc.
So, this restores ImagePath too?

ImagePath    REG_EXPAND_SZ    "C:/opt/fluent/bin/ruby.exe" -C "C:/opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.18.0/lib/fluent/command/.."  winsvc.rb --service-name fluentdwinsvc

If so, I have concerns about whether the service will work correctly after the update.
CI seems fine, I wonder why.

CI seems fine, I wonder why.

Hmm, in the current CI, this restoring logic does not work. So, it does not affect. I think.

@daipom daipom added the Windows label Jan 30, 2025
@Watson1978
Copy link
Contributor Author

Watson1978 commented Jan 30, 2025

So, this restores ImagePath too?

Indeed. I think there is two solution for that.

  1. Remove "ImagePath" section from backup registry file before storing.
  2. Or, Remove "ImagePath" in HKLM\SYSTEM\CurrentControlSet\Services\fluentdwinsvc before backup. After then, it back up HKLM\SYSTEM\CurrentControlSet\Services\fluentdwinsvc into fluentdwinsvc.reg and restore it.

@Watson1978 Watson1978 closed this Jan 30, 2025
@Watson1978 Watson1978 deleted the windows branch January 30, 2025 07:10
kenhys added a commit that referenced this pull request Jan 30, 2025
* Fixes #602 
* Another idea for #776

This keeps the following registry values (in
`HKLM\System\CurrentControlSet\Services\fluentdwinsvc`) when updating:

* `Start`
* `DelayedAutostart`
* `fluentdopt`

(ref https://wixtoolset.org/docs/v3/xsd/wix/registrysearch/)
@Watson1978 found we can write such a raw value with a prefix by
`string` Type. Thanks!

Signed-off-by: Daijiro Fukuda <[email protected]>
Co-authored-by: Shizuo Fujita <[email protected]>
Co-authored-by: Kentaro Hayashi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants