Getting path to resources

  1. 3 months ago

    Brian O

    Mar 13 Pre-Release Testers, Xojo Pro Calgary, AB
    Edited 3 months ago

    I added a build step to copy an executable file into my resource folder.

    Applies to: Both
    Subdirectory: dcmtk_mac
    Destination: Resources Folder

    at run time I'm trying to get the path to that folder.

    f = app.ExecutableFile
    path = f.ShellPath

    While debugging this is what is returned by f.ShellPath

    /private/var/folders/j9/m67_1bwd2qg14r3snb_2m7w80000gn/T/TemporaryItems/FindAndUpdateDatabase.debug.app/Contents/MacOS/FindAndUpdateDatabase.debug

    however my resources are here:

    /private/var/folders/j9/m67_1bwd2qg14r3snb_2m7w80000gn/T/TemporaryItems/FindAndUpdateDatabase.debug.app/Contents/Resources/dcmtk_mac

    What am i suppose to do to do this properly?

    did you try SpecialFolder.Resources???

    plus you resources are NOT at app.executable path... they are below that

  2. Dave S

    Mar 13 Answer San Diego, California USA
    Edited 3 months ago

    did you try SpecialFolder.Resources???

    plus you resources are NOT at app.executable path... they are below that

  3. Brian O

    Mar 13 Pre-Release Testers, Xojo Pro Calgary, AB

    Thank you Dave!

  4. Beatrix W

    Mar 13 Pre-Release Testers Europe (Germany)

    app.ExecutableFile.Parent.Parent.Child("Resources"). Specialfolder.Resources is newer

  5. Ulrich B

    Mar 13 Pre-Release Testers, Xojo Pro Europe (Germany, Berlin) · xo...

    I’d say SpecialFolder.GetResource("dcmtk_mac") is even shorter ;)

  6. Tim P

    Mar 13 Pre-Release Testers Rochester, NY

    @Beatrix W app.ExecutableFile.Parent.Parent.Child("Resources"). Specialfolder.Resources is newer

    If you're using an older version of Xojo, the TPSF module is especially helpful.

or Sign Up to reply!