Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#12 closed defect (fixed)

Fix default config file paths on Windows

Reported by: chris Owned by: chris
Priority: normal Milestone: 0.11
Component: bbackupd Version: 0.10
Keywords: configuration file location directory windows Cc:

Description

The Known Bugs page says:

"We should either always use the default hard-coded path (C:\Program Files\Box Backup\bbackupd.conf), or always assume that the configuration file is in the same directory as the executable, or always try both in the same order."

Change History (4)

comment:2 in reply to:  description Changed 12 years ago by chris

Dave Bamford notes that bbackupd and bbackupquery check different paths, or in a different order, for the configuration file.

comment:2 Changed 12 years ago by chris

Resolution: fixed
Status: newclosed

(In [1690]) Determine config file location at runtime instead of hard-coding on Windows. Thanks to Paul MacKenzie?, Per Thomsen, Pete Jalajas, Stuart Sanders, Dave Bamford and Gary for pushing me to do this. (fixes #12)

comment:3 Changed 12 years ago by chris

(In [1693]) New win32 native build (1692) with the following fixes and new features:

  • Fix saving and restoring archived state, broken in 1662, thanks Gary! [1672]
  • Fix object use after delete, could crash client, thanks Gary! [1673]
  • Fix regular expression support to work on all platforms, and disabuse HAVE_REGEX_H [1677] [1678] [1682]
  • Internal cleanups, pass std::strings to various classes instead of char arrays [1683] [1684] [1689]
  • All programs use the directory of the executable as the default config file location, instead of the hardcoded "C:\Program Files\Box Backup". Thanks to Paul MacKenzie?, Per Thomsen, Pete Jalajas, Stuart Sanders, Dave Bamford and Gary for pushing me to do this. (fixes #12) [1685] [1686] [1687] [1688] [1690] [1691] [1692]
  • Update copyrights to 2007, thanks Per Thomsen! [1670]

comment:4 Changed 12 years ago by chris

(In [1777]) Make Configuration take a std::string filename instead of a char array, in C++ style.

Add a function to get default config file paths at runtime, dependent on the location of the executable being run.

Pass the config file name directly to Daemon::Main, instead of faking argv.

No default raid file path at compile time on Windows, depends on executable location when run.

Determine RaidFile? path at runtime if not supplied in config file on Windows.

Don't define default locations for config files at compile time on Windows, provide macros to determine them at runtime instead.

Make FileHandleGuard? take a std::string instead of a char array, C++ style.

Determine config file location at runtime instead of hard-coding on Windows. Thanks to Paul MacKenzie?, Per Thomsen, Pete Jalajas, Stuart Sanders, Dave Bamford and Gary for pushing me to do this. (fixes #12)

Determine config file path at runtime. Call Daemon::Main with config file name instead of building fake argv.

(refs #3, merges [1684] [1685] [1686] [1687] [1688] [1689] [1690] [1691] [1692])

Note: See TracTickets for help on using tickets.