【问题标题】:electron-builder nsis target include option defined macros are called during packaging, not during installationelectron-builder nsis 目标包含选项定义的宏在打包期间调用,而不是在安装期间
【发布时间】:2023-04-08 01:25:01
【问题描述】:

在 electron-builder 中,我在 build/installer.nsh 中添加了以下脚本来自定义 nsis 安装程序,但是这些命令是在打包过程中执行的,而不是在安装程序的安装过程中。

!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

任何帮助表示赞赏。

【问题讨论】:

    标签: electron electron-builder


    【解决方案1】:

    !system 似乎在打包过程中运行。 我使用以下脚本来实现目标。

        FileOpen $9 "C:\path" a
        FileWrite $9 $EXEPATH
        FileClose $9
    

    【讨论】:

      【解决方案2】:

      使用 !system 的 Exec insted。我也遇到了同样的问题

      【讨论】:

        猜你喜欢
        • 2020-07-04
        • 2020-05-26
        • 1970-01-01
        • 1970-01-01
        • 2020-01-07
        • 2011-03-07
        • 2012-07-21
        • 2017-08-19
        • 1970-01-01
        相关资源
        最近更新 更多