Stop deleting debug folder files

I want to test the application ability to create some files in it’s own (root) folder and append information to them later on.
Trouble is when I debug then close the program the whole debug folder is deleted.
Is there any way XOJO can only remove the exe and resource, lib folders leaving non related files behind for next debug?
I don’t want to build the program and manually start it just to test it.

You shouldn’t do this. Use another location, such as Documents or ApplicationData.

I’m writing a portable app (eg. runs from USB) that doesn’t write files to the system.
I need to include a config (text file).

Go and change permissions so Xojo can’t delete the folder…

Okay here’s another related problem.
I take my XOJO program folder on a USB to another place where I don’t have Administrator rights on the computer.
The system is old and doesn’t have the runtimes to run XOJO 2016R3 but that’s okay because I’ve copied the (41) runtime files from the website to the program folder on the USB.

It runs fine now - except …
When I debug the resulting file won’t run on the system without the runtimes. I can get it to run by copying the runtime files to the debug folder after it fails then launch the executable again.

However the same problem arises when I close the program. Debug folder is deleted and the runtimes with it.
Wouldn’t it be great if I could leave them there ready for the next debug.

Some points -
I don’t have administrator rights so can’t set folder permissions.
I could build the program and leave the runtimes in the build folder for next time but alas I don’t have an XOJO licence for this computer and I won’t be transferring one of my home licences here.

you can also copy another exe in that folder and launch it.
This way a file in the directory is open and it can’t be deleted.

Ok that works.
I opened a new text file (notepad) in the debug folder while the program was running and left it open.
XOJO no longer deletes the debug folder or contents on closing the program.
Much easier to do this once a day than copy the runtimes across everytime I debug or losing the config file from the previous session.

Use a build step to copy the libraries.


A few days ago, in this thread: I’ve learned from Michel Burjadet how to use CopyFiles. It will do exactly what you want: copy files at Debug folder automatically.

Thanks Ramon, I checked out the post and it sounds the way to go.

[quote]@Michel Bujardet …
The gear appears in the build settings, in “Windows”. Click the disclosure triangle and you will see it. Place the copyfile under the gear. That is the moment when the exe is created, so placing the copy afterward will copy it next to the newly built exe.
That is also that way you can copy any needed DLL to have them, especially the VC redistribuable ones for 2016R3.[/quote]

Interesting. In the free version of the program there is only a disclosure triangle next to OSX, none for Windows or Linux. Even though I’m running XOJO in Windows.

Drag the copyfile over the platform, and you should see the disclosure triangle.

Thanks, got it now.
Dragged and dropped all the files into the copyfile and moved it under the Build gear for Windows.
Set the Behaviour “Applies to” to Debug.
Works a treat.