@@ -107,6 +107,7 @@ def main_exe(name):
107107 ConfigurationType = 'Application' ,
108108 )
109109
110+
110111def mainw_exe (name ):
111112 return CProject (name ,
112113 VersionInfo (FileDescription = "Python Install Manager (windowed)" ),
@@ -127,6 +128,26 @@ def mainw_exe(name):
127128 )
128129
129130
131+ def launcher_exe (name , platform , windowed = False ):
132+ return CProject (name ,
133+ VersionInfo (
134+ FileDescription = "Python launcher" + (" (windowed)" if windowed else "" ),
135+ OriginalFilename = f"{ name } .exe"
136+ ),
137+ CPP_SETTINGS ,
138+ Property ('StaticLibcppLinkage' , 'true' ),
139+ ItemDefinition ('Link' , SubSystem = 'WINDOWS' if windowed else 'CONSOLE' ),
140+ Manifest ('default.manifest' ),
141+ ResourceFile ('pywicon.rc' if windowed else 'pyicon.rc' ),
142+ CSourceFile ('launcher.cpp' ),
143+ CSourceFile ('_launch.cpp' ),
144+ IncludeFile ('*.h' ),
145+ source = 'src/pymanager' ,
146+ ConfigurationType = 'Application' ,
147+ Platform = platform ,
148+ )
149+
150+
130151PACKAGE = Package ('python-manager' ,
131152 PyprojectTomlFile ('pyproject.toml' ),
132153 # MSIX manifest
@@ -150,32 +171,12 @@ def mainw_exe(name):
150171 Package (
151172 'templates' ,
152173 File ('src/pymanager/templates/template.py' ),
153- CProject ('launcher' ,
154- VersionInfo (FileDescription = "Python launcher" , OriginalFilename = "launcher.exe" ),
155- CPP_SETTINGS ,
156- Property ('StaticLibcppLinkage' , 'true' ),
157- ItemDefinition ('Link' , SubSystem = 'CONSOLE' ),
158- Manifest ('default.manifest' ),
159- ResourceFile ('pyicon.rc' ),
160- CSourceFile ('launcher.cpp' ),
161- CSourceFile ('_launch.cpp' ),
162- IncludeFile ('*.h' ),
163- source = 'src/pymanager' ,
164- ConfigurationType = 'Application' ,
165- ),
166- CProject ('launcherw' ,
167- VersionInfo (FileDescription = "Python launcher (windowed)" , OriginalFilename = "launcherw.exe" ),
168- CPP_SETTINGS ,
169- Property ('StaticLibcppLinkage' , 'true' ),
170- ItemDefinition ('Link' , SubSystem = 'WINDOWS' ),
171- Manifest ('default.manifest' ),
172- ResourceFile ('pywicon.rc' ),
173- CSourceFile ('launcher.cpp' ),
174- CSourceFile ('_launch.cpp' ),
175- IncludeFile ('*.h' ),
176- source = 'src/pymanager' ,
177- ConfigurationType = 'Application' ,
178- ),
174+ launcher_exe ("launcher-64" , "x64" , windowed = False ),
175+ launcher_exe ("launcherw-64" , "x64" , windowed = True ),
176+ launcher_exe ("launcher-arm64" , "ARM64" , windowed = False ),
177+ launcher_exe ("launcherw-arm64" , "ARM64" , windowed = True ),
178+ launcher_exe ("launcher-32" , "Win32" , windowed = False ),
179+ launcher_exe ("launcherw-32" , "Win32" , windowed = True ),
179180 ),
180181
181182 # Directory for MSIX resources
0 commit comments