* feat: Add Windows package manager publishing infrastructure (#343)
- Add comprehensive release build scripts:
- build-release.ps1: Creates portable ZIP + SHA256 checksums
- build-exe.ps1: Standalone executable builder (PS2EXE)
- build-msi.ps1: MSI installer builder (WiX Toolset)
- Add GitHub Actions workflow:
- Automated builds on version tags
- Runs tests before building
- Auto-creates GitHub releases with artifacts
- Add package manager manifests:
- WinGet: Complete manifests ready for microsoft/winget-pkgs
- Chocolatey: Full package with install/uninstall scripts
- Scoop: JSON manifest ready for submission
- Add comprehensive documentation:
- RELEASE.md: Complete guide for building and publishing
- Package-specific READMEs with submission instructions
- ISSUE-343-SUMMARY.md: Quick reference and next steps
Successfully tested: Built mole-1.0.0-x64.zip (5 MB) with SHA256 checksums
Addresses #343
* chore: update contributors [skip ci]
* fix: Support uppercase V and -windows suffix in release workflow
* fix: Remove duplicate parameter definitions in clean, optimize, and purge commands
- bin/clean.ps1: Remove duplicate System, GameMedia, DebugMode, Whitelist params
- bin/optimize.ps1: Remove duplicate DebugMode param
- bin/purge.ps1: Remove duplicate DebugMode and Paths params
These duplicates were causing parser errors in tests.
* fix: Update test regex to match --dry-run format in help text
The help output shows --dry-run (kebab-case) but test was checking for DryRun (PascalCase).
Updated regex to accept both formats.
* fix: Handle Pester 5.x result object properties correctly
Pester 5.x uses different property names (Passed.Count, Failed.Count)
instead of PassedCount, FailedCount. Added fallback logic to support both formats.
* fix: Simplify Pester result parsing with better fallback logic
Since Pester already prints test results, just check for failures
and assume success if we can't parse the result object. This handles
different Pester versions more gracefully.
* feat: Add MSI and EXE builds to release workflow
- Install WiX Toolset for MSI creation
- Install PS2EXE module for standalone EXE
- Build all three formats: ZIP, MSI, EXE
- MSI and EXE builds marked optional (continue-on-error)
- Upload all artifacts to GitHub release
- Update release notes with installation instructions for all formats
- Add SHA256 verification instructions for each format
* fix: Resolve MSI and EXE build failures
MSI build fix:
- Use UTF8 without BOM for temp WXS file to avoid XML parsing errors
- WiX compiler requires clean UTF8 encoding without byte order mark
EXE build fix:
- Remove hashtable iteration that modified collection during enumeration
- Exclude null iconFile parameter from ps2exe params instead of removing it
- Prevents 'Collection was modified' exception
* fix: Properly handle encoding and version format for MSI and EXE builds
MSI fix:
- Use System.IO.File.ReadAllText/WriteAllText for consistent UTF8 without BOM
- Prevents XML parsing errors in WiX compiler
EXE fix:
- Extract numeric version only (strip '-windows' suffix) for ps2exe
- ps2exe requires version in format n.n.n.n (numeric only)
- Fallback to 1.0.0.0 if version parsing fails
* fix: Use WriteAllBytes to ensure no BOM in MSI WXS file
- Convert string to UTF8 bytes manually
- Write bytes directly to file
- This guarantees no byte order mark is added
- Prevents WiX XML parsing error at position 7
* fix: Read WXS source as bytes to completely avoid BOM issues
- Read source file as raw bytes
- Convert bytes to string using UTF8Encoding without BOM
- Replace version in string
- Convert back to bytes and write
- This completely avoids PowerShell's Get-Content BOM handling
* chore: Simplify release workflow - remove MSI build, minimal release notes
- Remove MSI build steps (has persistent BOM/encoding issues)
- Remove WiX Toolset installation
- Simplify release notes to bare minimum
- Focus on ZIP and EXE artifacts only
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Addresses tw93's PR #305 feedback:
- Add 'mo' short alias (mo.cmd) alongside mole.cmd
- Use 'mo' in all help text and documentation
- Document lowercase flag style (--dry-run, --help, etc.)
- Simplify optimize: repairs run automatically, no extra flags
- Fix RepairsApplied counter bug in optimize.ps1
- Update README with standardized examples
Per tw93's feedback on PR #305, consolidate repair utilities into
the optimize command to keep the CLI simple and unified.
Changes:
- Add repair flags to optimize: -Repair, -Font, -Icon, -Search, -Store
- Remove standalone repair.ps1 command
- Update mole.ps1 menu and help to reflect changes
- optimize now handles both optimization and repair tasks
Usage:
mole optimize # Standard optimizations
mole optimize -Repair # Optimizations + all repairs
mole optimize -Icon -Font # Optimizations + specific repairs
- Add Clear-GameMediaFiles function to clean old game media (>90d by default)
- Supports NVIDIA ShadowPlay/Highlights, AMD ReLive, Xbox Game Bar
- Supports Steam screenshots, OBS recordings, Medal.tv, Overwolf/Outplayed
- Includes game-specific replays (Fortnite, LoL, Valorant, Rocket League, etc.)
- New -GameMedia flag for mole clean command
- Uses age-based cleanup to protect recent recordings
Add new 'mole repair' command with the following utilities:
- DNS cache flush (Repair-DnsCache)
- Font cache rebuild (Repair-FontCache) - requires admin
- Icon cache rebuild (Repair-IconCache) - restarts Explorer
- Windows Search index reset (Repair-SearchIndex) - requires admin
- Windows Store cache reset (Repair-StoreCache) - runs wsreset.exe
Features:
- Interactive menu when run without arguments
- Command-line flags: -DNS, -Font, -Icon, -Search, -Store, -All
- Dry-run mode support
- Proper service stop/start for font and search repairs
Usage:
mole repair # Interactive menu
mole repair -DNS # Flush DNS only
mole repair -All # Run all repairs
Add Clear-GPUShaderCaches function to clean GPU shader caches:
- NVIDIA: DXCache, GLCache, NV_Cache
- AMD: DXCache, GLCache, VkCache
- Intel: ShaderCache
- DirectX: D3DSCache, DirectX Shader Cache
- Vulkan: VulkanCache (pipeline cache)
These caches can grow to 10GB+ and are safe to delete.
They will be rebuilt automatically when needed.
Integrated into main clean.ps1 workflow.
- Implemented progress percentage display (e.g., `(45%)`) in `cmd/analyze` to show scanning status based on cached total files.
- Kept the UI clean by avoiding a full progress bar.
- fix: formatting improvements in `bin/touchid.sh`.
- Use temporary files (*.new) during installation process
- Perform atomic 'mv -f' operation to replace binaries
- Prevent partial updates if process is interrupted/fails
- Fixes critical issue where failed update deleted existing app
- Add classify_cleanup_risk() for risk level classification (LOW/MEDIUM/HIGH)
- Enhance safe_clean() with operation details and risk info
- Show item counts and file lists in debug mode
- Support for lib/clean/user.sh debug enhancements
- Part of GitHub issue #242 implementation
This commit introduces a new `completion` command that provides shell
completion for bash, zsh, and fish.
The completion is implemented as a shell script in `bin/completion.sh`
and the main `mole` script has been updated to use it.
This approach was chosen to keep the completion logic in shell script,
as the `mole` command is primarily a set of shell scripts.
- Refactor safe_clean to decouple deletion logic from size calculation
- Attempt deletion for all existing paths, even if size is 0 or unknown
- Correctly count failures only for files that existed but couldn't be removed
- Skip destructive operations (killall, launchctl unload, sudo) in dry-run mode
- Add opt_msg() helper for consistent output formatting
- Refactor opt_system_services_refresh() with service array
- Show appropriate summary for dry-run vs actual execution
- Skip sudo session prompt in dry-run mode
- Add lib/manage/purge_paths.sh for interactive path management
- Shows current paths status and opens editor for customization
- Update bin/purge.sh to handle --paths option
- Update README with new command
- Remove duplicate comment in project.sh
- Fix color code issue in purge.sh help message
- Add proper spacing after load_purge_config function
- Add shell syntax highlighting in README code block
- Add Xcode Archives to whitelist options (fixes#195)