beeware / briefcase

Tools to support converting a Python project into a standalone native application.
https://briefcase.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
2.66k stars 372 forks source link

error LGHT0103 : The system cannot find the file '.wixobj' with type 'Source' #1319

Open wagner-cardoso opened 1 year ago

wagner-cardoso commented 1 year ago

Describe the bug

I am doing the tutorial e when I am going to make a package with command: "briefcase package", occurs this:

[temperature] Building MSI...
Compiling application manifest...
'C:\Users\fisic\AppData\Local\BeeWare\briefcase\Cache\tools\wix\heat.exe' dir src -nologo -gg -sfrag -sreg -srd -scom -dr temperature_ROOTDIR -cg temperature_COMPONENTS -var var.SourceDir -out temperature-manifest.wxs
Return code: 0 Compiling... done

Compiling application installer.. 'C:\Users\fisic\AppData\Local\BeeWare\briefcase\Cache\tools\wix\candle.exe' -nologo -ext WixUtilExtension -ext WixUIExtension -arch x64 -dSourceDir=src temperature.wxs temperature-manifest.wxs
Return code: 0 Compiling... done

Linking application installer... 'C:\Users\fisic\AppData\Local\BeeWare\briefcase\Cache\tools\wix\light.exe' -nologo -ext WixUtilExtension -ext WixUIExtension -loc unicode.wxl -o 'C:\git\python\treino\beeware-tutorial\temperature\dist\Temperature-0.0.1.msi' temperature.wixobj temperature-manifest.wixobj

C:\git\python\treino\beeware-tutorial\temperature\build\temperature\windows\app
light.exe : error LGHT0103 : The system cannot find the file 'temperature.wixobj' with type 'Source'. Return code: 103 Linking...
Unable to link app temperature.

The problem is the files temperature.wixobj and temperature-manifest-wixobj dont are created by candle.exe

Steps to reproduce

1 - Create a application with briefacas new 2 - Run briefacase create 3 - Run briefcase build 4 - Run briefcase package (the problem occurs here!)

Expected behavior

I want to generate a .MSI installer

Screenshots

No response

Environment

OS Release: Windows 10 OS Version: 10.0.22621 Architecture: AMD64 Platform: Windows-10-10.0.22621-SP0

Python exe: C:\git\python\treino\beeware-tutorial\venv\Scripts\python.exe Python version: 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] Virtual env: True Conda env: False

Briefcase: 0.3.14 Target platform: windows Target format: app

Toga: 0.3.1

Logs

Additional context

No response

freakboy3742 commented 1 year ago

Thanks for the report. It's a little unclear what is going on here; you say you're "following the tutorial", and the virtual environment seems to suggest you're using the suggested environment name - but your application is named "temperature". Can you provided details on what is going on here? Did you just make the choice to name your tutorial "temperature" instead of "Hello World"? Or is there something else going on?

The error message suggests that something went wrong when compiling the WiX installer, and one of the intermediate products from the build process cannot be found. Can you list the contents of build\temperature\windows\app and tell us what you find?

Can we also ask that you provide the complete log file that Briefcase generated when it crashed? You've provided parts of a log, but it's not clear which parts you've redacted.

wagner-cardoso commented 1 year ago

Yes, I followed the tutorial, I just changed the application name and nothing else. See the source:

"""
Conversor de temperatura
"""
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW

class Temperature(toga.App):

    def startup(self):
        """
        Construct and show the Toga application.

        Usually, you would add your application to a main content box.
        We then create a main window (with a name matching the app), and
        show the main window.
        """
        main_box = toga.Box()

        self.main_window = toga.MainWindow(title=self.formal_name)
        self.main_window.content = main_box
        self.main_window.show()

def main():
    return Temperature()
freakboy3742 commented 1 year ago

Ok - what about the other details I asked for?

wagner-cardoso commented 1 year ago

The complete log is here:

