In electron-builder, I've added the below script inside build/installer.nsh to customize the nsis installer but the commands are executed during packaging process, not during installation of the installer.
!macro customHeader
!system "echo 'customHeader' > ${BUILD_RESOURCES_DIR}\customHeader"
!macroend
!macro preInit
!system "echo ${BUILD_RESOURCES_DIR} C:\resourcedirpath"
!system "echo 'preInit' > ${BUILD_RESOURCES_DIR}\preInit"
!macroend
!macro customInit
!system "echo 'customInit' > ${BUILD_RESOURCES_DIR}\customInit"
!macroend
!macro customInstall
!system "echo 'customInstall' > ${BUILD_RESOURCES_DIR}\customInstall"
!macroend
!macro customUnInstall
!system "echo 'customUnInstall' > ${BUILD_RESOURCES_DIR}\customUnInstall"
!macroend
Any help appreciated.