Files
OmniNX-Installer-Payload/source/install.h
niklascfw e71fb13bfc
All checks were successful
Build / Build (push) Successful in 10s
Update: preserve UltraHand .offload state (overlays/packages)
- Add folder_copy_switch_update_offload_aware() for update-only switch copy
- If item exists in .overlays/.offload or .packages/.offload, update in place; else copy to main
- Remove sd:/switch/.overlays from update delete list so .offload survives
- Fresh install unchanged (no offload logic)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 21:01:36 +01:00

45 lines
2.0 KiB
C

/*
* OmniNX Installer - Installation Logic
*/
#pragma once
#include "version.h"
#include <utils/types.h>
#include <stddef.h>
// Installation modes
typedef enum {
INSTALL_MODE_UPDATE, // OmniNX detected - selective deletion
INSTALL_MODE_CLEAN // No OmniNX - selective deletion from clean list
} install_mode_t;
// Main installation function
int perform_installation(omninx_variant_t pack_variant, install_mode_t mode);
// Update mode operations (install_update.c)
int update_mode_cleanup(omninx_variant_t variant);
int update_mode_install(omninx_variant_t variant);
int cleanup_staging_directory(omninx_variant_t pack_variant);
// Remove other OmniNX staging directories (Standard/Light/OC) that exist, except the one just installed
int cleanup_other_staging_directories(omninx_variant_t installed_variant);
// Clean install operations (install_clean.c)
int clean_mode_backup(void);
int clean_mode_wipe(void);
int clean_mode_restore(void);
int clean_mode_install(omninx_variant_t variant);
// Shared helpers (install.c) - used by install_update.c and install_clean.c
void install_set_color(u32 color);
void install_check_and_clear_screen_if_needed(void);
bool install_path_exists(const char *path);
int install_count_directory_items(const char *path);
void install_combine_path(char *result, size_t size, const char *base, const char *add);
int delete_path_list(const char* paths[], const char* description);
int delete_path_lists_grouped(const char *folder_display_name, ...);
int folder_delete_single_with_progress(const char *path, const char *display_name);
int folder_delete_progress_recursive(const char *path, int *deleted, int total, u32 start_x, u32 start_y, const char *display_name, int *last_percent);
int folder_copy_with_progress_v2(const char *src, const char *dst, const char *display_name);
// Update-only: copy switch/ preserving .overlays/.offload and .packages/.offload (UltraHand hide state)
int folder_copy_switch_update_offload_aware(const char *src_switch, const char *dst_base, const char *display_name);