Results 1 to 5 of 5

Thread: Windows or Inno Setup keeps same Access 2000 file when installing my VB6 application?

Threaded View

  1. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Windows or Inno Setup keeps same Access 2000 file when installing my VB6 applicat

    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:

    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
    Typically you'd want to grant just the permissions required, perhaps even file by file.

    BTW: icacls.exe wasn't available until Vista. See the CodeBank for examples of doing the same thing via API calls in VB6.
    Attached Files Attached Files
    Last edited by dilettante; Dec 5th, 2019 at 02:17 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width