我试图从一个开头不存在的文件夹中复制文件,但是会在复制之前创建。
Name "Test Installer"
OutFile "testinstaller.exe"
InstallDir C:\dev\NSIS\Scripts\Testinstaller
Section "copyTest"
SetOutPath $INSTDIR
CreateDirectory $INSTDIR\test
SetOutPath $INSTDIR\test
File test2\test.txt
SetOutPath $INSTDIR
File /nonfatal test\test.txt
SectionEnd
问题是编译器在尝试编译时创建并出错,无法找到该文件。但是,在编译程序之前创建的文件在编译之后创建并删除。