Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create empty file with NSIS

Tags:

nsis

In my installer I would like to create an empty file. In linux I would use the touch command, but what's the easiest way to do this in NSIS?

like image 658
Oberon Avatar asked Dec 16 '22 09:12

Oberon


1 Answers

#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"
like image 134
Anders Avatar answered May 09 '23 06:05

Anders