Your installer should create an appropriate folder, set security on it as required, then copy the database there.
Example in VB6 that punts and just gives Everyone Full Control with inheritance:
Typically you'd want to grant just the permissions required, perhaps even file by file.Code:Option Explicit Private Sub Main() Const ssfCOMMONAPPDATA = &H23& 'Now also known as ProgramData. Dim Path As String With CreateObject("Shell.Application").NameSpace(ssfCOMMONAPPDATA).Self Path = .Path End With Path = Path & "\SomeCompanyName" On Error Resume Next MkDir Path Err.Clear Path = Path & "\SomeProductName" MkDir Path On Error GoTo 0 'Grant Full Control to Everyone: SyncShell.Shell "ICACLS """ & Path & """ /grant *S-1-1-0:(OI)(CI)F /T /Q", vbHide MsgBox "Done" End Sub
BTW: icacls.exe wasn't available until Vista. See the CodeBank for examples of doing the same thing via API calls in VB6.




Reply With Quote
