@@ -56,6 +56,33 @@ impl PotentialPython {
5656 if let Some ( result) = get_package_display_name_and_location ( & name, hkcu) {
5757 let env_path = norm_case ( PathBuf :: from ( result. env_path ) ) ;
5858
59+ // Build the base symlinks list
60+ // parent = WindowsApps folder (e.g., C:\Users\...\AppData\Local\Microsoft\WindowsApps)
61+ // path = Package folder inside WindowsApps (e.g., WindowsApps\PythonSoftwareFoundation.Python.3.12_...)
62+ // env_path = Program Files location (e.g., C:\Program Files\WindowsApps\PythonSoftwareFoundation...)
63+ let mut symlinks = vec ! [
64+ // Symlinks in the user WindowsApps folder
65+ parent. join( format!( "python{}.exe" , self . version) ) ,
66+ parent. join( "python3.exe" ) ,
67+ parent. join( "python.exe" ) ,
68+ // Symlinks in the package subfolder under user WindowsApps
69+ path. join( "python.exe" ) ,
70+ path. join( "python3.exe" ) ,
71+ path. join( format!( "python{}.exe" , self . version) ) ,
72+ // Symlinks in Program Files
73+ env_path. join( "python.exe" ) ,
74+ env_path. join( "python3.exe" ) ,
75+ env_path. join( format!( "python{}.exe" , self . version) ) ,
76+ ] ;
77+
78+ // Add symlinks discovered by find_symlinks (includes python.exe and python3.exe
79+ // from WindowsApps when there's only one Python version installed)
80+ for symlink in & self . symlinks {
81+ if !symlinks. contains ( symlink) {
82+ symlinks. push ( symlink. clone ( ) ) ;
83+ }
84+ }
85+
5986 Some (
6087 PythonEnvironmentBuilder :: new ( Some (
6188 pet_core:: python_environment:: PythonEnvironmentKind :: WindowsStore ,
@@ -70,14 +97,7 @@ impl PotentialPython {
7097 } )
7198 // We only have the partial version, no point returning bogus info.
7299 // .version(Some(self.version.clone()))
73- . symlinks ( Some ( vec ! [
74- parent. join( format!( "python{}.exe" , self . version) ) ,
75- path. join( "python.exe" ) ,
76- path. join( "python3.exe" ) ,
77- path. join( format!( "python{}.exe" , self . version) ) ,
78- env_path. join( "python.exe" ) ,
79- env_path. join( format!( "python{}.exe" , self . version) ) ,
80- ] ) )
100+ . symlinks ( Some ( symlinks) )
81101 . build ( ) ,
82102 )
83103 } else {
0 commit comments