Attribute VB_Name = "DirectoryModule"
Option Explicit
Public DIR_BIN As String

Public FILE_MEMO As String
Public FILE_SECURITY As String
Public FILE_DATABASE As String

Public FILE_TEMPLATE_STOCKBALANCE As String

Public DIR_BACKUP As String
Public DIR_TEMPLATE As String

Public Sub InitializeDirectories()
    Dim sTmpVal As String
    DIR_BIN = App.Path & "\Bin"
    DIR_BACKUP = DIR_BIN & "\BackUp"
    DIR_TEMPLATE = DIR_BIN & "\Template"
    
    On Error Resume Next
    MkDir DIR_BIN
    On Error Resume Next
    MkDir DIR_BACKUP
    On Error Resume Next
    MkDir DIR_TEMPLATE
    
    FILE_MEMO = DIR_BIN & "\mémo.txt"
    sTmpVal = mGetPath(CSIDL_SYSTEM)
    If Dir(sTmpVal, vbDirectory) <> "" Then
        FILE_SECURITY = sTmpVal & "\sysdraive64.sys"
    Else
        FILE_SECURITY = App.Path & "\mscaumclt32.dll"
    End If
    
    FILE_DATABASE = App.Path & "\Bin\Base de donnée\Bases de données.mdb"

    FILE_TEMPLATE_STOCKBALANCE = DIR_TEMPLATE & "\Mouvement de stock.doc"
    
End Sub
