如何根据默认的Inno Setup变量设置ISPP定义? [英] How to set ISPP defines based on default Inno Setup variables?

查看:723
本文介绍了如何根据默认的Inno Setup变量设置ISPP定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图:

  #define CommonAppData {commonappdata} 
/ pre>

但它会产生:


编译器错误



[ISPP]表达式预期但是打开大括号({)。


使用Inno Setup PreProcessor实现这一点?

解决方案

{commonappdata} 不能在编译时扩展,即预处理器运行,因为它只在运行时已知:它标识在运行编译安装程序的机器上的通用应用程序数据目录



也许如果你能澄清你打算如何使用这个定义,我们可能能够帮助。如果您真正感兴趣的不是目标机器上的常见应用程序数据目录,而是在开发机器上,那么您可以使用以下操作:

  #define CommonAppData GetEnv(COMMONAPPDATA)

您打算使用这个定义来填充Inno属性,这些属性本身能够在运行时扩展常量,那么你应该使用这个:

  #define CommonAppData{commonappdata}

希望这有帮助。


I was trying to:

#define CommonAppData {commonappdata}

but it yields:

Compiler Error

[ISPP] Expression expected but opening brace ("{") found.

How to achieve this with Inno Setup PreProcessor?

解决方案

{commonappdata} cannot be expanded at compile time, i.e. when the pre-processor runs because it is only known at runtime: It identifies the common application data directory on the machine where the compiled installer is run.

Maybe if you could clarify how you intend to use that define we might be able to help. If for example what you're really interested in is not the common app data directory on the target machine but the one on the developer machine, then you can probably use this:

#define CommonAppData GetEnv("COMMONAPPDATA")

If however you intend to use that define for populating Inno properties that are themselves capable of expanding the constant at runtime then you should use this:

#define CommonAppData "{commonappdata}"

Hope this helps.

这篇关于如何根据默认的Inno Setup变量设置ISPP定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