是否有变量 "like" $PROGRAMFILES 设置为匹配目标系统的位宽?

Is there a variable "like" $PROGRAMFILES that is set to match bit width of target system?

我需要更改安装程序脚本以将文件放入 C:\Program Files (x86)(32 位)和 C:\Program Files(64 位)。

我希望 $PROGRAMFILES 是正确的变量,但从文档来看,这总是指向 C:\Program Files (x86)

"The program files directory (usually C:\Program Files but detected at runtime).
On Windows x64, $PROGRAMFILES and $PROGRAMFILES32 point to C:\Program Files (x86)
while $PROGRAMFILES64 points to C:\Program Files. Use $PROGRAMFILES64 when
installing x64 applications."

我熟悉如何在安装时使用 ${If} ${RunningX64} 测试系统,但脚本中有许多 $PROGRAMFILES 条目,所以我想完全避免这种方法可能。

是否有自动设置的不同变量?

否没有与系统匹配的程序文件变量。 $PROGRAMFILES 匹配安装程序的位数。

如果您需要匹配系统的位数,那么您必须创建自己的变量并在 .onInit 中对其进行初始化。 $PROGRAMFILES64 在 32 位系统上可能会降级为 $PROGRAMFILES32,但我不确定我是否会赞同这样使用它。

这通常不是问题,因为您在引用目标文件夹时应该使用 $InstDir