PeaceFounder / AppBundler.jl

Bundle your Julia application
MIT License
50 stars 2 forks source link

How to add settings files with read/write access into `USER_DATA` directory upon install or first run? #11

Open sairus7 opened 2 months ago

sairus7 commented 2 months ago

I have app written with CImGui.jl, which keeps current window layout in sync with imgui.ini file stored in current directory (or in any other predefined directory). When the app is developed, pwd() is the project folder. After app install, pwd() changes to C:\Windows\system32. So how should set windows.ini file extracted into USER_DATA?

JanisErdmanis commented 2 months ago

The USER_DATA directory is designed to be used exclusively by the launched application. It sounds like what you could do is put imgui.ini in the application assets directory and copy it into USER_DATA directory launch if it is nonexistent. The application assets location can be derived from Sys.BINDIR.

Regarding pwd() pointing to C:\Windows\system32, you can change it with cd(USER_DATA). All those changes fit well within an init.jl recipe file.