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

Users who extract RSC+ to Program Files cannot run the game #138

Open
aldrichdev opened this issue Feb 24, 2023 · 2 comments
Open

Users who extract RSC+ to Program Files cannot run the game #138

aldrichdev opened this issue Feb 24, 2023 · 2 comments

Comments

@aldrichdev
Copy link

aldrichdev commented Feb 24, 2023

Steps to Reproduce:

  1. Download rscplus-windows.zip
  2. Create a new folder, C:\Program Files\RSC+
  3. Extract the contents of the package to C:\Program Files\RSC+
  4. Run rscplus_console.exe.

RSC+ does not start and prints several errors such as:

[  INFO][20:50:08] Loading resource as stream: /lib/jinput-natives/libjinput-osx.jnilib
[ ERROR][20:50:08] Could not extract /lib/jinput-natives/libjinput-osx.jnilib
java.io.FileNotFoundException: C:\Program Files\RSC+\lib\jinput-natives\libjinput-osx.jnilib (The system cannot find the path specified)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at Client.Launcher.extractResource(Unknown Source)
        at Client.Launcher.extractJInputNatives(Unknown Source)
        at Client.Launcher.init(Unknown Source)
        at Client.Launcher.main(Unknown Source)

The user must go to folder properties of RSC+ -> Security -> Edit... and give the "Everyone" role full access to the folder, but this is not intuitive. I wonder if anything can be done to make this easier for them.

@grawlinson
Copy link

This is not unique to Windows. I just attempted to package rscplus for Arch Linux's AUR and from what I can tell, rscplus looks for these libraries/files using an absolute path (created from the directory that the jar is in).

It may be worth telling ant to bundle all dependencies into the jar.

For example, Gradle does it like this in build.gradle:

// Modify jar task to include all dependencies (a.k.a. create a fat jar)
tasks.named('jar') {
  from {
    configurations.runtimeClasspath.collect {
      it.isDirectory() ? it : zipTree(it)
    }
  }
}

@conker-rsc
Copy link
Member

conker-rsc commented Aug 15, 2023

This is happening because program files is a protected directory, and without setting the right file permissions, RSC+ isn't able to create files that it needs in order to run, which it places in the same relative path to the jar itself.

We're planning on overhauling how the app gets installed altogether in the future, but for now I'll be adding a check for this scenario and displaying an error modal to the user to explain what's going on, so they can know to either move the files elsewhere or set the right permissions (if they know how).

@grawlinson: rsc+ is already a "fat" jar - it's actually looking for those dependencies relative to the location of the JAR itself, it's just that in this case it isn't able to find them, because it wasn't able to extract them out of the JAR in the first place due to the permissions.

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

3 participants