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

The itch sandbox prevents Superpowers v1.1 from loading its settings #843

Closed
elisee opened this issue Jul 29, 2016 · 9 comments
Closed

The itch sandbox prevents Superpowers v1.1 from loading its settings #843

elisee opened this issue Jul 29, 2016 · 9 comments
Labels
compatibility Can we make more games compatible with the app without them having to change anything? sandbox The itch.io sandbox windows Windows issues

Comments

@elisee
Copy link
Contributor

elisee commented Jul 29, 2016

After enabling the experimental itch sandbox, I get the following error message when starting Superpowers from itch:

image

The first part of the error message is buggy (now fixed) so don't worry about that, but basically Superpowers tries to access stuff in %APPDATA% for the current user and then fails because EPERM.

I'm not sure if there's something we can / should change in Superpowers, or if there's something to be done on itch's sandbox side.

Running itch v18.4.0, Windows 10 64-bit.

@fasterthanlime
Copy link
Collaborator

fasterthanlime commented Jul 30, 2016

Well, reading %APPDATA% is the wrong way to go about it, but the app should still allow for that. I'll take a look at what elevate does.

@fasterthanlime fasterthanlime added windows Windows issues compatibility Can we make more games compatible with the app without them having to change anything? sandbox The itch.io sandbox labels Jul 30, 2016
@elisee
Copy link
Contributor Author

elisee commented Jul 30, 2016

Well, reading %APPDATA% is the wrong way to go about it, but the app should still allow for that. I'll take a look at what elevate does.

What should we do instead?

@fasterthanlime
Copy link
Collaborator

What should we do instead?

I don't know if you actually meant using process.env.APPDATA — but windows has API calls like SHGetFolderPath which are exposed in Electron by app.getPath()

Normally, when launched via the sandbox, the environment is set up in such a way that this correctly returns the AppData/Roaming folder of the sandbox user itch-player, so if you're seeing C:\Users\elisee, something's going wrong somewhere :)

@fasterthanlime
Copy link
Collaborator

something's going wrong somewhere :)

See https://github.com/itchio/elevate/blob/master/src/elevate.c — elevate sets %USERPROFILE%, and that's enough for SHGetFolderPath calls to return the right thing. I guess the old %APPDATA% leaks through, though

@elisee
Copy link
Contributor Author

elisee commented Jul 30, 2016

Ah OK, we do use APPDATA directly in several places. I'll look into getting that changed! https://github.com/superpowers/superpowers-app/search?utf8=%E2%9C%93&q=appdata

@fasterthanlime
Copy link
Collaborator

And I'll look into making it work regardless ;) you might beat me to it though, since I'm not planning to work this week-end :)

@elisee
Copy link
Contributor Author

elisee commented Aug 24, 2016

Fixed this on our side in superpowers/superpowers-app@07210b4, will be in Superpowers v2 coming soon.

@fasterthanlime
Copy link
Collaborator

Hey I beat you to the fix

Called it! I'm elbows-deep into http://github.com/itchio/capsule right now :)

@elisee
Copy link
Contributor Author

elisee commented Aug 24, 2016

I wasn't showing off, I kindly shared an update so you know a fix on your side is not time-sensitive anymore! 😛

But hey. I did beat you to the fix.

😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Can we make more games compatible with the app without them having to change anything? sandbox The itch.io sandbox windows Windows issues
Projects
None yet
Development

No branches or pull requests

2 participants