Skip to content

Conversation

@SorYoshino
Copy link
Contributor

@SorYoshino SorYoshino commented Jan 21, 2026

Summary

Refactors simple-dnscrypt to fix extraction issues, improve persistence reliability, and align the uninstaller with Scoop's lifecycle.

Related issues or pull requests

Changes

  • Metadata Cleanup: Update description, homepage, and structured the license field.
  • Fix Extraction: Add logic to move files out of the APPDIR subfolder to the root directory during installation.
  • Improve Persistence:
    • Simplify the persist field to the main configuration.
    • Add manual backup for log and text files in pre_uninstall to ensure they are preserved correctly in the persist_dir.
  • Relocate Termination Logic: Move Stop-Process and Stop-Service to the uninstaller block to prevent silent data loss and respect Scoop's process check.
  • Enhance Service Safety: Add path-based regex validation to ensure the uninstaller only targets the service instance associated with this Scoop installation.

Notes

  • Lifecycle Compliance: By moving termination logic from pre_uninstall to uninstaller, Scoop can now properly notify users if the app is running before attempting to kill it.
  • Service Security: The use of $service.BinaryPathName -notmatch $path_regex prevents the script from accidentally stopping or deleting non-Scoop versions of dnscrypt-proxy.
  • If empty files such as query.log are created in dnscrypt-proxy, the application will fail to start properly.
  • Running Uninstall.exe backs up dnscrypt-proxy.toml to $env:TEMP and stops the dnscrypt-proxy service. This behavior overlaps with the logic implemented in this PR, so Start-Process -Wait "$dir\Uninstall.exe" | Out-Null has been removed.

Testing

The test results are as follows:
# `use_lessmsi` is true, and services are not installed.
┏[ ~]
└─> scoop config | rg lessmsi
use_lessmsi                     : True

┏[ ~]
└─> scoop install 'D:\Temporary\Software\Microsoft\Windows Sandbox\Repositories\Scoop\Buckets\Extras\bucket\simple-dnscrypt.json'
Installing 'simple-dnscrypt' (0.7.1) [64bit] from 'D:\Temporary\Software\Microsoft\Windows Sandbox\Repositories\Scoop\Buckets\Extras\bucket\simple-dnscrypt.json'
Loading SimpleDNSCrypt64.msi from cache.
Checking hash of SimpleDNSCrypt64.msi... OK.
Extracting SimpleDNSCrypt64.msi... Done.
Running pre_install script... Done.
Linking D:\Software\Scoop\Local\apps\simple-dnscrypt\current => D:\Software\Scoop\Local\apps\simple-dnscrypt\0.7.1
Creating shortcut for Simple DnsCrypt (SimpleDnsCrypt.exe)
Persisting dnscrypt-proxy\dnscrypt-proxy.toml
'simple-dnscrypt' (0.7.1) was installed successfully!
'simple-dnscrypt' suggests installing 'extras/vcredist2022'.

┏[ ~]
└─> scoop update simple-dnscrypt -f
simple-dnscrypt: 0.7.1 -> 0.7.1
Updating one outdated app:
Updating 'simple-dnscrypt' (0.7.1 -> 0.7.1)
Downloading new version
Loading SimpleDNSCrypt64.msi from cache.
Checking hash of SimpleDNSCrypt64.msi... OK.
Running pre_uninstall script... Done.
Uninstalling 'simple-dnscrypt' (0.7.1)
Running uninstaller script... Done.
Unlinking D:\Software\Scoop\Local\apps\simple-dnscrypt\current
Installing 'simple-dnscrypt' (0.7.1) [64bit] from 'D:\Temporary\Software\Microsoft\Windows Sandbox\Repositories\Scoop\Buckets\Extras\bucket\simple-dnscrypt.json'
Loading SimpleDNSCrypt64.msi from cache.
Extracting SimpleDNSCrypt64.msi... Done.
Running pre_install script... Done.
Linking D:\Software\Scoop\Local\apps\simple-dnscrypt\current => D:\Software\Scoop\Local\apps\simple-dnscrypt\0.7.1
Creating shortcut for Simple DnsCrypt (SimpleDnsCrypt.exe)
Persisting dnscrypt-proxy\dnscrypt-proxy.toml
'simple-dnscrypt' (0.7.1) was installed successfully!

┏[ ~]
└─> scoop uninstall simple-dnscrypt -p
Uninstalling 'simple-dnscrypt' (0.7.1).
Running pre_uninstall script... Done.
Running uninstaller script... Done.
Removing shortcut ~\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Scoop Apps\Simple DnsCrypt.lnk
Unlinking D:\Software\Scoop\Local\apps\simple-dnscrypt\current
Removing older version (_0.7.1.old).
Removing persisted data.
'simple-dnscrypt' was uninstalled.


