OS 비트를 기준으로 두 개의 폴더 중 하나를 설치해야하는 설치 프로그램 스크립트 작업 중입니다. 선택은 지금까지는 문제가되지 않지만 몇 가지 이유 때문에 결과 설치 프로그램에서 하나의 폴더 만 볼 수 있습니다. NSIS : 32/64 비트를 기반으로 폴더를 설치하십시오.
관련 섹션
은 다음과 같습니다 : 경고 없기 때문에;Windows 32 or 64 bit version
!include "x64.nsh"
Section "JRE 64 Bit" Section5
SectionIn RO
;Use the right java version
DetailPrint "JRE extraction..."
SetOutPath "$INSTDIR\${APPDIR}\jre"
File /a /r "${SrcDir}\..\..\jre\jre_64\jre\*.*"
DetailPrint "JRE extraction complete!"
SectionEnd
Section "JRE 32 Bit" Section6
SectionIn RO
;Use the right java version
DetailPrint "JRE extraction..."
SetOutPath "$INSTDIR\${APPDIR}\jre"
File /a /r "${SrcDir}\..\..\jre\jre_32\jre\*.*"
DetailPrint "JRE extraction complete!"
SectionEnd
Function .onInit
#Determine the bitness of the OS and enable the correct section
IntOp $0 ${SF_SELECTED} | ${SF_RO}
${If} ${RunningX64}
SectionSetFlags ${Section5} $0
SectionSetFlags ${Section6} ${SECTION_OFF}
${Else}
SectionSetFlags ${Section5} ${SECTION_OFF}
SectionSetFlags ${Section6} $0
${EndIf}
FunctionEnd
두 폴더가 존재한다. 하지만 두 개의 폴더 (jre_64 및 jre_32)를 보는 대신 설치 프로그램에서 하나의 jre 폴더 만 보게됩니다. 이 예상되는 동작은
인가? 나는 NSIS 2.51을 사용하고있다. 생성 된 스털링 기는 here입니다.
전체 스크립트 here을 볼 수 있습니다.
어떻게 든 폴더를 덮어 쓰는 것을 깨달았습니다. – javydreamercsw
섹션 플래그를 조작하려면 sections.nsh에서 도우미 매크로를 사용해야합니다. – Anders