@@ -9,6 +9,39 @@ export default {
99 executableName : "inav-configurator" ,
1010 asar : false ,
1111 icon : 'images/inav' ,
12+ extraResource : [
13+ 'resources/public/sitl'
14+ ] ,
15+ afterCopy : [
16+ ( buildPath , electronVersion , platform , arch , callback ) => {
17+ // Remove SITL binaries for other platforms/architectures to reduce package size
18+ const sitlPath = path . join ( buildPath , 'resources' , 'sitl' ) ;
19+ if ( platform === 'win32' ) {
20+ fs . rmSync ( path . join ( sitlPath , 'linux' ) , { recursive : true , force : true } ) ;
21+ fs . rmSync ( path . join ( sitlPath , 'macos' ) , { recursive : true , force : true } ) ;
22+ } else if ( platform === 'darwin' ) {
23+ fs . rmSync ( path . join ( sitlPath , 'linux' ) , { recursive : true , force : true } ) ;
24+ fs . rmSync ( path . join ( sitlPath , 'windows' ) , { recursive : true , force : true } ) ;
25+ } else if ( platform === 'linux' ) {
26+ fs . rmSync ( path . join ( sitlPath , 'macos' ) , { recursive : true , force : true } ) ;
27+ fs . rmSync ( path . join ( sitlPath , 'windows' ) , { recursive : true , force : true } ) ;
28+ // Remove wrong architecture
29+ if ( arch === 'x64' ) {
30+ fs . rmSync ( path . join ( sitlPath , 'linux' , 'arm64' ) , { recursive : true , force : true } ) ;
31+ } else if ( arch === 'arm64' ) {
32+ // Move arm64 binary to linux root and remove x64
33+ const arm64Binary = path . join ( sitlPath , 'linux' , 'arm64' , 'inav_SITL' ) ;
34+ const destBinary = path . join ( sitlPath , 'linux' , 'inav_SITL' ) ;
35+ if ( fs . existsSync ( arm64Binary ) ) {
36+ fs . rmSync ( destBinary , { force : true } ) ;
37+ fs . renameSync ( arm64Binary , destBinary ) ;
38+ fs . rmSync ( path . join ( sitlPath , 'linux' , 'arm64' ) , { recursive : true , force : true } ) ;
39+ }
40+ }
41+ }
42+ callback ( ) ;
43+ }
44+ ] ,
1245 } ,
1346 rebuildConfig : { } ,
1447 plugins : [
0 commit comments