# `use_lessmsi` is false, and services are installed.
┏[ ~]
└─> scoop config | rg lessmsi
use_lessmsi                     : False

┏[ ~]
└─> scoop install 'D:\Temporary\Software\Microsoft\Windows Sandbox\Repositories\Scoop\Buckets\Extras\bucket\simple-dnscrypt.json'
Installing 'simple-dnscrypt' (0.7.1) [64bit] from 'D:\Temporary\Software\Microsoft\Windows Sandbox\Repositories\Scoop\Buckets\Extras\bucket\simple-dnscrypt.json'
Loading SimpleDNSCrypt64.msi from cache.
Checking hash of SimpleDNSCrypt64.msi... OK.
Extracting SimpleDNSCrypt64.msi... Done.
Running pre_install script... Done.
Linking D:\Software\Scoop\Local\apps\simple-dnscrypt\current => D:\Software\Scoop\Local\apps\simple-dnscrypt\0.7.1
Creating shortcut for Simple DnsCrypt (SimpleDnsCrypt.exe)
Persisting dnscrypt-proxy\dnscrypt-proxy.toml
'simple-dnscrypt' (0.7.1) was installed successfully!
'simple-dnscrypt' suggests installing 'extras/vcredist2022'.

┏[ ~]
└─> scoop update simple-dnscrypt -f
simple-dnscrypt: 0.7.1 -> 0.7.1
Updating one outdated app:
Updating 'simple-dnscrypt' (0.7.1 -> 0.7.1)
Downloading new version
Loading SimpleDNSCrypt64.msi from cache.
Checking hash of SimpleDNSCrypt64.msi... OK.
Running pre_uninstall script... Done.
Uninstalling 'simple-dnscrypt' (0.7.1)
Running uninstaller script...
[ERROR]  simple-dnscrypt requires admin rights to update.

┏[ ~]
└─[ Error, check your command]> sudo scoop update simple-dnscrypt -f
simple-dnscrypt: 0.7.1 -> 0.7.1
Updating one outdated app:
Updating 'simple-dnscrypt' (0.7.1 -> 0.7.1)
WARN  The following instances of "simple-dnscrypt" are still running. Scoop is configured to ignore this condition.

 NPM(K)    PM(M)      WS(M)     CPU(s)      Id  SI ProcessName
 ------    -----      -----     ------      --  -- -----------
     21    22.19      21.26       0.11   17532   0 dnscrypt-proxy

Downloading new version
Loading SimpleDNSCrypt64.msi from cache.
Checking hash of SimpleDNSCrypt64.msi... OK.
Running pre_uninstall script... Done.
Uninstalling 'simple-dnscrypt' (0.7.1)
Running uninstaller script... Done.
Unlinking D:\Software\Scoop\Local\apps\simple-dnscrypt\current
Installing 'simple-dnscrypt' (0.7.1) [64bit] from 'D:\Temporary\Software\Microsoft\Windows Sandbox\Repositories\Scoop\Buckets\Extras\bucket\simple-dnscrypt.json'
Loading SimpleDNSCrypt64.msi from cache.
Extracting SimpleDNSCrypt64.msi... Done.
Running pre_install script... Done.
Linking D:\Software\Scoop\Local\apps\simple-dnscrypt\current => D:\Software\Scoop\Local\apps\simple-dnscrypt\0.7.1
Creating shortcut for Simple DnsCrypt (SimpleDnsCrypt.exe)
Persisting dnscrypt-proxy\dnscrypt-proxy.toml
'simple-dnscrypt' (0.7.1) was installed successfully!

┏[ ~]
└─> sudo scoop uninstall simple-dnscrypt -p
Uninstalling 'simple-dnscrypt' (0.7.1).
Running pre_uninstall script... Done.
WARN  The following instances of "simple-dnscrypt" are still running. Scoop is configured to ignore this condition.

 NPM(K)    PM(M)      WS(M)     CPU(s)      Id  SI ProcessName
 ------    -----      -----     ------      --  -- -----------
     20    22.48      21.05       0.16    2784   0 dnscrypt-proxy
     64   135.23     189.70       4.75   13852   1 SimpleDnsCrypt

Running uninstaller script... Done.
Removing shortcut ~\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Scoop Apps\Simple DnsCrypt.lnk
Unlinking D:\Software\Scoop\Local\apps\simple-dnscrypt\current
Removing older version (_0.7.1.old).
Removing persisted data.
'simple-dnscrypt' was uninstalled.
  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

