copying files on installation

  1. last week

    Sean C

    Feb 5 New Zealand

    Hi there - when my Mac app opens it copies a whole lot of files to the library>application support>my app folder.

    The problem is that the very next procedure after this happens, it uses files that are in this new folder, and if they are not there yet and still being copied, it crashes.

    Is there a way to copy files so that the code does not go forward until the files are copied?

  2. Jeff T

    Feb 5 Midlands of England, Europe

    Don't unpack the files in a thread.

    If your application open code is

    IF MY FILES EXIST
          UNPACK MY FILES
    END IF
    
    USE THE FILES

    Then you wont hit this scenario

    However, I can say that opening an app by double clicking a file can cause the Document Open event to fire before the App Open event.
    And I have one app where the Window Open event literally never ever fires, so I had to put checking code into the Activate event.

  3. David C

    Feb 6 Pre-Release Testers, Xojo Pro Derby, ITM

    Not as good, but still works, you can also insert a one second delay after the OS action.

    I have some code where I get the OS to delete a folder of files via a Shell command (rather than cycling through them) and even though they are gone, Xojo still thinks they're there in the next line! I put in a delay of one second the, then voilà (or really non-voilà), the files are no longer there in Xojo!

or Sign Up to reply!