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

add D_DoomPrefDir() instead of D_DoomExeDir() to iwad_dirs #2115

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

fabiangreffrath
Copy link
Owner

D_DoomPrefDir() returns the executable directory on Windows, and a user-writable config directory everywhere else.

D_DoomPrefDir() returns the executable directory on Windows,
and a user-writable config directory everywhere else.
@rfomin
Copy link
Collaborator

rfomin commented Jan 3, 2025

While we are here, should we change the D_DoomExeName() function to just PROJECT_SHORTNAME? With the current D_DoomExeName() on Linux with AppImage it will create a new config for each new version.

woof/src/m_config.c

Lines 221 to 222 in 2ac2f64

tmpfile = M_StringJoin(D_DoomPrefDir(), DIR_SEPARATOR_S, "tmp",
D_DoomExeName(), ".cfg");

@fabiangreffrath
Copy link
Owner Author

Sure we can change that. But why is it even necessary at all? Isn't the executable called woof in AppImage?

@rfomin
Copy link
Collaborator

rfomin commented Jan 3, 2025

Isn't the executable called woof in AppImage?

It's called Woof-15.0.1-Linux since we take the executable name from the command line. Alternatively, we can rename AppImage to just woof.

@fabiangreffrath
Copy link
Owner Author

Ah, I see. Let's keep the version in the AppImage file name. It will make it easier to maintain an archive of releases.

I'll check where we use D_DoomExeName() at all in the code and either change these occasions to use PROJECT_SHORTNAME or change the entire function to just return that string.

But this is for a separate PR, I suggest.

@rfomin
Copy link
Collaborator

rfomin commented Jan 3, 2025

I'll check where we use D_DoomExeName() at all in the code and either change these occasions to use PROJECT_SHORTNAME or change the entire function to just return that string.

It's config, saves names and screenshots names.

But this is for a separate PR, I suggest.

Okay.

@fabiangreffrath
Copy link
Owner Author

Alright. We could generally cap the exe name after the fourth character, as we already do for the latter two cases.

@fabiangreffrath fabiangreffrath requested a review from rfomin January 3, 2025 09:43
@rfomin
Copy link
Collaborator

rfomin commented Jan 3, 2025

Alright. We could generally cap the exe name after the fourth character, as we already do for the latter two cases.

I guess back in the DOS days it was useful to rename executables and store multiple ports in one folder (e.g. BOOM.EXE, MBF.EXE). I don't think anyone does that anymore. So I suggest to just use PROJECT_SHORTNAME.

@fabiangreffrath fabiangreffrath merged commit 5e04f87 into master Jan 3, 2025
8 checks passed
@fabiangreffrath fabiangreffrath deleted the iwad_dirs_2 branch January 3, 2025 09:50
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.

2 participants