@@ -55,16 +55,25 @@ app.whenReady().then(() => {
5555 await shell . openExternal ( url ) ;
5656 } ) ;
5757
58- // Auto-updater setup (AppImage, NSIS, DMG only — others fall back to releases page)
58+ // Auto-updater setup. Self-updatable formats download + install in-app; anything
59+ // else falls back to opening the GitHub releases page for a manual download.
5960 autoUpdater . autoDownload = false ;
6061 autoUpdater . autoInstallOnAppQuit = false ;
6162 autoUpdater . channel = 'latest' ;
6263 autoUpdater . allowPrerelease = false ;
6364
64- const updatableFormats = [ 'appimage' , 'nsis' , 'dmg' ] ;
65+ // deb/rpm/pacman self-update via the system package manager (prompts for sudo at install time).
66+ const updatableFormats = [ 'appimage' , 'nsis' , 'dmg' , 'deb' , 'rpm' , 'pacman' ] ;
6567
6668 function getInstallerType ( ) {
67- if ( process . platform === 'linux' ) return process . env . APPIMAGE ? 'appimage' : 'other' ;
69+ if ( process . platform === 'linux' ) {
70+ if ( process . env . APPIMAGE ) return 'appimage' ;
71+ try {
72+ return fs . readFileSync ( path . join ( process . resourcesPath , 'package-type' ) , 'utf8' ) . trim ( ) || 'other' ;
73+ } catch {
74+ return 'other' ;
75+ }
76+ }
6877 if ( process . platform === 'win32' ) return fs . existsSync ( path . join ( process . resourcesPath , '..' , 'Uninstall LiaScript-Exporter.exe' ) ) ? 'nsis' : 'other' ;
6978 if ( process . platform === 'darwin' ) return 'dmg' ;
7079 return 'other' ;
@@ -82,8 +91,8 @@ app.whenReady().then(() => {
8291 if ( mainWindow ) mainWindow . webContents . send ( 'update:downloaded' ) ;
8392 } ) ;
8493
85- autoUpdater . on ( 'error' , ( ) => {
86- if ( mainWindow ) mainWindow . webContents . send ( 'update:error' ) ;
94+ autoUpdater . on ( 'error' , ( err ) => {
95+ if ( mainWindow ) mainWindow . webContents . send ( 'update:error' , { message : err && ( err . message || String ( err ) ) } ) ;
8796 } ) ;
8897
8998 ipcMain . handle ( 'app:checkForUpdates' , async ( ) => {
0 commit comments