我知道之前问过这个问题的标题几乎相同。但是回答者没有为我提供足够的信息来解决问题。我的问题也似乎有所不同。
我正在使用Inno下载插件
我的来源看起来像
[Components]
Name: "dl"; Description: "{cm:DLMessage}"; Types: full fullService
Name: "dl\aaa"; Description: "aaa111"; Types: full fullService;
Name: "dl\bbb"; Description: "bbb222"; Types: full fullService;
Name: "dl\ccc"; Description: "ccc333"; Types: full fullService;
[Code]
procedure InitializeWizard();
begin
idpAddFileComp('ftp://user:[email protected]/folder/myFile1.exe', ExpandConstant('{app}\subfolder\Download\myFile1.exe'), 'dl\aaa');
idpAddFileComp('ftp://user:[email protected]/folder/myFile2.exe', ExpandConstant('{app}\subfolder\Download\myFile2.exe'), 'dl\bbb');
idpAddFileComp('ftp://user:[email protected]/folder/myFile3.exe', ExpandConstant('{app}\subfolder\Download\myFile3.exe'), 'dl\ccc');
idpDownloadAfter(wpReady);
end;
我要实现的是根据对组件所做的选择下载一些文件。
由于即时消息是相对新颖的...答案
原型:
函数WizardDirValue:字符串;
对我说的一样,如果您尝试告诉牙医如何修理汽车:)
我想{app}
在InitializeWizard中使用,但即使有给定的“提示”,我也没有方法。有人可以向我解释吗?(谷歌并没有真正帮助我)
该InitializeWizard
事件方法触发创建向导形式之后,所以现在还太早到传递{app}
目录插件(该WizardDirValue
功能会做同样的),因为用户没有通过目录输入页面。您将需要将代码移动到用户选择目录后触发的事件中。
尝试这样的事情:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
[Code]
procedure InitializeWizard;
begin
// only tell the plugin when we want to start downloading
idpDownloadAfter(wpReady);
end;
procedure CurPageChanged(CurPageID: Integer);
begin
// if the user just reached the ready page, then...
if CurPageID = wpReady then
begin
// because the user can move back and forth in the wizard, this code branch can
// be executed multiple times, so we need to clear the file list first
idpClearFiles;
// and add the files to the list; at this time, the {app} directory is known
idpAddFileComp('ftp://user:[email protected]/folder/myFile1.exe', ExpandConstant('{app}\subfolder\Download\myFile1.exe'), 'dl\aaa');
idpAddFileComp('ftp://user:[email protected]/folder/myFile2.exe', ExpandConstant('{app}\subfolder\Download\myFile2.exe'), 'dl\bbb');
idpAddFileComp('ftp://user:[email protected]/folder/myFile3.exe', ExpandConstant('{app}\subfolder\Download\myFile3.exe'), 'dl\ccc');
end;
end;
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句