Windows installer NSIS-复制安装程序本身

Windows installer NSIS-复制安装程序本身,windows-installer,nsis,Windows Installer,Nsis,我想将安装程序复制到安装位置 我正在运行文件:Installer.exe 我希望它能复制到$INSTDIR 我试过: CopyFiles "Installer.exe" "$INSTDIR\Installer.exe" 我在安装日志中看到“复制失败” 试图打开源代码、读取源代码、打开目标、写入目标: FileOpen $4 "Installer.exe" r FileRead $4 $1 80000 FileClose $4 FileOpen $4 "$INSTDIR\Ins

我想将安装程序复制到安装位置

我正在运行文件:Installer.exe 我希望它能复制到$INSTDIR

我试过:

CopyFiles "Installer.exe" "$INSTDIR\Installer.exe"
我在安装日志中看到“复制失败”

试图打开源代码、读取源代码、打开目标、写入目标:

  FileOpen $4 "Installer.exe" r
  FileRead $4 $1 80000
  FileClose $4

  FileOpen $4 "$INSTDIR\Installer.exe" w
  FileWrite $4 $1
  FileClose $4
它创建$INSTDIR\Installer.exe 但是在安装过程之后,它得到了0个字节

你有别的办法吗


谢谢

您应该使用完整路径,$ExePath是安装程序本身的完整路径

CopyFiles "$ExePath" "$InstDir\"