Skip to content

Commit d7fbbce

Browse files
DSheirerDennis Sheirer
andauthored
#1960 application root directory not found on fresh install (#1961)
Co-authored-by: Dennis Sheirer <[email protected]>
1 parent 36e198e commit d7fbbce

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/main/java/io/github/dsheirer/properties/SystemProperties.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* *****************************************************************************
3-
* Copyright (C) 2014-2023 Dennis Sheirer
3+
* Copyright (C) 2014-2024 Dennis Sheirer
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -125,14 +125,26 @@ public Path getApplicationRootPath()
125125

126126
if(root.equalsIgnoreCase(DEFAULT_APP_ROOT))
127127
{
128-
retVal = Paths.get(
129-
System.getProperty("user.home"), DEFAULT_APP_ROOT);
128+
retVal = Paths.get(System.getProperty("user.home"), DEFAULT_APP_ROOT);
130129
}
131130
else
132131
{
133132
retVal = Paths.get(root);
134133
}
135134

135+
if(!Files.exists(retVal))
136+
{
137+
try
138+
{
139+
mLog.info("Creating application root folder: " + retVal);
140+
Files.createDirectory(retVal);
141+
}
142+
catch(IOException e)
143+
{
144+
mLog.error("Error creating sdrtrunk application root folder", e);
145+
}
146+
}
147+
136148
return retVal;
137149
}
138150

0 commit comments

Comments
 (0)