Fix WindowsBuilder executable path and enhance MSI linking error reporting
- Updated the path to the built executable to reflect changes in the output structure. - Added calculation and display of total distribution size after build. - Enhanced error reporting for the MSI linking process by capturing and printing stdout and stderr output. - Updated WiX source file to include UI namespace for better compatibility. - Removed unnecessary blank line in test_msi.py for cleaner code.
This commit is contained in:
parent
2b12ee2aef
commit
37b772166c
6 changed files with 2895 additions and 2877 deletions
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
|
||||
xmlns:ui="http://schemas.microsoft.com/wix/2010/ui">
|
||||
<Product Id="*" Name="WebDrop Bridge" Language="1033" Version="0.5.0"
|
||||
Manufacturer="HIM-Tools"
|
||||
UpgradeCode="12345678-1234-1234-1234-123456789012">
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
|
|
@ -130,14 +130,19 @@ class WindowsBuilder:
|
|||
print("❌ PyInstaller build failed")
|
||||
return False
|
||||
|
||||
exe_path = self.dist_dir / "WebDropBridge.exe"
|
||||
# Check if executable exists (now in WebDropBridge/WebDropBridge.exe due to COLLECT)
|
||||
exe_path = self.dist_dir / "WebDropBridge" / "WebDropBridge.exe"
|
||||
if not exe_path.exists():
|
||||
print(f"❌ Executable not found at {exe_path}")
|
||||
return False
|
||||
|
||||
print("✅ Executable built successfully")
|
||||
print(f"📦 Output: {exe_path}")
|
||||
print(f" Size: {exe_path.stat().st_size / 1024 / 1024:.1f} MB")
|
||||
|
||||
# Calculate total dist size
|
||||
total_size = sum(f.stat().st_size for f in self.dist_dir.glob("WebDropBridge/**/*") if f.is_file())
|
||||
if total_size > 0:
|
||||
print(f" Total size: {total_size / 1024 / 1024:.1f} MB")
|
||||
|
||||
# Generate SHA256 checksum
|
||||
self.generate_checksum(exe_path)
|
||||
|
|
@ -259,9 +264,13 @@ class WindowsBuilder:
|
|||
light_cmd.append(str(wix_files_obj))
|
||||
|
||||
print(f" Linking MSI installer...")
|
||||
result = subprocess.run(light_cmd, text=True)
|
||||
result = subprocess.run(light_cmd, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
if result.returncode != 0:
|
||||
print("❌ MSI linking failed")
|
||||
if result.stdout:
|
||||
print(f" Output: {result.stdout[:500]}")
|
||||
if result.stderr:
|
||||
print(f" Error: {result.stderr[:500]}")
|
||||
return False
|
||||
|
||||
if not msi_output.exists():
|
||||
|
|
@ -277,7 +286,8 @@ class WindowsBuilder:
|
|||
def _create_wix_source(self) -> bool:
|
||||
"""Create WiX source file for MSI generation."""
|
||||
wix_content = f'''<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
|
||||
xmlns:ui="http://schemas.microsoft.com/wix/2010/ui">
|
||||
<Product Id="*" Name="WebDrop Bridge" Language="1033" Version="{self.version}"
|
||||
Manufacturer="HIM-Tools"
|
||||
UpgradeCode="12345678-1234-1234-1234-123456789012">
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ sys.path.insert(0, str(Path(__file__).parent / "build" / "scripts"))
|
|||
|
||||
from build_windows import WindowsBuilder
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
builder = WindowsBuilder()
|
||||
print("Creating MSI installer...")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue