@@ -145,17 +145,38 @@ def mainw_exe(name):
145145 )
146146
147147
148- def launcher_exe (name , platform , windowed = False ):
148+ def launcher_exe (name , platform ):
149149 return CProject (name ,
150150 VersionInfo (
151- FileDescription = "Python launcher" + ( " (windowed)" if windowed else "" ) ,
151+ FileDescription = "Python launcher" ,
152152 OriginalFilename = f"{ name } .exe"
153153 ),
154154 CPP_SETTINGS ,
155155 Property ('StaticLibcppLinkage' , 'true' ),
156- ItemDefinition ('Link' , SubSystem = 'WINDOWS' if windowed else ' CONSOLE' ),
156+ ItemDefinition ('Link' , SubSystem = 'CONSOLE' ),
157157 Manifest ('default.manifest' ),
158- ResourceFile ('pywicon.rc' if windowed else 'pyicon.rc' ),
158+ ResourceFile ('pyicon.rc' ),
159+ CSourceFile ('launcher.cpp' ),
160+ CSourceFile ('_launch.cpp' ),
161+ IncludeFile ('*.h' ),
162+ source = 'src/pymanager' ,
163+ ConfigurationType = 'Application' ,
164+ Platform = platform ,
165+ )
166+
167+
168+ def launcherw_exe (name , platform ):
169+ return CProject (name ,
170+ VersionInfo (
171+ FileDescription = "Python launcher (windowed)" ,
172+ OriginalFilename = f"{ name } .exe"
173+ ),
174+ CPP_SETTINGS ,
175+ ItemDefinition ('ClCompile' , PreprocessorDefinitions = Prepend ("PY_WINDOWED=1;" )),
176+ Property ('StaticLibcppLinkage' , 'true' ),
177+ ItemDefinition ('Link' , SubSystem = 'WINDOWS' ),
178+ Manifest ('default.manifest' ),
179+ ResourceFile ('pywicon.rc' ),
159180 CSourceFile ('launcher.cpp' ),
160181 CSourceFile ('_launch.cpp' ),
161182 IncludeFile ('*.h' ),
@@ -213,12 +234,12 @@ def pyshellext(ext='.exe', **props):
213234 Package (
214235 'templates' ,
215236 File ('src/pymanager/templates/template.py' ),
216- launcher_exe ("launcher-64" , "x64" , windowed = False ),
217- launcher_exe ("launcherw-64" , "x64" , windowed = True ),
218- launcher_exe ("launcher-arm64" , "ARM64" , windowed = False ),
219- launcher_exe ("launcherw-arm64" , "ARM64" , windowed = True ),
220- launcher_exe ("launcher-32" , "Win32" , windowed = False ),
221- launcher_exe ("launcherw-32" , "Win32" , windowed = True ),
237+ launcher_exe ("launcher-64" , "x64" ),
238+ launcherw_exe ("launcherw-64" , "x64" ),
239+ launcher_exe ("launcher-arm64" , "ARM64" ),
240+ launcherw_exe ("launcherw-arm64" , "ARM64" ),
241+ launcher_exe ("launcher-32" , "Win32" ),
242+ launcherw_exe ("launcherw-32" , "Win32" ),
222243 ),
223244
224245 # Directory for MSIX resources
0 commit comments