Inno Setup - #define指令 - 如何通过字符串发出预处理器变量?

时间:2015-01-27 10:48:41

标签: inno-setup

如果标题错了我很抱歉。我将解释我的要求。

我需要动态地在Script.values中基于*_CLSID设置类ID AppName。 (这里"{{5c587137-edfd-4b32-952a-62bf5d10bg23}}"

Sample.iss

;This can be modified by User who Build installer
#define MyAppName "App1"

;This is my two Applications Class id's
#define App1_CLSID "{{5c587137-edfd-4b32-952a-62bf5d10bg23}}"
#define App2_CLSID "{{8c583137-4dfd-4b42-962a-6234fd10bg23}}"

;CLSID name set dynamically with help of MyAppName
#define CLSID MyAppName+"_CLSID"

[Registry]
Root: HKCR; Subkey: "Application\CLSID"; ValueType: string; ValueName: ""; ValueData:{#{#CLSID}}; Flags: uninsdeletekey

我尝试ValueData:{#{#CLSID}}来设置CLASS Id  ValueData:{{5c587137-edfd-4b32-952a-62bf5d10bg23}}

但抛出错误[ISPP] Expression expected but opening brace ("{") found.

此处{#CLSID}表示"App1_CLSID"。我认为{#{#CLSID}}{#App1_CLSID}相同。

如何解决这个问题?

提前致谢..

0 个答案:

没有答案