Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py2app packaged app in Applications folder fails #1564

Open
sardination opened this issue Jan 5, 2025 · 1 comment
Open

py2app packaged app in Applications folder fails #1564

sardination opened this issue Jan 5, 2025 · 1 comment

Comments

@sardination
Copy link
Contributor

sardination commented Jan 5, 2025

Specification

  • pywebview version: 4.0+
  • operating system: MacOS
  • web renderer:

Description

When I package an app using py2app and the source is an html file path instead of a url, the app does not load the HTML when in the Applications folder. It works normally everywhere else. I've traced this issue back to version 4.0, as it works fine before that. For what it's worth, I know that my paths are all correct (and - as I mentioned earlier - it works in versions before 4.0).

It could possibly be a permissions problem, but I'm not sure. It only seems to happen when I try to use the server, even with ssl=True set. If I stick with file:// to avoid using the Bottle server, there are no issues.

You can test out the issue as follows:
Change examples/py2app_setup.py to have the following line:

DATA_FILES = tree('stuff')

where stuff is a folder with your index.html.

Change examples/simple_browser.py to use the file instead of a URL:

window = webview.create_window('Simple browser', '../Resources/stuff/index.html')

When you run python py2app_setup.py py2app, the packaged app will work in your dist folder and other locations like Documents or Desktop, but the moment you drag the app to Applications, it will no longer load your HTML.

Practicalities

  • NO I am willing to work on this issue myself.

  • NO I am prepared to support this issue financially.

@r0x0r
Copy link
Owner

r0x0r commented Jan 8, 2025

I could not reproduce this with examples/js_api.py and the following setup.py

from setuptools import setup

APP = ['examples/http_server.py']
DATA_FILES = ['examples/assets']
OPTIONS = {
}


setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)

However, that made me realize that pywebview lacked support for frozen py2app resources. As well as referencing ../Resources/ is rather awkward. I have added py2app support in the latest master commit, so it should work now just by pointing to the actual entrypoint same as in dev mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants