2011-09-06 176 views
4

在我的安裝程序中,我想創建一個空文件。在Linux中,我會使用touch命令,但在NSIS中執行此操作的最簡單方法是什麼?如何使用NSIS創建空文件

回答

9
#Compile time 
!appendfile "$%temp%\compiletimefile.txt" "" 

;Or if you need to force the file to be empty 
!appendfile "$%temp%\compiletimefile.txt" "" 
!delfile "$%temp%\compiletimefile.txt" 
!appendfile "$%temp%\compiletimefile.txt" "" 


#Run time, method 1 
FileOpen $0 "$temp\runtimefile1.txt" w 
FileClose $0 


#Run time, method 2 
File "/oname=$temp\runtimefile2.txt" "$%temp%\compiletimefile.txt" 
+0

感謝您的解決方案。我不知道!appendfile命令。 – Oberon