Summary by CodeRabbit

  • Chores

    • Updated app description and homepage URL for clarity
    • Improved license metadata formatting
    • Clarified Visual C++ redistributable naming
  • New Features

    • Streamlined installation and simplified cleanup behavior
    • Added a robust uninstaller that preserves user configuration and ensures proper service/process shutdown

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

Walkthrough

Reworks the simple-dnscrypt manifest: cleans metadata, changes persist from multiple entries to a single dnscrypt-proxy.toml, refactors pre_install/pre_uninstall to preserve files, and adds a new uninstaller PowerShell script that stops/removes the dnscrypt-proxy service and related processes.

Changes

Cohort / File(s) Summary
Manifest Metadata
bucket/simple-dnscrypt.json
Updated description, trimmed homepage trailing slash, expanded license from string to object with identifier+URL, and renamed suggest key to "Microsoft Visual C++ 2015-2022 Redistributable"
Persist & Install Logic
bucket/simple-dnscrypt.json
Replaced multi-file persist array with "dnscrypt-proxy\\dnscrypt-proxy.toml"; pre_install refactored to copy APPDIR, remove/restore files, and persist existing dnscrypt-proxy files instead of previous APPDIR init flow
Uninstall / Service Handling
bucket/simple-dnscrypt.json
pre_uninstall simplified to copy *.log/*.txt to persisted dir; new uninstaller block added with PowerShell script to locate app path, enforce admin, stop processes/services, and remove service via sc.exe or Remove-Service

Sequence Diagram(s)

sequenceDiagram
  participant Installer as Installer Script
  participant Filesystem as Filesystem (APPDIR / Persist)
  participant Service as dnscrypt-proxy Service
  participant Windows as Windows Service Manager

  Installer->>Filesystem: Copy APPDIR files, detect persisted dnscrypt-proxy.toml
  Installer->>Service: Check running processes/services
  Service-->>Installer: Report status
  Installer->>Service: Stop processes (Stop-Process / Stop-Service)
  Installer->>Windows: Remove service (sc.exe or Remove-Service)
  Installer->>Filesystem: Move *.log/*.txt to persisted dir
  Installer->>Filesystem: Ensure dnscrypt-proxy.toml persisted
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • z-Fng

Poem

🐰
I hopped through JSON, neat and spry,
Saved toml files before they fly,
Stopped the service, cleaned the logs,
A little script among the frogs,
Simple DNS, configured with a sigh.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: fixing extraction & persistence and refactoring uninstaller logic in simple-dnscrypt.
Description check ✅ Passed The PR description comprehensively covers all required template elements including a clear summary, linked issues, detailed changes, notes, and testing results.
Linked Issues check ✅ Passed The PR successfully addresses issue #10138 by fixing file extraction and placement via the pre_install logic that moves files from APPDIR subfolder to root, enabling proper shim creation.
Out of Scope Changes check ✅ Passed All changes directly support the stated objectives: fixing extraction, improving persistence, refactoring uninstaller logic, and metadata cleanup. No out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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

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

@github-actions
Copy link
Contributor

All changes look good.

Wait for review from human collaborators.

simple-dnscrypt

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@bucket/simple-dnscrypt.json`:
- Around line 54-58: The removal commands hardcode 'dnscrypt-proxy' while
detection uses a wildcard "*dnscrypt-proxy*", so change the script to capture
the actual detected service name into a variable (e.g., $svcName) and use that
variable in both the sc.exe argument list and Remove-Service call; update the
branch that uses Start-Process -FilePath 'sc.exe' -ArgumentList @('delete',
'dnscrypt-proxy') to substitute the detected $svcName, and likewise pass
$svcName to Remove-Service -Name 'dnscrypt-proxy' so the script deletes the
exact service found by the wildcard.
- Around line 47-48: The service detection is wrong: change Get-Service usage to
use the -Name parameter (Get-Service -Name '*dnscrypt-proxy*') and then retrieve
the executable path from WMI/CIM (e.g., Get-CimInstance -ClassName Win32_Service
-Filter "Name='${service.Name}'") because ServiceController objects returned by
Get-Service do not have BinaryPathName; replace the current BinaryPathName check
(using $service.BinaryPathName -notmatch $path_regex) with the path from the CIM
object and ensure subsequent checks reference $service.Name when querying the
CIM/WMI service object.

@SorYoshino SorYoshino marked this pull request as draft January 21, 2026 15:55
@SorYoshino
Copy link
Contributor Author

/verify

@SorYoshino SorYoshino marked this pull request as ready for review January 21, 2026 17:23
@github-actions
Copy link
Contributor

All changes look good.

Wait for review from human collaborators.

simple-dnscrypt

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

@SorYoshino
Copy link
Contributor Author

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

simple-dnscrypt@0.7.1: Shim creation fail

1 participant