feat: Add WiX MSI installer creation with fallback to default installation path

This commit is contained in:
claudi 2026-01-28 15:48:46 +01:00
parent 634eed8996
commit 0f9fd4c730

View file

@ -123,13 +123,21 @@ class WindowsBuilder:
""" """
print("\n📦 Creating MSI installer with WiX...") print("\n📦 Creating MSI installer with WiX...")
# Check if WiX is installed # Check if WiX is installed (try PATH first, then default location)
heat_exe = shutil.which("heat.exe") heat_exe = shutil.which("heat.exe")
candle_exe = shutil.which("candle.exe") candle_exe = shutil.which("candle.exe")
light_exe = shutil.which("light.exe") light_exe = shutil.which("light.exe")
# Fallback to default WiX installation location
if not candle_exe:
default_wix = Path("C:\\Program Files (x86)\\WiX Toolset v3.14\\bin")
if default_wix.exists():
heat_exe = str(default_wix / "heat.exe")
candle_exe = str(default_wix / "candle.exe")
light_exe = str(default_wix / "light.exe")
if not all([heat_exe, candle_exe, light_exe]): if not all([heat_exe, candle_exe, light_exe]):
print("⚠️ WiX Toolset not found in PATH") print("⚠️ WiX Toolset not found in PATH or default location")
print(" Install from: https://wixtoolset.org/releases/") print(" Install from: https://wixtoolset.org/releases/")
print(" Or use: choco install wixtoolset") print(" Or use: choco install wixtoolset")
return False return False
@ -142,9 +150,10 @@ class WindowsBuilder:
wix_obj = self.build_dir / "WebDropBridge.wixobj" wix_obj = self.build_dir / "WebDropBridge.wixobj"
msi_output = self.dist_dir / f"WebDropBridge-{self.version}-Setup.msi" msi_output = self.dist_dir / f"WebDropBridge-{self.version}-Setup.msi"
# Run candle (compiler) # Run candle (compiler) - pass preprocessor variables
candle_cmd = [ candle_cmd = [
str(candle_exe), str(candle_exe),
f"-dDistDir={self.dist_dir}",
"-o", "-o",
str(wix_obj), str(wix_obj),
str(self.build_dir / "WebDropBridge.wxs"), str(self.build_dir / "WebDropBridge.wxs"),