NSIS - 在编译之前运行批处理文件

时间:2013-01-18 10:11:16

标签: batch-file nsis

我想在编译NSIS脚本之前运行批处理。

我找到了execWait。这将在安装我的应用程序时启动批处理文件。

我也试过了!执行' batch.bat'但是我在编译时遇到错误。

这是我的批处理文件的内容:

@echo off
@type file.txt > destination.txt
@echo. >> destination.txt
@svnversion.exe >> destination.txt

1。更新

这是我在我的nsi文件中放入的内容,但它不起作用。

!tempfile BAT
!appendfile "${BAT}.cmd" "@echo off$\r$\n"
!appendfile "${BAT}.cmd" "@type file.txt > destination.txt$\r$\n"
!appendfile "${BAT}.cmd" "@echo. >> destination.txt$\r$\n"
!appendfile "${BAT}.cmd" "@svnversion.exe >> destination.txt$\r$\n"
!system '"${BAT}.cmd"'
!delfile "${BAT}.cmd"
!undef BAT

错误是"无法打开输出文件" "错误 - 中止创建过程"

源代码中有什么问题吗?

1 个答案:

答案 0 :(得分:1)

尝试!system

您甚至可以在.nsi:

中创建批处理文件
!tempfile BAT
!appendfile "${BAT}.cmd" "@echo off$\r$\n"
!appendfile "${BAT}.cmd" "@echo Hello$\r$\n"
!system '"${BAT}.cmd"'
!delfile "${BAT}.cmd"
!undef BAT
相关问题