Adding stub installer

This commit is contained in:
sergiotarxz 2022-07-10 19:20:32 +02:00
parent c066b56b21
commit bb9b204b17
4 changed files with 53 additions and 7 deletions

View File

@ -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,

View File

@ -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);

31
src/windows/installer.c Normal file
View File

@ -0,0 +1,31 @@
#include <stdio.h>
#include <windows.h>
#include <adwaita.h>
#include <gtk/gtk.h>
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;
}

View File

@ -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 ();