Windows Platform¶
windows
¶
Windows-specific platform implementation.
Handles NTFS junctions, registry operations, admin privilege checks, and Python detection on Windows systems.
WindowsPlatform
¶
Bases: Platform
Windows platform implementation.
create_link(source, target, log=None)
¶
Create an NTFS junction (directory link).
This replaces the PowerShell: cmd /c mklink /J "source" "target"
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Path
|
The junction path to create (inside ComfyUI). |
required |
target
|
Path
|
The target directory (external folder). |
required |
log
|
InstallerLogger | None
|
Optional logger instance. |
None
|
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If junction creation fails. |
Source code in src/platform/windows.py
is_admin()
¶
Check if running with Administrator privileges.
enable_long_paths(log=None)
¶
Enable Windows long path support via registry.
Sets HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled = 1.
Returns:
| Type | Description |
|---|---|
bool
|
True if enabled or already enabled, False on failure. |
Source code in src/platform/windows.py
detect_python(version='3.13', log=None)
¶
Detect a specific Python version on Windows.
Checks: py launcher (-3.13), python in PATH, common install paths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version
|
str
|
The version to look for (e.g. "3.13"). |
'3.13'
|
log
|
InstallerLogger | None
|
Optional logger instance. |
None
|
Returns:
| Type | Description |
|---|---|
Path | None
|
Path to python.exe, or None. |