Nsis 如何删除启动文件本身test.exe?
运行.exe文件后,我需要删除该文件,使其不再存在。 我有一个脚本,我创建了一个要运行的文件,但如何在启动后删除它Nsis 如何删除启动文件本身test.exe?,nsis,Nsis,运行.exe文件后,我需要删除该文件,使其不再存在。 我有一个脚本,我创建了一个要运行的文件,但如何在启动后删除它 Outfile test.exe Requestexecutionlevel user Setcompressor LZMA Page instfiles Section ;Not a good idea to hardcode the destination like this, ;normally you would use a directory page so the
Outfile test.exe
Requestexecutionlevel user
Setcompressor LZMA
Page instfiles
Section
;Not a good idea to hardcode the destination like this,
;normally you would use a directory page so the user can choose
SetOutPath "c:\SaveToThisFolder"
;Take thefile.txt from the system you compile on and output it on the end users system
;into the directory specified by the SetOutPath call
File "thefile.txt"
Sectionend
如何在运行后删除文件test.exe?Windows进程很难删除自身,NSIS并不真正支持它,但您可以尝试删除该文件。Sfx删除自身是不正常的,用户可以在运行它之前复制它。