Full log ``` Date/Time: 2023-06-12 02:58:06 Command line: C:\git\python\treino\beeware-tutorial\venv\Scripts\briefcase package OS Release: Windows 10 OS Version: 10.0.22621 Architecture: AMD64 Platform: Windows-10-10.0.22621-SP0 Python exe: C:\git\python\treino\beeware-tutorial\venv\Scripts\python.exe Python version: 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] Virtual env: True Conda env: False Briefcase: 0.3.14 Target platform: windows Target format: app Environment Variables: ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\fisic\AppData\Roaming COMMONPROGRAMFILES=C:\Program Files\Common Files COMMONPROGRAMFILES(X86)=C:\Program Files (x86)\Common Files COMMONPROGRAMW6432=C:\Program Files\Common Files COMPUTERNAME=DESKTOP-AV0M277 COMSPEC=C:\WINDOWS\system32\cmd.exe DRIVERDATA=C:\Windows\System32\Drivers\DriverData EFC_8488=1 HOMEDRIVE=C: HOMEPATH=\Users\fisic IDEA_INITIAL_DIRECTORY=C:\Users\fisic\OneDrive\Área de Trabalho INTEL_DEV_REDIST=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\ LOCALAPPDATA=C:\Users\fisic\AppData\Local LOGONSERVER=\\DESKTOP-AV0M277 MIC_LD_LIBRARY_PATH=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\intel64_win_mic NUMBER_OF_PROCESSORS=12 ONEDRIVE=C:\Users\fisic\OneDrive ONEDRIVECONSUMER=C:\Users\fisic\OneDrive OS=Windows_NT PATH=C:\git\python\treino\beeware-tutorial\venv/Scripts;C:\Program Files (x86)\Embarcadero\Studio\22.0\bin;C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl;C:\Program Files (x86)\Embarcadero\Studio\22.0\bin64;C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\Win64;C:\Program Files\AdoptOpenJDK\jdk-8.0.242.08-hotspot\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Embarcadero\Studio\21.0\bin;C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl;C:\Program Files (x86)\Embarcadero\Studio\21.0\bin64;C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl\Win64;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Program Files\Python310\Scripts\;C:\Program Files\Python310\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\MiKTeX\miktex\bin\x64\;C:\Program Files\PostgreSQL\14\bin;C:\Program Files\Calibre2\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\nodejs\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\lazarus;C:\lazarus\fpc\3.2.2\bin\x86_64-win64;C:\Users\fisic\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\PyCharm Community Edition 2022.1.1\bin;C:\Users\fisic\AppData\Roaming\npm;C:\flutter\bin;C:\Users\fisic\AppData\Local\JetBrains\Toolbox\scripts;C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\platform-tools;;C:\Users\fisic\AppData\Local\Microsoft\WindowsApps;C:\Users\fisic\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\PyCharm Community Edition 2022.1.1\bin;C:\Users\fisic\AppData\Roaming\npm;C:\flutter\bin;C:\Users\fisic\AppData\Local\JetBrains\Toolbox\scripts;C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\platform-tools;;C:\Users\fisic\AppData\Local\Microsoft\WindowsApps;.\modules\.bin;C:\Users\fisic\.boss\modules\.bin;C:\Users\fisic\.boss\env\bpl;C:\Users\fisic\.boss\env\dcu;C:\Users\fisic\.boss\env\dcp;C:\Users\fisic\.dotnet\tools PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 165 Stepping 2, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=a502 PROGRAMDATA=C:\ProgramData PROGRAMFILES=C:\Program Files PROGRAMFILES(X86)=C:\Program Files (x86) PROGRAMW6432=C:\Program Files PSMODULEPATH=C:\Users\fisic\OneDrive\Documentos\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules PUBLIC=C:\Users\Public PYCHARM COMMUNITY EDITION=C:\Program Files\JetBrains\PyCharm Community Edition 2022.1.1\bin; SESSIONNAME=Console SYSTEMDRIVE=C: SYSTEMROOT=C:\WINDOWS TEMP=C:\Users\fisic\AppData\Local\Temp TERMINAL_EMULATOR=JetBrains-JediTerm TERM_SESSION_ID=dd4931c0-8e60-483b-9dda-67f472492fbe TMP=C:\Users\fisic\AppData\Local\Temp USERDOMAIN=DESKTOP-AV0M277 USERDOMAIN_ROAMINGPROFILE=DESKTOP-AV0M277 USERNAME=fisic USERPROFILE=C:\Users\fisic VIRTUAL_ENV=C:\git\python\treino\beeware-tutorial\venv WINDIR=C:\WINDOWS ZES_ENABLE_SYSMAN=1 __INTELLIJ_COMMAND_HISTFILE__=C:\Users\fisic\AppData\Local\JetBrains\PyCharmCE2022.1\terminal\history\beeware-tutorial-history Briefcase Log: [02:58:05] __init__.py:278 [temperature] Building MSI... __init__.py:278 Compiling application manifest... __init__.py:280 subprocess.py:675 >>> Running Command: subprocess.py:676 >>> 'C:\Users\fisic\AppData\Local\BeeWare\briefcase\Cache\tools\wix\heat.exe' dir src -nologo -gg -sfrag -sreg -srd -scom -dr temperature_ROOTDIR subprocess.py:677 -cg temperature_COMPONENTS -var var.SourceDir -out temperature-manifest.wxs >>> Working Directory: subprocess.py:684 >>> C:\git\python\treino\beeware-tutorial\temperature\build\temperature\windows\app subprocess.py:685 [02:58:06] >>> Return code: 0 subprocess.py:712 Compiling... done __init__.py:281 Compiling application installer... __init__.py:311 subprocess.py:675 >>> Running Command: subprocess.py:676 >>> 'C:\Users\fisic\AppData\Local\BeeWare\briefcase\Cache\tools\wix\candle.exe' -nologo -ext WixUtilExtension -ext WixUIExtension -arch x64 subprocess.py:677 -dSourceDir=src temperature.wxs temperature-manifest.wxs >>> Working Directory: subprocess.py:684 >>> C:\git\python\treino\beeware-tutorial\temperature\build\temperature\windows\app subprocess.py:685 >>> Return code: 0 subprocess.py:712 Compiling... done __init__.py:312 Linking application installer... __init__.py:334 subprocess.py:675 >>> Running Command: subprocess.py:676 >>> 'C:\Users\fisic\AppData\Local\BeeWare\briefcase\Cache\tools\wix\light.exe' -nologo -ext WixUtilExtension -ext WixUIExtension -loc unicode.wxl subprocess.py:677 -o 'C:\git\python\treino\beeware-tutorial\temperature\dist\Temperature-0.0.1.msi' temperature.wixobj temperature-manifest.wixobj >>> Working Directory: subprocess.py:684 >>> C:\git\python\treino\beeware-tutorial\temperature\build\temperature\windows\app subprocess.py:685 light.exe : error LGHT0103 : The system cannot find the file 'temperature.wixobj' with type 'Source'. subprocess.py:649 >>> Return code: 103 subprocess.py:712 Linking... __init__.py:335 __main__.py:40 Unable to link app temperature. __main__.py:41 Main thread traceback: ╭─────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────╮ │ C:\git\python\treino\beeware-tutorial\venv\lib\site-packages\briefcase\platforms\windows\__init__.py:336 in package_app │ │ │ │ 333 │ │ try: │ │ 334 │ │ │ self.logger.info("Linking application installer...") │ │ 335 │ │ │ with self.input.wait_bar("Linking..."): │ │ ❱ 336 │ │ │ │ self.tools.subprocess.run( │ │ 337 │ │ │ │ │ [ │ │ 338 │ │ │ │ │ │ self.tools.wix.light_exe, │ │ 339 │ │ │ │ │ │ "-nologo", # Don't display startup text │ │ │ │ ╭────────────────────────────────────────────────── locals ───────────────────────────────────────────────────╮ │ │ │ app = │ │ │ │ cert_store = 'My' │ │ │ │ file_digest = 'sha256' │ │ │ │ identity = None │ │ │ │ kwargs = {'adhoc_sign': False} │ │ │ │ self = │ │ │ │ sign_app = False │ │ │ │ timestamp_digest = 'sha256' │ │ │ │ timestamp_url = 'http://timestamp.digicert.com' │ │ │ │ use_local_machine = False │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ C:\git\python\treino\beeware-tutorial\venv\lib\site-packages\briefcase\integrations\subprocess.py:133 in inner │ │ │ │ 130 │ │ │ with sub.tools.input.release_console_control(): │ │ 131 │ │ │ │ return sub_method(sub, args, **kwargs) │ │ 132 │ │ else: │ │ ❱ 133 │ │ │ return sub_method(sub, args, **kwargs) │ │ 134 │ │ │ 135 │ return inner │ │ 136 │ │ │ │ ╭───────────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────────╮ │ │ │ args = [ │ │ │ │ │ WindowsPath('C:/Users/fisic/AppData/Local/BeeWare/briefcase/Cache/tools/wix/light.exe'), │ │ │ │ │ '-nologo', │ │ │ │ │ '-ext', │ │ │ │ │ 'WixUtilExtension', │ │ │ │ │ '-ext', │ │ │ │ │ 'WixUIExtension', │ │ │ │ │ '-loc', │ │ │ │ │ 'unicode.wxl', │ │ │ │ │ '-o', │ │ │ │ │ WindowsPath('C:/git/python/treino/beeware-tutorial/temperature/dist/Temperature-0.0.1.msi'), │ │ │ │ │ ... +2 │ │ │ │ ] │ │ │ │ executable = 'C:\\Users\\fisic\\AppData\\Local\\BeeWare\\briefcase\\Cache\\tools\\wix\\light.exe' │ │ │ │ kwargs = {'check': True, 'cwd': WindowsPath('C:/git/python/treino/beeware-tutorial/temperature/build/temperature/windows/app')} │ │ │ │ remove_dynamic_elements = False │ │ │ │ sub = │ │ │ │ sub_method = │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ C:\git\python\treino\beeware-tutorial\venv\lib\site-packages\briefcase\integrations\subprocess.py:392 in run │ │ │ │ 389 │ │ # caller sets stream_output=False, then ensure_console_is_safe() will │ │ 390 │ │ # disable any dynamic console elements while the command runs. │ │ 391 │ │ if stream_output: │ │ ❱ 392 │ │ │ return self._run_and_stream_output(args, **kwargs) │ │ 393 │ │ │ │ 394 │ │ # Otherwise, invoke run() normally. │ │ 395 │ │ self._log_command(args) │ │ │ │ ╭──────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────╮ │ │ │ args = [ │ │ │ │ │ WindowsPath('C:/Users/fisic/AppData/Local/BeeWare/briefcase/Cache/tools/wix/light.exe'), │ │ │ │ │ '-nologo', │ │ │ │ │ '-ext', │ │ │ │ │ 'WixUtilExtension', │ │ │ │ │ '-ext', │ │ │ │ │ 'WixUIExtension', │ │ │ │ │ '-loc', │ │ │ │ │ 'unicode.wxl', │ │ │ │ │ '-o', │ │ │ │ │ WindowsPath('C:/git/python/treino/beeware-tutorial/temperature/dist/Temperature-0.0.1.msi'), │ │ │ │ │ ... +2 │ │ │ │ ] │ │ │ │ kwargs = {'check': True, 'cwd': WindowsPath('C:/git/python/treino/beeware-tutorial/temperature/build/temperature/windows/app')} │ │ │ │ self = │ │ │ │ stream_output = True │ │ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ C:\git\python\treino\beeware-tutorial\venv\lib\site-packages\briefcase\integrations\subprocess.py:458 in _run_and_stream_output │ │ │ │ 455 │ │ self._log_return_code(return_code) │ │ 456 │ │ │ │ 457 │ │ if check and return_code: │ │ ❱ 458 │ │ │ raise subprocess.CalledProcessError(return_code, args, stderr=stderr) │ │ 459 │ │ │ │ 460 │ │ return subprocess.CompletedProcess(args, return_code, stderr=stderr) │ │ 461 │ │ │ │ ╭──────────────────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────────────────╮ │ │ │ args = [ │ │ │ │ │ WindowsPath('C:/Users/fisic/AppData/Local/BeeWare/briefcase/Cache/tools/wix/light.exe'), │ │ │ │ │ '-nologo', │ │ │ │ │ '-ext', │ │ │ │ │ 'WixUtilExtension', │ │ │ │ │ '-ext', │ │ │ │ │ 'WixUIExtension', │ │ │ │ │ '-loc', │ │ │ │ │ 'unicode.wxl', │ │ │ │ │ '-o', │ │ │ │ │ WindowsPath('C:/git/python/treino/beeware-tutorial/temperature/dist/Temperature-0.0.1.msi'), │ │ │ │ │ ... +2 │ │ │ │ ] │ │ │ │ check = True │ │ │ │ kwargs = {'cwd': WindowsPath('C:/git/python/treino/beeware-tutorial/temperature/build/temperature/windows/app'), 'stdout': -1, 'stderr': -2, 'bufsize': 1} │ │ │ │ process = │ │ │ │ return_code = 103 │ │ │ │ self = │ │ │ │ stderr = None │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ CalledProcessError: Command '[WindowsPath('C:/Users/fisic/AppData/Local/BeeWare/briefcase/Cache/tools/wix/light.exe'), '-nologo', '-ext', 'WixUtilExtension', '-ext', 'WixUIExtension', '-loc', 'unicode.wxl', '-o', WindowsPath('C:/git/python/treino/beeware-tutorial/temperature/dist/Temperature-0.0.1.msi'), 'temperature.wixobj', 'temperature-manifest.wixobj']' returned non-zero exit status 103. The above exception was the direct cause of the following exception: ╭─────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────╮ │ C:\git\python\treino\beeware-tutorial\venv\lib\site-packages\briefcase\__main__.py:25 in main │ │ │ │ 22 │ │ command = Command(logger=logger, console=console) │ │ 23 │ │ options = command.parse_options(extra=extra_cmdline) │ │ 24 │ │ command.parse_config(Path.cwd() / "pyproject.toml") │ │ ❱ 25 │ │ command(**options) │ │ 26 │ except HelpText as e: │ │ 27 │ │ logger.info() │ │ 28 │ │ logger.info(str(e)) │ │ │ │ ╭──────────────────────────────────────────────── locals ─────────────────────────────────────────────────╮ │ │ │ command = │ │ │ │ Command = │ │ │ │ console = │ │ │ │ e = BriefcaseCommandError('Unable to link app temperature.') │ │ │ │ extra_cmdline = [] │ │ │ │ logger = │ │ │ │ options = { │ │ │ │ │ 'update': False, │ │ │ │ │ 'packaging_format': 'msi', │ │ │ │ │ 'sign_app': True, │ │ │ │ │ 'adhoc_sign': False, │ │ │ │ │ 'identity': None, │ │ │ │ │ 'file_digest': 'sha256', │ │ │ │ │ 'use_local_machine': False, │ │ │ │ │ 'cert_store': 'My', │ │ │ │ │ 'timestamp_url': 'http://timestamp.digicert.com', │ │ │ │ │ 'timestamp_digest': 'sha256' │ │ │ │ } │ │ │ │ result = 200 │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ C:\git\python\treino\beeware-tutorial\venv\lib\site-packages\briefcase\commands\package.py:151 in __call__ │ │ │ │ 148 │ │ else: │ │ 149 │ │ │ state = None │ │ 150 │ │ │ for app_name, app in sorted(self.apps.items()): │ │ ❱ 151 │ │ │ │ state = self._package_app( │ │ 152 │ │ │ │ │ app, update=update, **full_options(state, options) │ │ 153 │ │ │ │ ) │ │ 154 │ │ │ │ ╭────────────────────────────────────────────── locals ──────────────────────────────────────────────╮ │ │ │ app = │ │ │ │ app_name = 'temperature' │ │ │ │ options = { │ │ │ │ │ 'packaging_format': 'msi', │ │ │ │ │ 'sign_app': True, │ │ │ │ │ 'adhoc_sign': False, │ │ │ │ │ 'identity': None, │ │ │ │ │ 'file_digest': 'sha256', │ │ │ │ │ 'use_local_machine': False, │ │ │ │ │ 'cert_store': 'My', │ │ │ │ │ 'timestamp_url': 'http://timestamp.digicert.com', │ │ │ │ │ 'timestamp_digest': 'sha256' │ │ │ │ } │ │ │ │ self = │ │ │ │ state = None │ │ │ │ update = False │ │ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ C:\git\python\treino\beeware-tutorial\venv\lib\site-packages\briefcase\commands\package.py:96 in _package_app │ │ │ │ 93 │ │ │ self.dist_path.mkdir(exist_ok=True) │ │ 94 │ │ │ │ 95 │ │ # Package the app │ │ ❱ 96 │ │ state = self.package_app(app, **full_options(state, options)) │ │ 97 │ │ │ │ 98 │ │ filename = self.distribution_path(app).relative_to(self.base_path) │ │ 99 │ │ self.logger.info(f"Packaged {filename}", prefix=app.app_name) │ │ │ │ ╭─────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────╮ │ │ │ app = │ │ │ │ binary_file = WindowsPath('C:/git/python/treino/beeware-tutorial/temperature/build/temperature/windows/app/src/Temperature.exe') │ │ │ │ options = { │ │ │ │ │ 'sign_app': True, │ │ │ │ │ 'adhoc_sign': False, │ │ │ │ │ 'identity': None, │ │ │ │ │ 'file_digest': 'sha256', │ │ │ │ │ 'use_local_machine': False, │ │ │ │ │ 'cert_store': 'My', │ │ │ │ │ 'timestamp_url': 'http://timestamp.digicert.com', │ │ │ │ │ 'timestamp_digest': 'sha256' │ │ │ │ } │ │ │ │ packaging_format = 'msi' │ │ │ │ self = │ │ │ │ state = None │ │ │ │ template_file = WindowsPath('C:/git/python/treino/beeware-tutorial/temperature/build/temperature/windows/app') │ │ │ │ update = False │ │ │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ C:\git\python\treino\beeware-tutorial\venv\lib\site-packages\briefcase\platforms\windows\__init__.py:355 in package_app │ │ │ │ 352 │ │ │ │ │ cwd=self.bundle_path(app), │ │ 353 │ │ │ │ ) │ │ 354 │ │ except subprocess.CalledProcessError as e: │ │ ❱ 355 │ │ │ raise BriefcaseCommandError(f"Unable to link app {app.app_name}.") from e │ │ 356 │ │ │ │ 357 │ │ if sign_app: │ │ 358 │ │ │ self.logger.info("Signing MSI...", prefix=app.app_name) │ │ │ │ ╭────────────────────────────────────────────────── locals ───────────────────────────────────────────────────╮ │ │ │ app = │ │ │ │ cert_store = 'My' │ │ │ │ file_digest = 'sha256' │ │ │ │ identity = None │ │ │ │ kwargs = {'adhoc_sign': False} │ │ │ │ self = │ │ │ │ sign_app = False │ │ │ │ timestamp_digest = 'sha256' │ │ │ │ timestamp_url = 'http://timestamp.digicert.com' │ │ │ │ use_local_machine = False │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ BriefcaseCommandError: Unable to link app temperature. ```
freakboy3742 commented 1 year ago

