[Electron] APPIMAGE env is not defined, current application is not an AppImage

2024. 9. 24. 13:51·개발 ━━━━━/Troubleshoot
반응형

문제

 

Linux 환경에서 앱을 빌드하고 electron-updater (autoUpdater) 의 checkForUpdatesAndNotify() 함수가 작동되면

위처럼 APPIMAGE 가 정의되지 않았다 뜨고 업데이트 확인 기능이 실행되지 않는다.

 

Windows 환경에서는 문제가 없고

Linux 에서는 APPIMAGE 환경변수가 따로 필요한 것 같다.

 

해결

app.js 에

const os = require('os');
const path = require('path');

const platform = os.platform();

if(platform == 'linux'){
  process.env.APPIMAGE = path.join(__dirname, 'dist', `*-${app.getVersion()}.AppImage`)
}

로 APPIMAGE 를 선언해주는데

dist 파일 안에 APPIMAGE 가 생성되므로 dist 폴더 안,

그 뒤에는 파일명을 기재해주면 된다.

 

나는 생성되는 AppImage 이름에 버전 정보가 들어가므로 ${app.getVersion()} 처럼 변수화해주었다.

 

 

매우 잘 되는 것을 확인!

 

(dev 환경에서는 auto update 가 작동이 안되는 것이 정상이다.)

 

 

참고

https://github.com/electron-userland/electron-builder/issues/3167

반응형

'개발 ━━━━━ > Troubleshoot' 카테고리의 다른 글

[Ubuntu] '/swapfile': Text file busy  (0) 2024.09.24
[MySQL] Invalid MySQL server downgrade: Cannot downgrade from 80300 to 80200. Downgrade is only permitted between patch releases  (1) 2024.03.18
[Nginx] default.conf 에 환경변수 적용하기  (0) 2024.03.02
[Redis] NOAUTH Authentication required  (0) 2024.01.10
[Docker] Spring + MySQL + AWS EC2 + Github Actions + Docker 를 활용한 프로젝트 진행하면서 발생했던 각종 오류들  (1) 2024.01.08
'개발 ━━━━━/Troubleshoot' 카테고리의 다른 글
  • [Ubuntu] '/swapfile': Text file busy
  • [MySQL] Invalid MySQL server downgrade: Cannot downgrade from 80300 to 80200. Downgrade is only permitted between patch releases
  • [Nginx] default.conf 에 환경변수 적용하기
  • [Redis] NOAUTH Authentication required
GukJang
GukJang
•  ⌘ ⌥ •
    반응형
  • GukJang
    SPACE
    GukJang
  • 전체
    오늘
    어제
    • Blog (73)
      • 개발 ━━━━━ (68)
        • Java (14)
        • C++ (1)
        • HTML (1)
        • Spring(boot) (7)
        • Dev (9)
        • SQL (1)
        • CS (2)
        • Git (1)
        • Troubleshoot (14)
        • Algorithm (2)
        • Definition (1)
        • Dev Life (2)
        • TIL (7)
        • 항해 (6)
      • 공돌 ━━━━━ (4)
        • 플젝 (2)
        • 장비 (1)
        • 부품 (1)
      • 독서 ━━━━━ (1)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
    • 글쓰기
  • 링크

    • Github
  • 공지사항

  • 인기 글

  • 태그

    AWS
    mysql
    docker
    Python
    docker volume
    electron-builder
    사전 스터디
    백준
    자바
    오픈소스 기여
    마이크로파이썬
    CI CD
    항해99
    SpringBoot
    micropython
    Java
    알고리즘
    spring
    github actions
    EC2
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
GukJang
[Electron] APPIMAGE env is not defined, current application is not an AppImage
상단으로

티스토리툴바