Skip to content

Commit cff8de2

Browse files
committed
Path constants only represent base path
Any path-related constants only represent the directory that the WinNUT-Client data container directory goes in. The WinNUT directory will be appended later on.
1 parent 79cc539 commit cff8de2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

WinNUT_V2/WinNUT-Client_Common/WinNUT_Globals.vb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ Public Module WinNUT_Globals
1515

1616
#If DEBUG Then
1717
' If debugging, keep any generated data next to the debug executable.
18-
Private ReadOnly DESIRED_DATA_PATH As String = Path.Combine(Environment.CurrentDirectory, "Data")
18+
Private ReadOnly DESIRED_DATA_PATH As String = Path.Combine(Environment.CurrentDirectory)
1919
#Else
20-
Private ReadOnly DESIRED_DATA_PATH As String = Path.Combine(Environment.GetFolderPath(
21-
Environment.SpecialFolder.ApplicationData), "\WinNUT-Client")
20+
Private ReadOnly DESIRED_DATA_PATH As String = Environment.GetFolderPath(
21+
Environment.SpecialFolder.ApplicationData))
2222
#End If
2323

24-
Private ReadOnly FALLBACK_DATA_PATH = Path.GetTempPath() & ProgramName
24+
Private ReadOnly FALLBACK_DATA_PATH = Path.GetTempPath()
2525

2626
Public ReadOnly ProgramName = My.Application.Info.ProductName
2727
Public ReadOnly LongProgramName = My.Application.Info.Description
@@ -45,12 +45,14 @@ Public Module WinNUT_Globals
4545
End Sub
4646

4747
''' <summary>
48-
''' Do everything possible to find a safe place to write to. If the requested option is unavailable, we fall back
49-
''' to the temporary directory for the current user.
48+
''' Do everything possible to find a safe place to write to, with the <see cref="ProgramName"/> appended to it. If
49+
''' the requested option is unavailable, we fall back to the temporary directory for the current user.
5050
''' </summary>
51-
''' <param name="requestedDir">The requested directory.</param>
51+
''' <param name="requestedDir">The requested directory, with <see cref="ProgramName"/> appended to it.</param>
5252
''' <returns>The best possible option available as a writable data directory.</returns>
5353
Private Function GetAppDirectory(requestedDir As String) As String
54+
requestedDir = Path.Combine(requestedDir, ProgramName)
55+
5456
Try
5557
Directory.CreateDirectory(requestedDir)
5658
LogFile.LogTracing("Successfully created or opened requested data directory for WinNUT." &

0 commit comments

Comments
 (0)