We're now at 2 of 3 of the things I asked for - what about the third?

(Also - you can attach files to Github comments, which is probably a better way to handle really long logs)

wagner-cardoso commented 1 year ago

OK,

1 - I just changed the application name and nothing else.

2 - list the contents of build\temperature\windows\app is in the attached image file files_wix

3 - The log file is attached too briefcase.2023_06_12-02_58_06.package.log

Thanks.

wagner-cardoso commented 1 year ago

See the line in the log file:\tools\wix\light.exe

...tools\wix\candle.exe' -nologo -ext WixUtilExtension -ext WixUIExtension -arch x64 -dSourceDir=src temperature.wxs temperature-manifest.wxs

When it compiles, doesn't created the objects: temperature.wixobj and temperature-manifest.wixobj

When the ..tools\wix\light.exe starts the files .wixobj dont are exists!!

Thanks.

freakboy3742 commented 1 year ago

This is very confusing - I can't see any reason why this would be happening. candle is running, and isn't generating an error - but it also isn't generating any output.

The best suggestion I have at this point is to try and reproduce what Briefcase is doing outside Briefcase, and see if you get any more errors or warnings that aren't being captured by Briefcase's logs for some reason.

wagner-cardoso commented 1 year ago

I started the tutorial over from scratch with the name "helloword".

