diff --git a/plugins/adrv9002.c b/plugins/adrv9002.c index fd711418..f2233cec 100644 --- a/plugins/adrv9002.c +++ b/plugins/adrv9002.c @@ -2041,7 +2041,9 @@ static int profile_gen_save_to_file(gchar *filename, struct adrv9002_config *cfg // run profile gen cli command FILE *file; int ret = 0; - char command[BUFSIZ], *config_filename = "adrv9002_config.json"; + char command[BUFSIZ]; + char *config_filename = g_build_filename(getenv("HOME") ?: getenv("LOCALAPPDATA"), "adrv9002_config.json", NULL); + profile_gen_write_config_to_file(config_filename, cfg); if (file_type) { // profile @@ -2178,8 +2180,10 @@ static void profile_gen_load_config_to_device(GtkButton *self, gpointer data) // run profile gen cli command FILE *file; - char command[BUFSIZ], *config_filename = "adrv9002_config.json", *profile_filename = "adrv9002_profile.json", - *stream_filename = "adrv9002_stream.stream"; + char command[BUFSIZ]; + char *config_filename = g_build_filename(getenv("HOME") ?: getenv("LOCALAPPDATA"), "adrv9002_config.json", NULL); + char *profile_filename = g_build_filename(getenv("HOME") ?: getenv("LOCALAPPDATA"), "adrv9002_profile.json", NULL); + char *stream_filename = g_build_filename(getenv("HOME") ?: getenv("LOCALAPPDATA"), "adrv9002_stream.json", NULL); profile_gen_write_config_to_file(config_filename, &cfg); sprintf(command, "%s --config %s --profile %s --stream %s",