1
0

42 Commits

Author SHA1 Message Date
2741969164 refactor(assoc): improve error handling and type safety
- Remove unused `Infallible` import
- Add `ParseProgIdKindError` for better ProgId parsing error handling
- Implement `BlankProgId` variant for empty ProgId strings
- Add `ExtKey::new` and `ProgIdKey::new` constructors
- Add `as_inner` methods to `ExtKey` and `ProgIdKey`
- Replace `to_string()` calls with `as_inner().to_string()`
- Update error type from `BlankStringError` to `BlankPathError`
- Rename `BlankStringError` to `BlankPathError` with updated message
- Update `blank_path_guard` return type and error handling
- Remove `Display` and `FromStr` implementations from `ExtKey` and `ProgIdKey`
2025-11-01 16:11:22 +08:00
3694a6a82a feat(windows): add blank path guard for registry operations
- Add BlankStringError to handle empty registry paths
- Implement blank_path_guard function to prevent dangerous registry operations
- Apply blank path guard to extension and ProgId key operations
- Update error handling to include BlankPath error variant
2025-10-29 10:53:29 +08:00
a3456e9fdd feat(windows): implement registry manipulation for file associations
- Add comprehensive error types for registry operations
- Implement ProgIdKind enum with Display and FromStr traits
- Create ApplicationVisitor and ClassesVisitor structs
- Add ExtKey methods for linking, unlinking and querying ProgId
- Implement ProgIdKey creation and deletion in registry
- Add safe delete function to prevent accidental registry cleanup
- Introduce Display and FromStr implementations for ExtKey and ProgIdKey
- Organize registry access through scoped and viewed key opening
- Enable setting default "Open With" verbs for file extensions
- Support both user and system level registry modifications
2025-10-29 10:31:00 +08:00
3f1a070b65 refactor(wfassoc): restructure association module for registry operations
- Removed unused regex and uuid dependencies
- Replaced custom Ext and ProgId implementations with windows-specific types
- Added Scope and View enums for registry access control
- Introduced ExtKey and ProgIdKey structs for registry key handling
- Added error types for better error handling
- Implemented stub methods for registry operations
- Restructured module organization for better clarity
- Added utility functions for privilege checking
2025-10-28 14:10:28 +08:00
4d679588f8 feat(wfassoc): enhance CLSID handling and parsing
- Add `getrandom` dependency for UUID v4 feature
- Enable UUID v4 feature in `Cargo.toml`
- Implement `Clsid::with_random()` for generating random CLSIDs
- Improve `Clsid::new()` to accept `&Uuid` directly
- Update `Clsid::from_str()` to use `uuid::fmt::Braced` for stricter parsing
- Add comprehensive tests for valid and invalid CLSID strings
- Fix minor typo in test assertion code
- Enhance documentation comments for CLSID struct and error type
2025-10-28 12:50:15 +08:00
1342799303 feat(windows): implement file extension and ProgId parsing structs
- Add Ext struct for handling file extensions with validation
- Implement ProgId struct following Microsoft's suggested format
- Create Clsid struct for handling CLSID with UUID parsing
- Add ExpandString struct for environment variable expansion
- Include comprehensive tests for new structs and parsing logic
- Remove duplicate ExpandString implementation from windows.rs
- Organize code regions for better readability and maintenance
2025-10-28 11:12:13 +08:00
6be27def80 refactor(windows): update Windows API calls and error handling
- Replace `Default::default()` with `std::ptr::null_mut()` or `std::ptr::null()` for FFI calls
- Change `WideCStr::from_ptr` to `WideStr::from_ptr` for better safety
- Remove redundant error variants in `LoadStrRcError` and `ExpandEnvVarError`
- Reorder imports for better readability
- Add test cases for `StrRc` and `ExpandString` utilities
- Improve documentation comments for icon loading functions
2025-10-27 20:49:04 +08:00
81fd224236 feat(windows): implement icon and string resource loading
- Add IconRc struct for loading icons from executable or .ico files
- Implement LoadIconRcError for icon loading error handling
- Add StrRc struct for loading string resources from files
- Implement LoadStrRcError for string loading error handling
- Remove old Icon struct and related error types
- Update tests to use new resource loading implementations
- Add Windows Resource section with proper documentation
- Include Win32_System_LibraryLoader feature in Cargo.toml
2025-10-27 14:09:51 +08:00
cc79951ee6 refactor(windows): improve resource string parsing and documentation
- Rename structs to be more descriptive (IconRefStr, StrRefStr)
- Add comprehensive documentation for all public items
- Simplify error handling in FromStr implementations
- Add getter methods for path and index fields
2025-10-26 22:16:48 +08:00
23d0a79c0b feat(windows): add resource reference string parsers
Add IconRc and StrRc structs for parsing Windows resource reference strings.
Implement FromStr and Display traits for both types along with error handling.
Rename BadExpandStrError to ParseExpandStrError for consistency.
2025-10-24 10:34:07 +08:00
e908e775ed refactor(tests): restructure windows commandline tests for better readability
- Extract test helpers into nested functions to reduce duplication
- Rename test functions to be more descriptive
- Group related test cases together
2025-10-23 21:48:48 +08:00
217d3d5fd3 fix(windows): improve backslash handling in command lexer
Handle multiple backslashes before quotes correctly by counting them and applying Windows command line parsing rules. Even number of backslashes before quote are treated as escape sequences, odd number as literal quotes.
2025-10-22 20:27:40 +08:00
563ab483fc test(windows): add tests for Windows command line argument parsing
Add comprehensive test cases for Windows command line argument parsing, including edge cases with quotes and backslashes. Tests cover both single argument and multiple argument scenarios.
2025-10-22 16:51:57 +08:00
ffd58ff677 feat(windows): add command line argument parsing utilities
Implement CmdLexer, CmdArg and CmdArgs for proper Windows command line argument parsing and quoting. Add itertools dependency for string joining functionality.
2025-10-22 12:11:42 +08:00
84a29c862b feat(windows): add ExpandString for environment variable expansion
Implement ExpandString struct to handle Windows environment variable expansion
with proper error handling. Also reorganize windows-sys dependencies and improve
icon loading error messages.
2025-10-20 14:41:50 +08:00
26d867d42f refactor(winreg): reorganize Windows registry utilities into extra module
Move winreg_extra functionality into new extra/winreg module and restructure project layout
Add Windows icon handling utilities in extra/windows module
Update dependencies and clean up unused wincmd module
2025-10-20 13:38:41 +08:00
d493285900 feat(cli): implement register and unregister commands with scope support
- Add Target enum to handle user/system scope selection
- Move scope argument from global CLI to register/unregister subcommands
- Implement actual registration logic including ProgId subkey creation
- Update Program::new to accept string path instead of Path
- Add proper error handling and success messages
2025-10-19 17:37:51 +08:00
f42c50ce10 feat(wfassoc): add query_ext method and improve CLI output
- Implement query_ext method to check default program associations
- Enhance CLI query command with tabular output showing associations
- Refactor program building into Composition struct for better organization
- Update documentation comments for clarity
2025-10-19 15:12:15 +08:00
d5fed1e580 feat(registry): add privilege check and improve ProgId handling
- Add WFHasPrivilege function to check user privileges
- Refactor ProgId structure to use standard format with optional version
- Improve registry operations with safer key/value handling
- Update dependencies to include Win32_System_Registry
2025-10-19 14:10:21 +08:00
f37b4b6652 feat(registry): implement file extension linking in Windows registry
- Add `link_ext` and `unlink_ext` methods to Program for managing file associations
- Introduce new error variants for invalid tokens
- Add utility function `capitalize_first_ascii` for ProgId generation
- Implement registry key operations for user and system scopes
2025-10-19 12:10:55 +08:00
4f0f9670cb feat: add Windows-specific modules and enhance program registration
- Add new modules for Windows command line handling (wincmd) and registry extensions (winreg_extra)
- Replace Manner struct with simple String and add identifier validation
- Update WFAdd function signature and add new WFStartup/WFShutdown functions
- Implement ExpandString wrapper for registry operations
2025-10-18 23:11:33 +08:00
6e9f91d0e6 feat: add error handling and thread-local last error tracking for wfassoc-dylib
Implement error handling with custom Error enum and thread-local storage
for tracking last error message to improve FFI interoperability.
2025-10-18 18:17:05 +08:00
bcd0d503d4 write shit 2025-10-18 09:55:08 +08:00
bdb6b4ceee write shit 2025-10-17 14:19:26 +08:00
dab91f1581 split into individual modules 2025-10-16 15:13:38 +08:00
4b1f85c2f3 update README 2025-10-15 13:22:53 +08:00
eee91d8498 write ext shit 2025-10-15 13:15:29 +08:00
c4b825f7f6 refactor wfassoc 2025-10-13 22:07:42 +08:00
034e9017be write shit 2025-10-13 15:50:48 +08:00
07a8c6a11d write shit 2025-10-10 20:54:44 +08:00
f7d92243c9 add decl for ProgId 2025-10-10 14:23:01 +08:00
3f23d6b549 write shit 2025-10-09 16:07:23 +08:00
2c8cb26ebf write shit 2025-10-09 15:32:22 +08:00
682be6ab58 add privilege checker 2025-10-09 13:53:31 +08:00
03a1796e07 write shit 2025-10-05 18:04:20 +08:00
f3c7f0905e write rust shit 2025-10-04 22:21:55 +08:00
e06fcdf53b refactor: migrate project from C++ to Rust
- establish basic Rust project layout.
- move all old code into independent directory.
2025-10-04 22:04:30 +08:00
d6c4c7687b upload files which idk when i write 2025-09-13 15:48:51 +08:00
3ab26925e0 add some utils funcs 2022-05-15 17:09:21 +08:00
357201d6c9 add install code WITHOUT safety check! 2022-02-28 14:40:27 +08:00
86864bbd09 add progId generator and example 2022-02-18 14:53:49 +08:00
b93e5eaf5d first commit 2022-02-01 10:54:27 +08:00