44
55
66DLL_NAME = "python314"
7- EMBED_URL = "https://www.python.org/ftp/python/3.14.0/python-3.14.0a7 -embed-amd64.zip"
7+ EMBED_URL = "https://www.python.org/ftp/python/3.14.0/python-3.14.0b1 -embed-amd64.zip"
88
99def can_embed (tag ):
1010 """Return False if tag doesn't match DLL_NAME and EMBED_URL.
@@ -84,6 +84,9 @@ class ResourceFile(CSourceFile):
8484 CFunction ('date_as_str' ),
8585 CFunction ('datetime_as_str' ),
8686 CFunction ('reg_rename_key' ),
87+ CFunction ('get_current_package' ),
88+ CFunction ('read_alias_package' ),
89+ CFunction ('broadcast_settings_change' ),
8790 source = 'src/_native' ,
8891 RootNamespace = '_native' ,
8992)
@@ -107,6 +110,7 @@ def main_exe(name):
107110 ConfigurationType = 'Application' ,
108111 )
109112
113+
110114def mainw_exe (name ):
111115 return CProject (name ,
112116 VersionInfo (FileDescription = "Python Install Manager (windowed)" ),
@@ -127,11 +131,60 @@ def mainw_exe(name):
127131 )
128132
129133
134+ def launcher_exe (name , platform , windowed = False ):
135+ return CProject (name ,
136+ VersionInfo (
137+ FileDescription = "Python launcher" + (" (windowed)" if windowed else "" ),
138+ OriginalFilename = f"{ name } .exe"
139+ ),
140+ CPP_SETTINGS ,
141+ Property ('StaticLibcppLinkage' , 'true' ),
142+ ItemDefinition ('Link' , SubSystem = 'WINDOWS' if windowed else 'CONSOLE' ),
143+ Manifest ('default.manifest' ),
144+ ResourceFile ('pywicon.rc' if windowed else 'pyicon.rc' ),
145+ CSourceFile ('launcher.cpp' ),
146+ CSourceFile ('_launch.cpp' ),
147+ IncludeFile ('*.h' ),
148+ source = 'src/pymanager' ,
149+ ConfigurationType = 'Application' ,
150+ Platform = platform ,
151+ )
152+
153+
154+ def pyshellext (ext = '.exe' , ** props ):
155+ link_opts = ItemDefinition (
156+ 'Link' ,
157+ AdditionalDependencies = Prepend ('RuntimeObject.lib;' ),
158+ )
159+ if ext != '.exe' :
160+ link_opts .options ['ModuleDefinitionFile' ] = '$(SourceRootDir)src\\ pyshellext\\ pyshellext.def'
161+
162+
163+ return CProject (f"pyshellext{ ext .rpartition ('.' )[0 ]} " ,
164+ VersionInfo (
165+ FileDescription = 'Python shell extension' ,
166+ OriginalFilename = f'pyshellext{ ext } ' ,
167+ ),
168+ ItemDefinition ('ClCompile' , LanguageStandard = 'stdcpp20' ),
169+ link_opts ,
170+ Manifest ('default.manifest' ),
171+ CSourceFile ('shellext.cpp' ),
172+ ResourceFile ('pyshellext.rc' ),
173+ source = 'src/pyshellext' ,
174+ StaticLibcppLinkage = True ,
175+ ** props ,
176+ )
177+
178+
130179PACKAGE = Package ('python-manager' ,
131180 PyprojectTomlFile ('pyproject.toml' ),
132181 # MSIX manifest
133- File ('src/pymanager/appxmanifest.xml' , name = 'appxmanifest.xml' ),
134- File ('src/pymanager/pymanager.appinstaller' , name = 'pymanager.appinstaller' ),
182+ File ('src/pymanager/appxmanifest.xml' ),
183+ File ('src/pymanager/pymanager.appinstaller' ),
184+ Package (
185+ 'MSIX.AppInstaller.Data' ,
186+ File ('src/pymanager/MSIXAppInstallerData.xml' ),
187+ ),
135188
136189 # Default settings
137190 File ('src/pymanager.json' ),
@@ -146,34 +199,12 @@ def mainw_exe(name):
146199 Package (
147200 'templates' ,
148201 File ('src/pymanager/templates/template.py' ),
149- CProject ('launcher' ,
150- VersionInfo (FileDescription = "Python launcher" , OriginalFilename = "launcher.exe" ),
151- CPP_SETTINGS ,
152- Property ('DynamicLibcppLinkage' , 'true' ),
153- ItemDefinition ('ClCompile' , RuntimeLibrary = 'MultiThreaded' ),
154- ItemDefinition ('Link' , SubSystem = 'CONSOLE' ),
155- Manifest ('default.manifest' ),
156- ResourceFile ('pyicon.rc' ),
157- CSourceFile ('launcher.cpp' ),
158- CSourceFile ('_launch.cpp' ),
159- IncludeFile ('*.h' ),
160- source = 'src/pymanager' ,
161- ConfigurationType = 'Application' ,
162- ),
163- CProject ('launcherw' ,
164- VersionInfo (FileDescription = "Python launcher (windowed)" , OriginalFilename = "launcherw.exe" ),
165- CPP_SETTINGS ,
166- Property ('DynamicLibcppLinkage' , 'true' ),
167- ItemDefinition ('ClCompile' , RuntimeLibrary = 'MultiThreaded' ),
168- ItemDefinition ('Link' , SubSystem = 'WINDOWS' ),
169- Manifest ('default.manifest' ),
170- ResourceFile ('pywicon.rc' ),
171- CSourceFile ('launcher.cpp' ),
172- CSourceFile ('_launch.cpp' ),
173- IncludeFile ('*.h' ),
174- source = 'src/pymanager' ,
175- ConfigurationType = 'Application' ,
176- ),
202+ launcher_exe ("launcher-64" , "x64" , windowed = False ),
203+ launcher_exe ("launcherw-64" , "x64" , windowed = True ),
204+ launcher_exe ("launcher-arm64" , "ARM64" , windowed = False ),
205+ launcher_exe ("launcherw-arm64" , "ARM64" , windowed = True ),
206+ launcher_exe ("launcher-32" , "Win32" , windowed = False ),
207+ launcher_exe ("launcherw-32" , "Win32" , windowed = True ),
177208 ),
178209
179210 # Directory for MSIX resources
@@ -202,6 +233,10 @@ def mainw_exe(name):
202233 mainw_exe ("pythonw" ),
203234 main_exe ("python3" ),
204235 mainw_exe ("pythonw3" ),
236+
237+ pyshellext (".exe" , ConfigurationType = "Application" ),
238+ pyshellext ("-64.dll" , Platform = "x64" ),
239+ pyshellext ("-arm64.dll" , Platform = "ARM64" ),
205240)
206241
207242
@@ -215,6 +250,9 @@ def get_commands():
215250 # Check if a subclass of BaseCommand
216251 if not any (b .id in command_bases for b in cls .bases ):
217252 continue
253+ # Ignore exec command - it gets handled separately.
254+ if cls .name == "ExecCommand" :
255+ continue
218256 command_bases .add (cls .name )
219257 for a in filter (lambda s : isinstance (s , ast .Assign ), cls .body ):
220258 if not any (t .id == "CMD" for t in a .targets ):
@@ -300,6 +338,7 @@ def init_METADATA():
300338 fileversion = _make_xyzw_version (METADATA ["Version" ], "," )
301339 for vi in PACKAGE .findall ("**/VersionInfo" ):
302340 vi .from_metadata (METADATA )
341+ vi .options ["LegalCopyright" ] = "Copyright (c) Python Software Foundation. All Rights Reserved."
303342 vi .options ["FILEVERSION" ] = fileversion
304343
305344
0 commit comments