@@ -241,17 +241,17 @@ class PythonNET_InstallData(install_data):
241
241
242
242
def run (self ):
243
243
build_cmd = self .get_finalized_command ("build_ext" )
244
- install_lib_cmd = self .get_finalized_command ("install_lib " )
245
- build_dir = os .path .abspath (build_cmd .build_lib )
246
- install_dir = os .path .abspath ( install_lib_cmd .install_dir )
244
+ install_cmd = self .get_finalized_command ("install " )
245
+ build_lib = os .path .abspath (build_cmd .build_lib )
246
+ install_platlib = os .path .relpath ( install_cmd . install_platlib , self .install_dir )
247
247
248
248
for i , data_files in enumerate (self .data_files ):
249
249
if isinstance (data_files , str ):
250
- self .data_files [i ] = data_files [i ].replace ( "BUILD_DIR" , build_dir )
250
+ self .data_files [i ] = data_files [i ].format ( build_lib = build_lib )
251
251
else :
252
252
for j , filename in enumerate (data_files [1 ]):
253
- data_files [1 ][j ] = filename .replace ( "BUILD_DIR" , build_dir )
254
- dest = data_files [0 ].replace ( "INSTALL_DIR" , install_dir )
253
+ data_files [1 ][j ] = filename .format ( build_lib = build_lib )
254
+ dest = data_files [0 ].format ( install_platlib = install_platlib )
255
255
self .data_files [i ] = dest , data_files [1 ]
256
256
257
257
return install_data .run (self )
@@ -324,7 +324,7 @@ def _check_output(*popenargs, **kwargs):
324
324
Extension ("clr" , sources = sources )
325
325
],
326
326
data_files = [
327
- ("INSTALL_DIR " , ["BUILD_DIR /Python.Runtime.dll" ]),
327
+ ("{install_platlib} " , ["{build_lib} /Python.Runtime.dll" ]),
328
328
],
329
329
scripts = [_npython_exe ],
330
330
zip_safe = False ,
0 commit comments