I downloaded and installed wix 3.11 from https://wixtoolset.org website, added the path in the environment variables. I executed the candle.exe manually and the files helloworld.wixobj and helloworld-manifest.wixobj were generated.

See the attached images.

wix_v311

candle_after_instalation

freakboy3742 commented 1 year ago

If you delete those .wixobj file and repackage with briefcase, do you get the original error? If you don't, that suggests there's something different in your "start from scratch" version of the project - any differences (other than the name of the project itself) could be critical.

If you delete the wix folder from C:\Users\<your username>\AppData\Local\BeeWare\briefcase\tools, delete the .wixobj files and repackage with briefcase, do you get the original error? If this fixes the problem, it sounds like the download of WiX was corrupted somehow; downloading it again has fixed the problem.

If neither of those fixes the problem, it would be good to know the exact version of WiX that Briefcase has downloaded. Could you run the version of candle in the AppData...Briefcase folder and let us know the version?

wagner-cardoso commented 1 year ago

Exactly! After I removed the ...\tools\wix folder, the problem was resolved.

Note: it was resolved because I had installed the WiX Toolset from website, and in this case the briefcase no longer needed to download ...\tools\wix

Thank you for your help

wagner-cardoso commented 1 year ago

Now, the "briefcase package" calls the path correct of Wix: wix_toolset

