Fix Windows Service installation issues (#294) - #299
Conversation
This commit resolves the Windows Service autostart issue reported in #294 by fixing the build script and providing proper installation tools. ## Changes: ### Build Script Fixes: - Fixed typo in build.cake: `./extra/` → `./extras/` - Added .bat files to service package distribution - Scripts now properly included in service release zips ### New Installation Files: - Added `install-papercut-service.bat` - Windows batch wrapper for easy installation - Added `uninstall-papercut-service.bat` - Windows batch wrapper for uninstallation - Renamed `uninstall-papercut.service.ps1` → `uninstall-papercut-service.ps1` for consistency ### Documentation Updates: - Updated main README.md with clear step-by-step service installation instructions - Updated src/Papercut.Service/Readme.md with detailed installation options - Documented both PowerShell and batch file installation methods - Clarified automatic startup configuration ### Configuration: - Updated GitVersion.yml to increment patch version instead of minor version ## Service Installation: The service now includes installation scripts that: - Configure automatic startup on Windows boot - Validate prerequisites before installation - Provide clear error messages and feedback - Support both PowerShell and Command Prompt users Closes #294 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughAdds GitVersion branch increment settings, updates build to copy scripts from extras and include .bat files, introduces install/uninstall Windows .bat wrappers for PowerShell service scripts, and significantly expands documentation with step-by-step service installation/uninstallation guidance in README files. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant BAT as install-papercut-service.bat
participant PS as PowerShell (install-papercut-service.ps1)
participant SCM as Windows SCM
User->>BAT: Run as Administrator
BAT->>BAT: Locate PS1 in same directory
alt PS1 found
BAT->>PS: Start with -ExecutionPolicy Bypass
PS->>SCM: Create/Configure service
PS->>SCM: Start service (if applicable)
SCM-->>PS: Status/Result
PS-->>BAT: Exit code
BAT-->>User: Success or error message
else Missing PS1
BAT-->>User: Error: script not found
end
sequenceDiagram
autonumber
actor User
participant BAT as uninstall-papercut-service.bat
participant PS as PowerShell (uninstall-papercut-service.ps1)
participant SCM as Windows SCM
User->>BAT: Run as Administrator
BAT->>BAT: Verify PS1 exists
alt PS1 found
BAT->>PS: Execute uninstall
PS->>SCM: Stop & delete service
SCM-->>PS: Result
PS-->>BAT: Exit code
BAT-->>User: Uninstall complete or error
else Missing PS1
BAT-->>User: Error: script not found
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2024-10-25T16:50:04.096ZApplied to files:
🪛 markdownlint-cli2 (0.18.1)src/Papercut.Service/Readme.md9-9: Images should have alternate text (alt text) (MD045, no-alt-text) 15-15: Heading levels should only increment by one level at a time (MD001, heading-increment) 23-23: Heading levels should only increment by one level at a time (MD001, heading-increment) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (18)
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. Comment |
Summary
Resolves #294 - Windows Service autostart issues caused by missing installation scripts in service packages.
Problem
The service release packages were missing installation scripts due to a typo in the build script (
extra/vsextras/). Additionally, the documentation referenced a.batfile that didn't exist, and there was no clear guidance for users who needed to install the service with automatic startup.Changes
🔧 Build Script Fixes
build.cake:./extra/*.ps1→./extras/*.ps1./extras/*.batto package distribution📝 New Installation Files
uninstall-papercut.service.ps1→uninstall-papercut-service.ps1for consistency📚 Documentation Updates
README.mdwith clear step-by-step service installation instructionssrc/Papercut.Service/Readme.mdwith detailed installation options⚙️ Configuration
GitVersion.ymlto increment patch version instead of minor versionService Installation Features
The installation scripts now:
start= auto)Papercut.Service.exeexists before installingTesting
BuildAndPackServiceWin64taskextras/folderTest Plan
install-papercut-service.batuninstall-papercut-service.batto verify uninstallationCloses #294
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Summary by CodeRabbit
New Features
Documentation
Chores