@@ -48,7 +48,7 @@ def make_wxs(product_name: str, version: str) -> None:
4848 wix_dir = osp .abspath (osp .dirname (__file__ ))
4949 proj_dir = osp .abspath (osp .join (wix_dir , os .pardir ))
5050 dist_dir = osp .join (proj_dir , "dist" , product_name )
51- archive_path = osp .join (proj_dir , "dist" , f"{ product_name } -files.zip " )
51+ archive_path = osp .join (proj_dir , "dist" , f"{ product_name } -files.7z " )
5252 wxs_path = osp .join (wix_dir , f"generic-{ product_name } .wxs" )
5353 output_path = osp .join (wix_dir , f"{ product_name } -{ version } .wxs" )
5454
@@ -62,12 +62,24 @@ def make_wxs(product_name: str, version: str) -> None:
6262 # Get archive size for statistics
6363 archive_size_mb = osp .getsize (archive_path ) / (1024 * 1024 )
6464
65+ # Calculate actual installed size (extracted files) in KB for ARPSIZE
66+ total_size_bytes = 0
67+ for root , dirs , files in os .walk (dist_dir ):
68+ for filename in files :
69+ filepath = osp .join (root , filename )
70+ if osp .exists (filepath ):
71+ total_size_bytes += osp .getsize (filepath )
72+ installed_size_kb = int (total_size_bytes / 1024 )
73+
6574 # Count files in dist directory for statistics
6675 total_files = sum (len (files ) for _ , _ , files in os .walk (dist_dir ))
6776
6877 print ("Archive-based installer mode:" )
6978 print (f" Archive: { osp .basename (archive_path )} " )
7079 print (f" Archive size: { archive_size_mb :.1f} MB" )
80+ print (
81+ f" Installed size: { installed_size_kb / 1024 :.1f} MB ({ installed_size_kb } KB)"
82+ )
7183 print (f" Total files archived: { total_files } " )
7284 print (" Components in MSI: ~15 (executables + archive + cleanup)" )
7385
@@ -77,7 +89,8 @@ def make_wxs(product_name: str, version: str) -> None:
7789
7890 # Replace version placeholder
7991 wxs = wxs .replace ("{version}" , version )
80- wxs = wxs .replace ("{archive_path}" , f"dist\\ { product_name } -files.zip" )
92+ wxs = wxs .replace ("{archive_path}" , f"dist\\ { product_name } -files.7z" )
93+ wxs = wxs .replace ("{installed_size}" , str (installed_size_kb ))
8194
8295 with open (output_path , "w" , encoding = "utf-8" ) as fd :
8396 fd .write (wxs )
0 commit comments