Thank you very much, now I will continue my studies with Beeware...

freakboy3742 commented 1 year ago

Great! In which case, I'll close this ticket.

fabiormr commented 1 year ago

I have the same problem, I deleted the wix folder and it didn't solve it.

fabiormr commented 1 year ago

[finances] Building MSI... Compiling application manifest... Compiling... done Compiling application installer...
Compiling... done Linking application installer...
light.exe : error LGHT0103 : The system cannot find the file 'finances.wixobj' with type 'Source'. Linking...

Unable to link app finances.

rmartin16 commented 1 year ago

@fabiormr, thanks for letting us know. However, we don't know the source of the problem; so, we need as much diagnostic information as possible to understand what may be going wrong.

As freakboy3742 requested of the OP, can you please provide: 1) the full Briefcase log file from running briefcase package after you delete the build directory in your project directory 2) The directory contents of build\finances\windows\app after the step above 3) The directory contents of C:\Users\<your username>\AppData\Local\BeeWare\briefcase\Cache\tools\wix may be useful as well

fabiormr commented 1 year ago

briefcase.2023_06_20-19_25_04.package.log

App build dir listing ![image](https://github.com/beeware/briefcase/assets/63806636/586fd28f-9602-462e-a856-653f5325d358)
App build src dir listing ![image](https://github.com/beeware/briefcase/assets/63806636/ff8f2ade-f768-4a42-8ba9-df111780be72) ![image](https://github.com/beeware/briefcase/assets/63806636/d448503c-a24c-46c4-87b8-69fa75c5f1c0)
WiX tool dir listing ![image](https://github.com/beeware/briefcase/assets/63806636/9e4783f2-e089-48fd-ae05-35e3f44a1005) ![image](https://github.com/beeware/briefcase/assets/63806636/ecfbd655-3f12-42fa-89b2-06ecec6fc0e2) ![image](https://github.com/beeware/briefcase/assets/63806636/b262bd22-b205-4ace-81be-e3b79b4d7c63)
fabiormr commented 1 year ago

My operating system is Windows 11 and not Windows 10 as was reported by the log.

rmartin16 commented 1 year ago

I'm not sure what exactly is going wrong. The first step by heat.exe is creating the manifest; however, candle.exe is not compiling the wxs files in to the intermediate wixobj files. So, light.exe fails when it cannot find them. I would expect some sort of feedback from candle.exe when it doesn't compile the wxs files it was explicitly passed as arguments.

I can't recreate this in my win 11 environment. I noticed you're not using a Python virtual environment but not using one didn't create the problem for me.

@fabiormr: If you're willing to assist in investigation, I'd be curious if installing WiX with their installer and setting the WIX environment variable to that installation file path so Briefcase uses it resolves the issue for you as well.

Additionally, though, I'm curious if running the candle.exe command with some of its additional parameters can help reveal the actual issue. There are several available parameters to potentially elevate warnings to errors or ones to make the output more verbose.

Windows Installer XML Toolset Compiler version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.

 usage:  candle.exe [-?] [-nologo] [-out outputFile] sourceFile [sourceFile ...] [@responseFile]

   -arch      set architecture defaults for package, components, etc.
              values: x86, x64, or ia64 (default: x86)
   -d<name>[=<value>]  define a parameter for the preprocessor
   -ext <extension>  extension assembly or "class, assembly"
   -fips      enables FIPS compliant algorithms
   -I<dir>    add to include search path
   -nologo    skip printing candle logo information
   -o[ut]     specify output file (default: write to current directory)
   -p<file>   preprocess to a file (or stdout if no file supplied)
   -pedantic  show pedantic messages
   -platform  (deprecated alias for -arch)
   -sfdvital  suppress marking files as Vital by default (deprecated)
   -ss        suppress schema validation of documents (performance boost) (deprecated)
   -sw[N]     suppress all warnings or a specific message ID
              (example: -sw1009 -sw1103)
   -swall     suppress all warnings (deprecated)
   -trace     show source trace for errors, warnings, and verbose messages (deprecated)
   -v         verbose output
   -wx[N]     treat all warnings or a specific message ID as an error
              (example: -wx1009 -wx1103)
   -wxall     treat all warnings as errors (deprecated)
   -? | -help this help information

The specific commands that Briefcase runs are in the log file. To run them in CMD, replace the single quotes with double quotes around the exe; to run in PowerShell, add an ampersand (i.e. &) followed by a space at the beginning of the entire command. Finally, you'll need to be in the build\finances\windows\app directory when running the commands.

fabiormr commented 1 year ago

@rmartin16 I created a PATH_HEAT environment variable and assigned the path inside \AppData\Local\BeeWare\briefcase\Cache\tools\wix\heat.exe and it worked.