Inno设置 - 文件复制

时间:2014-10-27 16:00:44

标签: scripting installation inno-setup

我在InnoTools Downloader上使用Inno Setup,下载完成后我想将下载的文件复制到所选目录。

 if CurStep=ssPostInstall then begin
    FileCopy('Test.exe', ExpandConstant('{app}\Test.exe'), False);

它没有做任何事情,但如果我重新启动安装程序并再次安装到同一文件夹,那么它就会复制该文件。怎么可能或我做错了什么?如果我这样做,那么它每次都能正常工作:

 if CurStep=ssPostInstall then begin
    FileCopy('Test.exe', 'Test1.exe', False);

1 个答案:

答案 0 :(得分:0)

我使用{src] constans解决了:

// Add the file
itd_addfile('http://test.com/Test.exe',ExpandConstant('{src}\Test.exe'));

// Copy the file when it's finished the download
FileCopy(ExpandConstant('{src}\Test.exe'), ExpandConstant('{app}\Test.exe'), False);
// Delete the old file
DeleteFile(ExpandConstant('{src}\Test.exe'));