diff --git a/meson.build b/meson.build index 560ee7e..f63bd2b 100644 --- a/meson.build +++ b/meson.build @@ -10,8 +10,8 @@ endif vapidir = meson.project_source_root() / 'vapi' recuentodeps = [ - dependency('libadwaita-1'), dependency('glib-2.0'), + dependency('libadwaita-1'), dependency('gtk4'), dependency('gio-2.0'), dependency('sqlite3'), @@ -22,10 +22,6 @@ sources = [ 'src/main.vala', ] -launcher_sources = [ - 'src/windows/launcher.c', -] - datadir_unix = get_option('prefix') + '/' + get_option('datadir') datadir = get_option('prefix') + ws + get_option('datadir') @@ -47,18 +43,37 @@ foreach i : preloaded_images_files endforeach if is_windows + launcher_sources = [ + 'src/windows/launcher.c', + ] + installer_sources = [ + 'src/windows/installer.c', + ] + windows = import('windows') windows_sources = windows.compile_resources('resources/windows.rc', include_directories : [ '../recuento/resources' ] ) foreach i : windows_sources launcher_sources += i + installer_sources += i endforeach launcherdeps = [ + dependency('libadwaita-1'), + dependency('gtk4'), dependency('glib-2.0'), + dependency('gio-2.0'), dependency('owlpath'), ] + + executable ('recuento_installer_windows', + installer_sources, + dependencies: launcherdeps, + install : true, + win_subsystem: 'windows', + ) + executable('recuento_launcher_windows', launcher_sources, dependencies : launcherdeps, diff --git a/package.pl b/package.pl index 3266773..4b74949 100644 --- a/package.pl +++ b/package.pl @@ -12,7 +12,7 @@ print $recuento_inner.''; $recuento_inner->mkpath; my $resources = $recuento_inner->child('resources'); $resources->mkpath; -copy_recursive('/home/sergio/recuento_root/usr/bin/recuento{,_launcher_windows}.exe', $recuento_inner); +copy_recursive('/home/sergio/recuento_root/usr/bin/recuento{,_{launcher,installer}_windows}.exe', $recuento_inner); copy_recursive('/home/sergio/recuento_root/usr/bin/rsvg-convert.exe', $recuento_inner); copy_recursive('/home/sergio/recuento_root/usr/bin/rsvg-convert.exe', $destdir); copy_recursive('/home/sergio/recuento_root/usr/bin/*.{dll,DLL}', $destdir); diff --git a/src/windows/installer.c b/src/windows/installer.c new file mode 100644 index 0000000..d925920 --- /dev/null +++ b/src/windows/installer.c @@ -0,0 +1,31 @@ +#include + +#include + +#include +#include + +static void +activate (AdwApplication *app, + gpointer user_data) { + GtkWidget *window = + adw_application_window_new (GTK_APPLICATION (app)); + gtk_window_set_default_size (GTK_WINDOW (window), 800, 800); + GtkBox *window_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)); + GtkWidget *title = gtk_label_new ("Install Recuento"); + AdwHeaderBar *header = ADW_HEADER_BAR (adw_header_bar_new()); + + adw_header_bar_set_title_widget (header, title); + gtk_box_append (window_box, GTK_WIDGET (header)); + adw_application_window_set_content (ADW_APPLICATION_WINDOW (window), GTK_WIDGET (window_box)); + gtk_widget_show (window); +} + +int main (int argc, char **argv) { + int status = 0; + AdwApplication *app = adw_application_new ("me.sergiotarxz.recuento.installer", G_APPLICATION_FLAGS_NONE); + g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); + status = g_application_run (G_APPLICATION (app), argc, argv); + g_clear_object (&app); + return status; +} diff --git a/src/windows/launcher.c b/src/windows/launcher.c index aaccbca..44be778 100644 --- a/src/windows/launcher.c +++ b/src/windows/launcher.c @@ -91,7 +91,7 @@ void installKbdus (void) { int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR pCmdLine, int nCmdShow) { - char* argument_list[] = { _fullpath(NULL, "recuento\\\\recuento.exe", 3000), NULL }; + char* argument_list[] = { _fullpath(NULL, "recuento\\\\recuento_installer_windows.exe", 3000), NULL }; if (isInstallingKbdusNeeded ()) { installKbdus ();