wails/v3/examples
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
..
badge [v3] improve service names for js/ts bindings (#4405) 2025-07-25 09:23:22 +10:00
badge-custom [v3] improve service names for js/ts bindings (#4405) 2025-07-25 09:23:22 +10:00
binding Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
build Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
cancel-async Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
cancel-chaining Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
clipboard Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
contextmenus Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
custom-protocol-example fix custom protocol example to new api 2025-07-12 19:13:13 -06:00
dev Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
dialogs Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
dialogs-basic Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
drag-n-drop Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
environment Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
events Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
events-bug Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
file-association Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
frameless window.ToggleFrameless() api (#4317) 2025-07-15 22:53:21 +10:00
gin-example Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
gin-routing Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
gin-service Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
hide-window Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
html-dnd-api Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
ignore-mouse Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
keybindings Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
menu Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
notifications [v3] improve service names for js/ts bindings (#4405) 2025-07-25 09:23:22 +10:00
panic-handling Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
plain Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
raw-message Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
screen Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
services Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
show-macos-toolbar Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
single-instance Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
start-at-login ## Summary 2025-08-04 20:58:31 +10:00
systray-basic Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
systray-custom Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
systray-menu Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
video Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
window feature: V3 alpha feature/snapassist support (#4463) 2025-08-02 16:59:49 +10:00
window-api Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
window-call Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
window-menu Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
wml Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
linux_status.org add linux status for examples 2023-11-06 10:49:14 -06:00
README.md Improve documentation 2023-12-13 22:40:35 +11:00

v3

NOTE: The examples in this directory may or may not compile / run at any given time during alpha development.

Running the examples

cd v3/examples/<example>
go mod tidy
go run .

Compiling the examples

cd v3/examples/<example>
go mod tidy
go build
./<example>