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

fix: Run app.setAppPath() with the right path #78

Merged
merged 3 commits into from
Sep 6, 2023
Merged

Conversation

felixrieseberg
Copy link
Member

Electron will set the appPath by looking for package.json. When using this module, this will end up being inside app.asar.

The problem is that from point on forward, APIs like webContents.loadFile() will be using this app.asar as the application's root. webContents.loadFile('renderer/index.html') will no longer work, since that file won't be inside app.asar - it'll actually be inside app-x64.asar or app-arm64.asar.

Users can handle this problem in user land, but I assume that you need to know Electron pretty darn well. I propose that we fix this directly in the default asar. The same issue also exists with app folders, which this PR fixes, too.

@felixrieseberg felixrieseberg requested a review from a team as a code owner August 30, 2023 23:20
@felixrieseberg felixrieseberg changed the title Fix: Run app.setAppPath() with the right path fix: Run app.setAppPath() with the right path Aug 30, 2023
Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit, would like to see more use of semicolons even if these files aren't linted for some reason 😆

@dsanders11
Copy link
Member

even if these files aren't linted for some reason 😆

#79

@felixrieseberg
Copy link
Member Author

Added linting and testing to entry-asar (building off @dsanders11's PR)

@felixrieseberg felixrieseberg merged commit 9a808be into main Sep 6, 2023
3 checks passed
@felixrieseberg felixrieseberg deleted the felix-app-path branch September 6, 2023 15:52
@continuous-auth
Copy link

🎉 This PR is included in version 1.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@soroushm
Copy link
Contributor

soroushm commented Nov 2, 2023

we are getting an error on missing app #80 so i tried to add a pull request for it but we dont have even electron install in this package here is the #81 what do you think about it @felixrieseberg

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

Successfully merging this pull request may close these issues.

4 participants