wails/v3/pkg
Lea Anthony 3f29158dfa ## Summary
I have successfully implemented the "Start At Login" feature for Wails v3, addressing all the major concerns raised in PR #3910. Here's what was accomplished:

###  **Core Implementation**

1. **Added StartAtLogin option** to `application.Options` struct
2. **Implemented platform-specific methods** for all three platforms:
   - **macOS**: Uses AppleScript with proper escaping to prevent injection attacks
   - **Windows**: Uses Windows Registry with restrictive permissions
   - **Linux**: Uses XDG autostart specification with .desktop files

3. **Added public API methods**:
   - `SetStartAtLogin(enabled bool) error` - Enable/disable start at login
   - `StartsAtLogin() (bool, error)` - Check current status

###  **Security Improvements** (addressing PR comments)

1. **Path validation and sanitization** across all platforms
2. **AppleScript injection protection** on macOS with proper escaping
3. **Registry permissions** restricted to necessary access on Windows  
4. **Executable path validation** with symlink resolution
5. **Input sanitization** for application names and paths

###  **Error Handling & Documentation**

1. **Comprehensive error handling** with descriptive error messages
2. **Complete API documentation** with platform-specific behavior notes
3. **macOS Info.plist requirement** documented (NSAppleEventsUsageDescription)
4. **Cross-platform compatibility** notes and troubleshooting

###  **Example & Testing**

1. **Working example application** demonstrating usage
2. **Comprehensive README** with platform-specific requirements
3. **Runtime toggling capability** implemented
4. **Compilation verified** - the implementation builds successfully

### 🔧 **Technical Details**

- **macOS**: Uses Bundle information and AppleScript with security hardening
- **Windows**: Uses HKEY_CURRENT_USER registry with KEY_SET_VALUE/KEY_QUERY_VALUE permissions
- **Linux**: Creates XDG-compliant .desktop files in ~/.config/autostart/

### 📋 **Key Features**

-  Cross-platform support (macOS, Windows, Linux)
-  Runtime configuration via public API
-  Application startup configuration via Options
-  Security hardening against injection attacks
-  Proper error handling and validation
-  Complete documentation and examples

The implementation is now ready for testing and can be integrated into Wails v3. All major security concerns from the original PR have been addressed, and the feature includes proper documentation for developers.
2025-08-04 20:58:31 +10:00
..
application ## Summary 2025-08-04 20:58:31 +10:00
events Merge remote-tracking branch 'wails/v3-alpha' into v3/deeplink 2025-07-15 08:54:46 -06:00
icons [v3 windows] Small icon updates 2023-06-10 10:19:33 +10:00
mac [v3] Add start_at_login plugin 2023-04-05 21:22:02 +10:00
services [v3] bugfix/windows linux notifications (#4450) 2025-07-30 12:40:58 +00:00
w32 feature: V3 alpha feature/snapassist support (#4463) 2025-08-02 16:59:49 +10:00