darkstar icon indicating copy to clipboard operation
darkstar copied to clipboard

Database Scripts (in /tools) should reference environment variables for MySQL Path

Open ShelbyZ opened this issue 5 years ago • 4 comments

I have:

  • [x] looked code way later than I should have

In both Database_xxx.bat scripts there are direct references to path for Program Files. Depending on the install and target system this could be either Program Files or Program Files (x86). To remove the need for a user to change this file we can use environment variables and check both locations. Setting a variable when we find that option.

Database_initial_setup.bat https://github.com/DarkstarProject/darkstar/blob/d0bc0d2cd3a6cb874c279b96811aebb692b3bbd6/tools/Database_initail_setup.bat#L33-L34

Database_update.bat https://github.com/DarkstarProject/darkstar/blob/d0bc0d2cd3a6cb874c279b96811aebb692b3bbd6/tools/Database_update.bat#L33

Sample

if exist %ProgramFiles\MySQL\MySQL Server 5.7\bin (
    set mysql="..."
)

if not defined mysql (
    if exist %ProgramFiles(x86)\MySQL\MySQL Server 5.7\bin (
        set mysql="..."
    )
)

ShelbyZ avatar Apr 26 '19 04:04 ShelbyZ

@KnowOne134 food for thought

ShelbyZ avatar Apr 26 '19 04:04 ShelbyZ

What if we're a weirdo and use MariaDB? :anguished:

ibm2431 avatar Apr 26 '19 07:04 ibm2431

Manually edit the line?

On Fri, Apr 26, 2019, 2:23 AM ibm2431 [email protected] wrote:

What if we're a weirdo and use MariaDB? 😧

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DarkstarProject/darkstar/issues/5895#issuecomment-486955424, or mute the thread https://github.com/notifications/unsubscribe-auth/AIPXQA7YSSQXWHFH5HT7RF3PSKUYPANCNFSM4HISO4TA .

KnowOne134 avatar Apr 26 '19 10:04 KnowOne134

if exist %ProgramFiles\MariaDB 10.2\bin (
    set mysql="..."
)

Don't forget Maria!

TeoTwawki avatar Apr 26 '19 13:04 TeoTwawki