[electron] electron-builder를 사용할 때 vc_redist.exe 실행하기
electron으로 윈도용 프로그램을 만들고 있는데
어찌어찌하다 보니 vc++ redistributable 파일을 설치해야 할 필요가 생겼습니다.
추가로 파일을 설치하는 것도 NSIS 스크립트로 간단하게 해결할 수 있습니다.
NSIS 스크립트
https://www.electron.build/configuration/nsis.html#custom-nsis-script
NSIS - electron-builder
NSIS The top-level nsis key contains set of options instructing electron-builder on how it should build NSIS target (default target for Windows). These options also applicable for Web installer, use top-level nsisWeb key. oneClick = true Boolean - Whether
www.electron.build
1. installer.nsh
installer.nsh 파일을 build 폴더 밑에 만듭니다.
2. vc_redist.exe
build 폴더 밑에 추가로 설치하고 싶은 파일을 복사합니다.
3. customInstall 매크로
!macro customInstall
File /oname=$PLUGINSDIR\VC_redist.x64.exe "${BUILD_RESOURCES_DIR}\vc_redist.exe"
ExecWait '"$PLUGINSDIR\vc_redist.exe" /passive /norestart'
!macroend
installer.nsh 파일에 customInstall 매크로를 만들고 필요한 내용을 추가합니다.
여기까지 찾는데 한참 걸렸는데 딱 4줄이면 끝나는군요!
2022.08.05 - [ELECTRON] - [electron] Windows 에서 electron-builder를 사용할 때 프로그램 설치 폴더 변경하기.