使用Nullsoft安装应用程序时,如何根据32/64位显示目标文件夹中的路径windows OS

When installing the application using Nullsoft, how to display the path in the Destination Folder based on the 32/64 bit windows OS

使用 NULLSOFT 安装应用程序时,我想根据 32/64 位 windows 操作系统显示目标文件夹中的路径。

如果是32位的话应该是

C:\Program Files\

如果是64位的话应该是

C:\Program Files (x86)\

我在脚本中使用了InstallDir "$PROGRAMFILES64\ "。因此它显示了 32/64 位 OS.

C:\Program Files\

如果有谁有什么想法,请帮帮我。

您无需做任何特别的事情,NSIS 会为您处理。

InstallDir $ProgramFiles32\MyApp
Page Directory
Page InstFiles

将在 32 位 Windows 上使用 X:\Program Files\,在 64 位 Windows 上使用 X:\Program Files (x86)\

$ProgramFiles 是生成 32 位安装程序时 $ProgramFiles32 的别名,生成 64 位安装程序时 $ProgramFiles64 的别名。

$ProgramFiles64 只应在安装 64 位应用程序时使用!