MantisBT - Doomseeker |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0003354 | Doomseeker | [All Projects] Bug | public | 2017-12-11 16:48 | 2024-11-03 19:09 |
|
Reporter | Zalewa | |
Assigned To | Zalewa | |
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | Microsoft | OS | Windows | OS Version | XP/Vista/7 |
Product Version | 1.0 | |
Target Version | 1.4.0 | Fixed in Version | 1.4.0 | |
|
Summary | 0003354: Portable mode is portable in name only. |
Description | The '--portable' mode is really a '--stick-config-files-next-to-exe' mode.
The idea of '--portable' is to put the app on a USB stick and take it with you anywhere. However, when you look at config files, you will notice that it saves absolute paths everywhere when it spawns the config files. If your Windows loads the USB under the letter "G:\", the .ini will contain paths "G:\Doomseeker\.doomseeker\". Then you take the stick with you somewhere, and it gets mounted as "F:\" - nothing works because all paths are invalid now.
This is similar to 0003262 where user home dir is not saved as $HOME or ~.
The proposed fix is to create a place-holder token that can be used when configuring various paths and this token will always resolve to the current "dir-with-executable" path.
Propositions for such token:
$APPDIR
$PROGDIR
$DOOMSEEKERDIR
$DSDIR
$<PROGDIR>
{PROGDIR}
We should come up with something that has minimal chance of colliding with actual OS path but also won't be too cumbersome and won't be QString::replaced() incorrectly and won't potentially collide with env vars that could also be expanded in the same way.
For example, EAGLE uses "$EAGLEDIR" as a placeholder. |
Steps To Reproduce | |
Additional Information | This has been so since forever.
|
Tags | No tags attached. |
Relationships | related to | 0003262 | closed | Zalewa | Allow $HOME and/or ~/ in file paths |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2017-12-11 16:48 | Zalewa | New Issue | |
2017-12-11 16:49 | Zalewa | Relationship added | related to 0003262 |
2017-12-11 16:49 | Zalewa | Description Updated | bug_revision_view_page.php?rev_id=11354#r11354 |
2018-08-27 07:31 | Zalewa | Assigned To | => Zalewa |
2018-08-27 07:31 | Zalewa | Status | new => assigned |
2022-09-10 15:01 | Zalewa | Target Version | => 1.4.0 |
2023-01-02 13:36 | Zalewa | Note Added: 0022623 | |
2023-01-02 13:37 | Zalewa | Note Edited: 0022623 | bug_revision_view_page.php?bugnote_id=22623#r13863 |
2023-01-03 19:52 | Zalewa | Note Added: 0022626 | |
2023-01-03 19:52 | Zalewa | Status | assigned => needs review |
2023-01-03 19:52 | Zalewa | Note Edited: 0022626 | bug_revision_view_page.php?bugnote_id=22626#r13868 |
2023-01-03 20:03 | Zalewa | Note Edited: 0022626 | bug_revision_view_page.php?bugnote_id=22626#r13871 |
2023-01-05 12:32 | Zalewa | Note Added: 0022664 | |
2023-01-05 12:32 | Zalewa | Status | needs review => needs testing |
2023-01-05 12:33 | Zalewa | Note Edited: 0022664 | bug_revision_view_page.php?bugnote_id=22664#r13879 |
2023-02-19 14:13 | Zalewa | Status | needs testing => resolved |
2023-02-19 14:13 | Zalewa | Fixed in Version | => 1.4.0 |
2023-02-19 14:13 | Zalewa | Resolution | open => fixed |
2024-11-03 19:09 | Zalewa | Status | resolved => closed |
Notes |
|
(0022623)
|
Zalewa
|
2023-01-02 13:36
(edited on: 2023-01-02 13:37) |
|
In preparation for solving this issue I made a bunch of edits to DataPaths to clean it up:
1. Improvements to documentation and deprecation of the canWrite() method that was already unused.
2. Deprecation and cease of use of confusing, legacy methods (workingDirectory(), systemAppDataDirectory() and their counterparts).
|
|
|
(0022626)
|
Zalewa
|
2023-01-03 19:52
(edited on: 2023-01-03 20:03) |
|
And voila:'https://bitbucket.org/Doomseeker/doomseeker/commits/79c183be397435abd3d449791d4a7a88e3ec2ba4 [^]'
The commit message contains an extensive description on how this was implemented, so let me quote that:
Quote from Commit Message Portablize all paths in the portable mode
Path portablization (yeah, I made up a word) ensures that all paths are
stored in the program's configuration as relative when the portable mode
is on. Launching Doomseeker with the `--portable` argument doesn't only
force the base directory for all managed data to the executable's
directory anymore, but also changes the way in which the paths are saved
in the config. Doomseeker will change current working directory to the
executable's location and then, whenever a configurable path is browsed,
it will alter that path so that it is relative to the executable's
location. Previously those paths would be saved as absolute, with drive
letters or the '/' root dir (depending on the system).
With the relative paths the portable mode should become truly
portable. If Doomseeker is put on a portable drive carried between
computers and the relative paths within that drive remain valid, then
the configured paths should also remain valid regardless of where the
portable drive gets mounted.
Nevertheless, it is sometimes desireable to present the user the
absolute paths: when presenting the command line or when the path
is viewed from the perspective of the launched game. Doomseeker
will convert these relative paths to absolute when it musts.
|
|
|
(0022664)
|
Zalewa
|
2023-01-05 12:32
(edited on: 2023-01-05 12:33) |
|
Beta package for Windows available at the beta auto-update channel and at:
'https://devbuilds.drdteam.org/doomseeker/doomseeker-1.3.3~beta-230105-1140_windows.zip [^]'
Please test running with `--portable` mode and without and seeing if the various path configurations throughout the program behave properly. Keep in mind that if the path crosses the boundary of the filesystem on Windows (ie. changes the drive letter) then it's normal and expected to receive an absolute path even in the `--portable` mode.
This change has a potential for lots of nasty bugs...
|
|