我使用Inno Setup版本5.4.2。
我想定义要复制的文件的路径([Files]部分中的Source:参数为两个部分,一个基本路径和子目录名称,我用于特殊文件(如.dlls)。
我试过以下:
- #define MyAppSetupDir "D:\MyApp\setup"
- #define MyAppSetupQtDLLs {#MyAppSetupDir}"\DLLs"
- [Files]
- Source: {#MyAppSetupDir}\MyApp.exe; DestDir: {app}; Flags: ignoreversion
- Source: {#MyAppSetupDLLs}\mstext35.dll; DestDir: {app}; Flags: ignoreversion
但我得到以下编译错误
- [ISPP] Expression expected but opening brace ("{") found.
我也试着把括号括在“”中,喜欢
- #define MyAppSetupQtDLLs "{#MyAppSetupDir}\DLLs"
但这一次我得到了
- Error: Source file "D:\MyApp\setup\{#MyAppSetupDir}\DLLs\mstext35.dll" does not exist.
因此,ISSP正确地替换了MyAppSetupDir变量,但后来又放入了简单的文本,就好像它不能识别指令一样。
我已经搜索无处不在,我已经发现了一个discussion关于使用{commonappdata},但我不能找到如何做到这一点,在文档和知识库。
我真的很感激一些提示,因为它看起来我很接近,但没有找到正确的解决方案。
解决方法
- #define MyAppSetupDir "D:\MyApp\setup"
- #define MyAppSetupQtDLLs MyAppSetupDir + "\DLLs"