Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Build and test on every push to main and every pull request.
# Version tags (v1.0.0) publish GitHub Release downloads.
# workflow_dispatch and pull requests build the same files and upload them as
# artifacts only, so the publish path can be checked without a public release.

name: CI

on:
push:
branches: [main]
tags: ["v*"]
pull_request:
workflow_dispatch:

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
contents: read

env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1

defaults:
run:
shell: pwsh

jobs:
test:
name: Build and test
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7

- uses: actions/setup-dotnet@v6
with:
dotnet-version: 9.0.x

- name: Test
run: dotnet test DiskSweeper.sln -c Release --nologo --logger "console;verbosity=minimal"

publish:
name: Publish Windows builds
needs: test
if: >-
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request' ||
startsWith(github.ref, 'refs/tags/v')
runs-on: windows-latest
timeout-minutes: 40
permissions:
actions: write
contents: write
steps:
- uses: actions/checkout@v7

- uses: actions/setup-dotnet@v6
with:
dotnet-version: 9.0.x

- name: Publish self-contained builds and installer
run: ./build/Publish-Release.ps1

- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: DiskSweeper-windows
path: artifacts/dist/*
if-no-files-found: error

- name: Publish GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
env:
GH_TOKEN: ${{ github.token }}
run: |
$PSNativeCommandUseErrorActionPreference = $false
$tag = $env:GITHUB_REF_NAME
$files = @(Get-ChildItem artifacts/dist -File | ForEach-Object FullName)
gh release view $tag --repo $env:GITHUB_REPOSITORY
if ($LASTEXITCODE -eq 0) {
gh release upload $tag @files --repo $env:GITHUB_REPOSITORY --clobber
if ($LASTEXITCODE -ne 0) { throw "gh release upload failed." }
}
else {
$extra = @()
if ($tag -match '-') { $extra = @('--prerelease') }
gh release create $tag @files `
--repo $env:GITHUB_REPOSITORY `
--title "DiskSweeper $tag" `
--generate-notes `
--verify-tag `
@extra
if ($LASTEXITCODE -ne 0) { throw "gh release create failed." }
}
8 changes: 8 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<Product>DiskSweeper</Product>
<Company>process631</Company>
<Authors>process631</Authors>
<Copyright>Copyright (c) 2026 process631</Copyright>
</PropertyGroup>
</Project>
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 process631

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
78 changes: 71 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,39 @@
See what's taking up space on your PC, sorted biggest first, and safely delete what you choose, including
leftover game files and folders that refuse to be deleted the normal way.

## Run it
## Download

- **App:** double-click `publish\DiskSweeper.exe`, or `dotnet run --project src/DiskSweeper.App`.
Use **Run as administrator** (bottom of the sidebar) for fast scans and protected folders.
- **Command line:** `publish\dsweep.exe` (see [Command line](#command-line)).
Windows 10 or 11. The .NET runtime is inside the download.

Needs Windows 10/11 and the .NET 9 Desktop Runtime.
| Download | Use it when |
|---|---|
| [DiskSweeper-Setup.exe](https://github.com/process631/DiskSweeper/releases/latest/download/DiskSweeper-Setup.exe) | You want a Start menu shortcut and an uninstaller. |
| [DiskSweeper-win-x64.exe](https://github.com/process631/DiskSweeper/releases/latest/download/DiskSweeper-win-x64.exe) | You want one file to double-click, on 64-bit Windows. |
| [DiskSweeper-win-x64.zip](https://github.com/process631/DiskSweeper/releases/latest/download/DiskSweeper-win-x64.zip) | You also want the `dsweep` command-line tool and the license. |
| [DiskSweeper-win-arm64.zip](https://github.com/process631/DiskSweeper/releases/latest/download/DiskSweeper-win-arm64.zip) | You have Windows on ARM. A single [DiskSweeper-win-arm64.exe](https://github.com/process631/DiskSweeper/releases/latest/download/DiskSweeper-win-arm64.exe) is on the release too. |

These links follow the [latest release](https://github.com/process631/DiskSweeper/releases/latest). Each release includes `SHA256SUMS.txt` so you can check the download.

### Install

1. Download **DiskSweeper-Setup.exe** and open it.
2. Accept the Windows prompt that lets the installer copy files into Program Files. After that, DiskSweeper opens as a normal user.
3. Finish the wizard, then open **DiskSweeper** from the Start menu.
4. A desktop icon is an optional checkbox in the installer, off by default. Remove the app later from **Settings > Apps**.

### Portable

Download **DiskSweeper-win-x64.exe** and double-click it. Delete that file when you want it gone. The zip is the same app plus `dsweep.exe`, a short readme, and the license.

The installer is the 64-bit build. It also runs on Windows 11 on ARM under emulation. The ARM zip is the native build.

### Windows SmartScreen

These downloads aren't code-signed. The first time you open one, Windows shows **Windows protected your PC** and an unknown publisher. Choose **More info**, then **Run anyway**.

### Administrator

DiskSweeper opens as a normal user. A fast scan of a whole NTFS drive reads that drive's file table and needs administrator rights. So do **Take ownership and delete** and **Delete on next restart**. **Run as administrator** at the bottom of the sidebar is where Windows asks. The application manifest is `asInvoker`, so that prompt stays on those actions.

## What's in the app

Expand Down Expand Up @@ -86,6 +112,8 @@ For removing programs completely (registry entries, services, scheduled tasks),

## Command line

`dsweep.exe` ships in the portable zip and in the install folder. From a source checkout: `dotnet run --project src/DiskSweeper.Cli -- --help`.

```
dsweep biggest folders and files on C:
dsweep D:\ --depth 3 --files 20 another drive, shallower tree
Expand All @@ -107,23 +135,59 @@ src/DiskSweeper.Core all logic, no UI
src/DiskSweeper.App WPF app (Windows light/dark theme)
src/DiskSweeper.Cli dsweep command-line tool
tests/ xUnit tests; destructive tests run only in throwaway folders under %TEMP%
build/Publish-Release.ps1 release exes, zips, and the installer
installer/ Inno Setup script (Start menu shortcut and uninstaller)
.github/workflows/ci.yml build, test, and the GitHub Release
```

## Build and test
## Build from source

Developers need Windows 10 or 11 and the [.NET 9 SDK](https://dotnet.microsoft.com/download/dotnet/9.0).

```
dotnet build
dotnet test
dotnet publish src/DiskSweeper.App -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o publish
dotnet run --project src/DiskSweeper.App
```

Run `dotnet test` from an **administrator** terminal to include the admin-only tests (fast scan, take
ownership). From a normal terminal they're reported as skipped.

`dotnet run` uses the SDK on your machine. Release builds bundle the runtime. To produce that executable locally:

```
dotnet publish src/DiskSweeper.App -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:EnableCompressionInSingleFile=true -p:DebugType=none -p:DebugSymbols=false -o publish
```

`build/Publish-Release.ps1` builds the app and `dsweep` for win-x64 and win-arm64, zips them, and compiles
`DiskSweeper-Setup.exe`. The installer script needs [Inno Setup 7](https://jrsoftware.org/isdl.php). The
script downloads it when `ISCC.exe` isn't already installed.

### Publishing a release

Pushes to `main` and pull requests build and test. A pull request also uploads the installers as a
workflow artifact. Pushing a version tag, once this workflow is on `main`, publishes the download:

```
git checkout main
git pull
git tag -a v1.0.0 -m "DiskSweeper 1.0.0"
git push origin v1.0.0
```

The tag is `v` plus `major.minor.patch` (a hyphen, as in `v1.0.0-rc.1`, marks a prerelease). GitHub Actions
attaches the executables, the zips, the installer, and `SHA256SUMS.txt` to a GitHub Release and fills in
the notes from the commits. To build those files without a release, open the **CI** workflow and choose
**Run workflow**.

## Good to know

- Recycled items still use space until the Recycle Bin is emptied (Cleanup lists the bin).
- A scan of 1.5 million files uses about 500 MB of memory while the app is open.
- App data (log, settings, the last five scans per drive) is in `%LOCALAPPDATA%\DiskSweeper`.
- "Delete on next restart" hasn't been exercised on a real reboot during development. It uses the standard
Windows mechanism (`MoveFileEx` with delay-until-reboot).

## License

[MIT](LICENSE). Copyright (c) 2026 process631.
Loading