Installation 使用Inno安装程序从子目录(相对路径)安装外部文件
我想安装一个外部文件 我的安装程序位于Installation 使用Inno安装程序从子目录(相对路径)安装外部文件,installation,inno-setup,Installation,Inno Setup,我想安装一个外部文件 我的安装程序位于 c:\somedir\setup.exe c:\somedir\download\MyApp.exe 外部文件位于 c:\somedir\setup.exe c:\somedir\download\MyApp.exe 我的代码是 [Files] Source:"\download\MyApp.exe"; DestDir: "{app}";Flags: external skipifsourcedoesntexist 由于某些原因,Inno安装程序
c:\somedir\setup.exe
c:\somedir\download\MyApp.exe
外部文件位于
c:\somedir\setup.exe
c:\somedir\download\MyApp.exe
我的代码是
[Files]
Source:"\download\MyApp.exe"; DestDir: "{app}";Flags: external skipifsourcedoesntexist
由于某些原因,Inno安装程序似乎找不到此文件
谁能告诉我我做错了什么
谢谢。使用{src}常量:
[Files]
Source:"{src}\download\MyApp.exe"; DestDir: "{app}";Flags: external skipifsourcedoesntexist
你有两个问题:
- 相对于
的路径c:\somedir\
解析为\download\MyApp.exe
,因为前导的c:\download\MyApp.exe
返回根文件夹。您需要使用\
下载\MyApp.exe
- Inno安装程序不会解析相对于安装程序的外部文件路径。您必须使用完整路径,请参阅以下文档:
当指定标志
时,external
必须是分发媒体或用户系统(例如“{src}\license.ini”)上现有文件(或通配符)的完整路径名 您可以使用获取安装程序文件夹的完整路径Source
干得好<代码>标志:外部帮助!