简体   繁体   English

为NSIS安装程序选择32位还是64位?

[英]Choose between 32 and 64 bit for an NSIS installer?

I have found some similar questions but I'm not totally sure that they answer my question. 我发现了一些类似的问题,但我不确定它们是否能回答我的问题。 I am needing to include Java within my installer, however, we will not know whether the client is using 32 or 64 bit and we do not want to make the assumption. 我需要在安装程序中包含Java,但是,我们将不知道客户端使用的是32位还是64位,因此我们不做假设。 We have considered just using the 32 bit JRE since it will also work on 64 bit systems and it will also not require packaging more than one JRE. 我们考虑只使用32位JRE,因为它也可以在64位系统上运行,并且不需要打包多个JRE。 We also will not know if the client has internet connectivity to have it connect and choose for the client. 我们也不会知道客户端是否具有互联网连接以使其连接并选择客户端。 Is there an easy way to decide between these two in NSIS? 在NSIS中,有没有一种简单的方法可以在这两者之间做出决定? Should I just use the 32 bit JRE and not worry about it? 我应该只使用32位JRE而不用担心吗?

NSIS has a header file with some helper macros for 64-bit stuff: NSIS有一个头文件,其中包含一些用于64位内容的帮助程序宏:

!include x64.nsh
!include LogicLib.nsh

Section
!if "${NSIS_PTR_SIZE}" >= 8
  DetailPrint "64-bit installer"
!else
  ${If} ${RunningX64}
    DetailPrint "32-bit installer on a 64-bit OS"
  ${Else}
    DetailPrint "32-bit installer on a 32-bit OS"
  ${EndIf}
!endif
SectionEnd

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM