Zandronum Chat on our Discord Server Get the latest version: 3.1
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003354Doomseeker[All Projects] Bugpublic2017-12-11 16:482023-02-19 14:13
ReporterZalewa 
Assigned ToZalewa 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformMicrosoftOSWindowsOS VersionXP/Vista/7
Product Version1.0 
Target Version1.4.0Fixed in Version1.4.0 
Summary0003354: Portable mode is portable in name only.
DescriptionThe '--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.
Additional InformationThis has been so since forever.

Attached Files

- Relationships
related to 0003262resolvedZalewa Allow $HOME and/or ~/ in file paths 

-  Notes
User avatar (0022623)
Zalewa (developer)
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).

User avatar (0022626)
Zalewa (developer)
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.


User avatar (0022664)
Zalewa (developer)
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...


Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: DrinkyBird
Opponents: No one explicitly opposes this issue yet.

- 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 View Revisions
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 View Revisions
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 View Revisions
2023-01-03 20:03 Zalewa Note Edited: 0022626 View Revisions
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 View Revisions
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






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker