0

NSIS スクリプトをコンパイルする前に、バッチを実行したいと考えています。

execWait を見つけました。これにより、アプリケーションのインストール中にバッチファイルが開始されます。

!execute '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

エラーは「出力ファイルを開けません」「エラー - 作成プロセスを中止しています」

ソースコードに何か問題がありますか?

4

1 に答える 1

3

試してみてください!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
于 2013-01-18T10:19:50.770 に答える