NSIS - 复制安装程序本身

时间:2011-10-20 01:12:41

标签: windows-installer nsis

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

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

我试过了:

CopyFiles "Installer.exe" "$INSTDIR\Installer.exe"

我在安装日志中收到“Copy Failed”。

尝试开源,读源,打开dest,写入dest:

  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个字节。

你还有其他办法吗?

谢谢!

1 个答案:

答案 0 :(得分:2)

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

CopyFiles "$ExePath" "$InstDir\"