Include CPU architecture in the RegTool filename so Library.nsh always picks the correct version

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6859 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2017-05-14 16:16:30 +00:00
parent d80b364e1d
commit ce7078517f
7 changed files with 25 additions and 32 deletions

View file

@ -121,21 +121,15 @@
;------------------------
;Setup RegTool
!ifdef NSIS_MAKENSIS64
!if "${NSIS_PTR_SIZE}" < 8
!error "Incompatible RegTool bitness, compile with 32-bit NSIS!" ; 64-bit RegTool on 32-bit Windows
!endif
!else
!if "${NSIS_PTR_SIZE}" > 4
!warning "Incompatible RegTool bitness!" ; 32-bit RegTool will probably fail to register 64-bit library
!endif
!if ! /FileExists "${NSISDIR}\Bin\RegTool-${NSIS_CPU}.bin"
!error "Missing RegTool for ${NSIS_CPU}!"
!endif
ReadRegStr $R3 HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" "${REGTOOL_KEY}"
StrCpy $R3 $R3 -4 1
IfFileExists $R3 +3
File /oname=$R2\${REGTOOL_KEY}.$__INSTALLLLIB_SESSIONGUID.exe "${NSISDIR}\Bin\RegTool.bin"
File /oname=$R2\${REGTOOL_KEY}.$__INSTALLLLIB_SESSIONGUID.exe "${NSISDIR}\Bin\RegTool-${NSIS_CPU}.bin"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \
"${REGTOOL_KEY}" '"$R2\${REGTOOL_KEY}.$__INSTALLLLIB_SESSIONGUID.exe" /S'