Install a snap.
The snap contents are provided in the form of an input stream. To install from a local file, do the following:
|[ g_autoptr(GFile) file = g_file_new_for_path (path_to_snap_file); g_autoptr(GInputStream) stream = g_file_read (file, cancellable, &error); snapd_client_install_stream_sync (self, stream, progress_cb, NULL, cancellable, &error); \]
Or if you have the file in memory you can use:
|[ g_autoptr(GInputStream) stream = g_memory_input_stream_new_from_data (data, data_length, free_data); snapd_client_install_stream_sync (self, stream, progress_cb, NULL, cancellable, &error); \]
this |
a Client. |
flags |
a set of InstallFlags to control install options. |
stream |
a InputStream containing the snap file contents to install. |
progress_callback |
function to callback with progress. |
cancellable |
a Cancellable or null. |
progress_callback_data |
user data to pass to |
true on success or false on error. |