diff --git a/build/scripts/build_windows.py b/build/scripts/build_windows.py index 87df6e9..b0cdbba 100644 --- a/build/scripts/build_windows.py +++ b/build/scripts/build_windows.py @@ -123,13 +123,21 @@ class WindowsBuilder: """ 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") candle_exe = shutil.which("candle.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]): - 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(" Or use: choco install wixtoolset") return False @@ -142,9 +150,10 @@ class WindowsBuilder: wix_obj = self.build_dir / "WebDropBridge.wixobj" msi_output = self.dist_dir / f"WebDropBridge-{self.version}-Setup.msi" - # Run candle (compiler) + # Run candle (compiler) - pass preprocessor variables candle_cmd = [ str(candle_exe), + f"-dDistDir={self.dist_dir}", "-o", str(wix_obj), str(self.build_dir / "WebDropBridge.wxs"),