3

我尝试按以下方式使用宏/变量,但随后出现错误。你能建议吗?

#define AnnotateDir "C:\Users\new_skin\Annotate\project"
#define AnnotateUserInstallAppData "{userappdata}\Annotate3"


[Files]
Source: {AnnotateDir}\bin\gm_annotate.exe; DestDir: {app}; Flags:  ignoreversion  external

在此处输入图像描述

4

1 回答 1

6

您在脚本预处理阶段#使用的变量名之前缺少 char 。emit defined variable value您可以通过以下方式修复脚本:

#define AnnotateDir "C:\Users\new_skin\Annotate\project"  

[Files]
Source: {#AnnotateDir}\bin\gm_annotate.exe; DestDir: {app}; Flags: ignoreversion external

它看起来很误导,但是例如{app}常量将在预处理后保留,而您定义的变量将被其值替换,因此这就是它们在脚本中具有不同符号的原因。

于 2013-07-26T12:39:31.857 回答