Skip to content

Commit

Permalink
Initial change to create appropriate user directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeNeilson committed May 22, 2024
1 parent 20b7e40 commit 416807f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
3 changes: 2 additions & 1 deletion install/bin/dbexport
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
# options:
# -i Export from 'installed' database (default is edit db)
#
%INSTALL_PATH/bin/decj decodes.dbimport.DbExport $*
APP_PATH=$( dirname -- "${BASH_SOURCE[0]}")
${APP_PATH}/decj decodes.dbimport.DbExport $*
3 changes: 2 additions & 1 deletion install/bin/decj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#

# INSTALL_PATH will be replaced with actual DECODES install dir.
DH=%INSTALL_PATH
APP_PATH=$( dirname -- "${BASH_SOURCE[0]}")
DH="${APP_PATH}/.."

# Make sure DCSTOOL_HOME is set
if [ -z "$DCSTOOL_HOME" ]
Expand Down
16 changes: 15 additions & 1 deletion install/bin/decj.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,18 @@ for /R "%APP_PATH%/dep" %%a in (*.jar) do (

set "CLASSPATH=!CLASSPATH!"

java -Xmx240m -cp "!CLASSPATH!" -DDCSTOOL_HOME="%APP_PATH%" -DDECODES_INSTALL_DIR="%APP_PATH%" -DDCSTOOL_USERDIR="%APP_PATH%" %*%
if not defined DCSTOOL_USERDIR (
set DCSTOOL_USERDIR="%APPDATA%\opendcs"
)

if not exist %DCSTOOL_USERDIR%\ (
echo "Creating Local User Directory and initial properties in %DCSTOOL_USERDIR%"
mkdir %DCSTOOL_USERDIR%
cp %APP_PATH%\decodes.properties %DCSTOOL_USERDIR%\user.properties
)

for /R "%DCSTOOL_USERDIR%/dep" %%a in (*.jar) do (
set "CLASSPATH=!CLASSPATH!;%%a"
)

java -Xmx240m -cp "!CLASSPATH!" -DDCSTOOL_HOME="%APP_PATH%" -DDECODES_INSTALL_DIR="%APP_PATH%" -DDCSTOOL_USERDIR="%DCSTOOL_USERDIR%" %*%
3 changes: 2 additions & 1 deletion install/bin/launcher_start
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/sh
%INSTALL_PATH/bin/decj decodes.launcher.LauncherFrame $*
APP_PATH=$( dirname -- "${BASH_SOURCE[0]}")
${APP_PATH}/decj decodes.launcher.LauncherFrame $*
2 changes: 1 addition & 1 deletion install/decodes.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# The default installation is set up for a local XML database.
#
EditDatabaseType=XML
EditDatabaseLocation=$DECODES_INSTALL_DIR/edit-db
EditDatabaseLocation=$DCSTOOL_USERDIR/edit-db

#
# For SQL Editable Database, change EditDatabaseType to sql
Expand Down

0 comments on commit 416807f

Please sign in to comment.