https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
v

Vedran

03/06/2024, 5:48 PM
Hi all! I have to build really simple app for windows and I choosed kotlin/compose. App is pretty much done but I cannot figure out what is the best way to handle environment variables here? I have to adjust them according to my environments (local / dev / production) , but I'm not really seeing how. Basically, something like src/resources/application.yml in java ?
m

mikehearn

03/07/2024, 10:11 AM
Using environment variables to determine test/prod etc is not idiomatic for desktop apps, that may be common on the server but not there. You can use instead for example system properties, where the system property that means "prod" is set in your packaging. If you use Conveyor you can easily do this with one line in your package config file, if you use the built in jpackage-based tooling then I don't remember but it's probably possible also.
v

Vedran

03/07/2024, 12:20 PM
thank you!
Conveyor looks pretty neat. I'm not 100% sure if it works tho. I've tried to follow tutorial there for JVM Apps / Jetpack Compose I've managed to create the app, build it, serve the package and install it. But the next step that tells you to release an update does not work.
m

mikehearn

03/11/2024, 9:29 AM
@Vedran as the message says, macOS does not allow apps to update themselves if they are still in the user's Downloads folder.
Users are expected to drag the app to /Applications or ~/Applications. This isn't a Conveyor thing, it's a macOS security thing (apps don't have access to the Downloads folder by default and are run "translocated" until the user moves it).