Catalina complaining of Network Access

  1. last week

    Andy B

    Dec 2 Airdrie, AB, Canada

    When I run one of my apps on Catalina, it asks permission for the program to access network drives. I don't need access to network drives, so in a perfect world, this message would not come up.
    I understand that this message may go away once I've properly signed and notarized my app (still working on that), but for curiosity sake, is there a way to avoid looking at Network drives when trying to find a particular volume?
    My program performs a firmware update on an external device which shows up as an external USB drive, but it first has to find that device by checking each volume to see if the appropriate file is contained therein. I suppose it's scan is also looking at network drives, and this may be why Catalina is complaining.

    Is the following code causing the warning in Catalina? Can anyone suggest a "better" way to scan that would only look at external USB volumes?
    Oh - it's cross-platform so this has to work on Windows too. (It does currently)

    For CurVolNum as Integer = 0 to VolumeCount -1
      Try
        f = Volume(CurVolNum)
        If f.Count = 1 And f.item(1).Name = "firmware.bin" Then
          Exit For
        Else
          f = Nil
        End If
      Catch ex As IOException
        f = Nil
      End Try
    Next CurVolNum
  2. Beatrix W

    Dec 2 Pre-Release Testers, Third Party Store Europe (Germany)

    The warnings won't go away when you sign and notarize your app.

    If you have a network volume mounted then you need to have access to it if you want to get the name. So this looks like a feature and not a bug.

  3. Andy B

    Dec 2 Airdrie, AB, Canada

    Ok, so no way to identify network volumes and avoid them without getting their name? (Chicken/Egg?)

  4. Norman P

    Dec 2 Pre-Release Testers, Xojo Pro under a bus

    I believe MBS has a plugin that can tell you if a volume is a network or local usb based one
    And that they even have such a thing for mac & windows

  5. Andy B

    Dec 2 Airdrie, AB, Canada

    Ok. Probably not worth it just for this, but good to know.
    Thanks, Norman.

  6. Norman P

    Dec 2 Pre-Release Testers, Xojo Pro under a bus

    pretty sure you could, on macOS, determine whether its a network drive or not by examining the output of the mount command and parsing it apart looking for the Volumes full path in that output

    mount tells you if the drive is local or not along with several other useful bits

  7. Tim J

    Dec 2 Pre-Release Testers N. Phoenix, AZ

    Norman's method works for both macOS and Linux:

    theShell.Execute "mount"

    You will need to parse the "theShell.ReadAll" results, but it won't flag network access.

  8. Andy B

    Dec 2 Airdrie, AB, Canada
    Edited last week

    What's "theShell" ?

    Would I need a completely different procedure on Windows?

  9. Norman P

    Dec 2 Pre-Release Testers, Xojo Pro under a bus

    theShell is a Shell object instance

    dim theShell as new Shell
    theShell.Execute "mount"
    .. code here to parse the results apart
  10. Tim J

    Dec 2 Pre-Release Testers N. Phoenix, AZ

    Sorry - my knowledge <> your knowledge :S

    Norman beat me to it. More clearly:

    Dim theShell As New Shell
    Dim mntResults(-1) As String
    Dim a As Integer
    
    theShell.Mode = 1
    theShell.Timeout = -1
    theShell.Execute "/bin/mount"
    Do
        theShell.Poll
    Loop Until Not theShell.IsRunning
    mntResults = SplitB(theShell.ReadAll)
    
    // Walk through the mntResults array to find your non-network volumes.
    For a = 0 To mntResults.Ubound
        ...
    Next
  11. Andy B

    Dec 2 Airdrie, AB, Canada

    Gotcha. Thanks, Gents.

    On further thought, I'll just live with the customer needing to hit "Ok". Much less work.

or Sign Up to reply!