开发者

Why is NSIS check for JRE broken?

开发者 https://www.devze.com 2023-01-21 04:46 出处:网络
Why does this script try to install the jre when it doesn\'t need to? I verified that C:\\Windows\\System32\\java.exe does in fact exist, but this script doesn\'t see it. The script is targeting XP, V

Why does this script try to install the jre when it doesn't need to? I verified that C:\Windows\System32\java.exe does in fact exist, but this script doesn't see it. The script is targeting XP, Vista, 32 bit, and 64 bit. The script !includes x64.nsh. The reason for the first ElseIf is that the javaw.exe is sometimes installed in C:\Windows\System32\ on 64 bit systems. Is the logic bogus? If so, how? Is the use of C:\Windows\System32\javaw.exe improper?

${If} ${FileExists} `$SYSDIR\javaw.exe`
    ; Skip JRE install
${ElseIf} ${FileExists} `C:\Windows\System32\javaw.exe`
    ; Skip JRE install
${ElseIf} ${RunningX64}
开发者_StackOverflow社区    ExecWait '"jre-6u22-windows-x64.exe"'
${Else}
    ExecWait '"jre-6u22-windows-i586-s.exe"'
${EndIf}


Needed Unless blocks and DisableX64FSRedirection.

${If} ${RunningX64} 
    ${DisableX64FSRedirection} 
    ${Unless} ${FileExists} "$SYSDIR\javaw.exe" 
        ExecWait '"jre-6u22-windows-x64.exe"'
    ${EndUnless} 
    ${EnableX64FSRedirection} 
${Else}  
    ${Unless} ${FileExists} "$SYSDIR\javaw.exe" 
        ExecWait '"jre-6u22-windows-i586-s.exe"'
    ${EndUnless} 
${EndIf}  
0

精彩评论

暂无评论...
验证码 换一张
取 消