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

Incorrect folder paths on MacOS #3

Closed
TuomoKu opened this issue Sep 3, 2020 · 4 comments
Closed

Incorrect folder paths on MacOS #3

TuomoKu opened this issue Sep 3, 2020 · 4 comments

Comments

@TuomoKu
Copy link
Owner

TuomoKu commented Sep 3, 2020

When GC is installed on Mac the DATAROOT-folder and config.json file is generated incorrectly to current user's home directory and not GC's root folder.

Workaround: when running GC for the first time the files and folders will be generated (and the program ends to an error). Close the process, move config.json and DATAROOT-folder to a correct location, modify config.json manually in text editor to the correct filepaths and restart the application.

@removogel
Copy link

Its the same issue at Linux, config.json and DATAROOT-folder are created in the home folder. After moving it to the application folder i was able to start it and change the paths in the config.

@TuomoKu
Copy link
Owner Author

TuomoKu commented Jan 8, 2021

Some more findings:
a) only effects binary package version of SPX-GC
b) The actual issue: Mac defaults to User's home directory (such as /Users/John ) when a Terminal is started by doubleclicking on any executable shell program. When the same program is started from terminal prompt it works as expected...

Currently SPX-GC uses process.cwd() to get the startup path. Another approach should be taken to figure out if we app is running in pkg environment (on Mac).

WORKAROUND until fix: navigate to the install folder with Terminal and start the app there with .SPX-GC_macos64command (and NOT by doubleclicking on it)

@TuomoKu TuomoKu closed this as completed in 2cffc0e Jan 8, 2021
TuomoKu added a commit that referenced this issue Jan 8, 2021
@TuomoKu TuomoKu reopened this Jan 8, 2021
@TuomoKu
Copy link
Owner Author

TuomoKu commented Jan 8, 2021

This needs work - the issue is stll present. A textfle added to Mac zip file reading:

DO NOT DOUBLECLICK SPX-GC_macos64 -file to run it.
MacOS defaults to "/User/username" -folder when a program is opened by DOUBLECLICKING on it. This WILL CAUSE AN ERROR and default files (config.json, LOG, DATAROOT) will be generated to the home directory and not to the current working directory. Please navigate to the correct folder and start the application with "./SPX-GC_macos64" -command.

@TuomoKu
Copy link
Owner Author

TuomoKu commented Apr 26, 2021

Fixed in 1.0.12 by introducing a getStartUpFolder() -function, which checks the runtime environment and returns the path accordingly.

@TuomoKu TuomoKu closed this as completed Apr 26, 2021
TuomoKu pushed a commit that referenced this issue Apr 1, 2024
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