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

Program: Resolve ~ as user home #407

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

commonuserlol
Copy link
Contributor

C# treats ~ as directory in cwd, so you have to pass absolute path instead (like /home/user)

Test: ./bin/Release/net9.0/linux-x64/Cpp2IL --game-path=~/Downloads/merged.apk
Result: [Fail] [Program] Execution Failed: Could not find a valid unity game at /home/commonuserlol/projects/Cpp2IL/Cpp2IL/~/Downloads/merged.apk

Result after fix: [Warn] [Program] No output format requested, so not outputting anything. The il2cpp game loaded properly though!

Credit: https://stackoverflow.com/questions/4796254/relative-path-to-absolute-path-in-c

C# treats ~ as directory in cwd, so you have to pass absolute path instead (like /home/user)

Test: ./bin/Release/net9.0/linux-x64/Cpp2IL --game-path=~/Downloads/merged.apk
Result: [Fail] [Program] Execution Failed: Could not find a valid unity game at /home/commonuserlol/projects/Cpp2IL/Cpp2IL/~/Downloads/merged.apk

Result after fix: [Warn] [Program] No output format requested, so not outputting anything. The il2cpp game loaded properly though!

Credit: https://stackoverflow.com/questions/4796254/relative-path-to-absolute-path-in-c
@coveralls
Copy link

coveralls commented Dec 28, 2024

Pull Request Test Coverage Report for Build 12621675604

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 27.496%

Totals Coverage Status
Change from base Build 12493805530: 0.0%
Covered Lines: 3360
Relevant Lines: 10400

💛 - Coveralls

@SamboyCoding
Copy link
Owner

SamboyCoding commented Dec 30, 2024

This solution will break hard for any paths that have ~ in them anywhere other than the start, which is a valid character on windows and is somewhat common in Unity spaces because it's used as the "ignore this folder" character by the unity editor.

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

Successfully merging this pull request may close these issues.

3 participants