WMI query/logic not working
I am using the WMI header:
http://nsis.sourceforge.net/WMI_header
${WMIGetInfo} rootCIMV2 Win32_SystemEnclosure ChassisTypes fnc_Laptop_Test
>
I get in my log file for ex., Processing detected chassis type: {1}Function fnc_Laptop_Test
insertmacro logme ${INSTLOG} "- Processing detected chassis type: $R2" l
${If} $INSTALL_VPN != ""
goto _func-end
${EndIf}
!
${If} $R2 == "{1}"
!insertmacro logme ${INSTLOG} "- Chassis Type: Other" l
${ElseIf} $R2 == "{2}"
!insertmacro logme ${INSTLOG} "- Chassis Type: Unknown" l
${ElseIf} $R2 == "{3}"
StrCpy $INSTALL_VPN 0
!insertmacro logme ${INSTLOG} "- Chassis Type: Desktop" l
!insertmacro logme ${INSTLOG} "- Desktop Detected" l
${ElseIf} $R2 == "{4}"
StrCpy $INSTALL_VPN 0
!insertmacro logme ${INSTLOG} "- Chassis Type: Low Profile Desktop" l
!insertmacro logme ${INSTLOG} "- Desktop Detected" l
${ElseIf} $R2 == "{5}"
StrCpy $INSTALL_VPN 0
!insertmacro logme ${INSTLOG} "- Chassis Type: Pizza Box" l
!insertmacro logme ${INSTLOG} "- Desktop Detected" l
${ElseIf} $R2 == "{6}"
StrCpy $INSTALL_VPN 0
!insertmacro logme ${INSTLOG} "- Chassis Type: Mini Tower" l
!insertmacro logme ${INSTLOG} "- Desktop Detected" l
${ElseIf} $R2 == "{7}"
StrCpy $INSTALL_VPN 0
!insertmacro logme ${INSTLOG} "- Chassis Type: Tower" l
!insertmacro logme ${INSTLOG} "- Desktop Detected" l
${ElseIf} $R2 == "{8}"
StrCpy $INSTALL_VPN 1
!insertmacro logme ${INSTLOG} "- Chassis Type: Portable" l
!insertmacro logme ${INSTLOG} "- Laptop Detected" l
${ElseIf} $R2 == "{9}"
StrCpy $INSTALL_VPN 1
!insertmacro logme ${INSTLOG} "- Chassis Type: Laptop" l
!insertmacro logme ${INSTLOG} "- Laptop Detected" l
${ElseIf} $R2 == "{10}"
StrCpy $INSTALL_VPN 1
!insertmacro logme ${INSTLOG} "- Chassis Type: Notebook" l
!insertmacro logme ${INSTLOG} "- Laptop Detected" l
${ElseIf} $R2 == "{11}"
!insertmacro logme ${INSTLOG} "- Chassis Type: Hand Held" l
${ElseIf} $R2 == "{12}"
StrCpy $INSTALL_VPN 1
!insertmacro logme ${INSTLOG} "- Chassis Type: Docking Station" l
!insertmacro logme ${INSTLOG} "- Laptop Detected" l
${ElseIf} $R2 == "{13}"
StrCpy $INSTALL_VPN 0
!insertmacro logme ${INSTLOG} "- Chassis Type: All in One" l
!insertmacro logme ${INSTLOG} "- Desktop Detected" l
${ElseIf} $R2 == "{14}"
StrCpy $INSTALL_VPN 1
!insertmacro logme ${INSTLOG} "- Chassis Type: Sub Notebook" l
!insertmacro logme ${INSTLOG} "- Laptop Detected" l
${ElseIf} $R2 == "{15}"
StrCpy $INSTALL_VPN 0
!insertmacro logme ${INSTLOG} "- Chassis Type: Space-Saving" l
!insertmacro logme ${INSTLOG} "- Desktop Detected" l
${ElseIf} $R2 == "{16}"
StrCpy $INSTALL_VPN 0
!insertmacro logme ${INSTLOG} "- Chassis Type: Lunch Box" l
!insertmacro logme ${INSTLOG} "- Desktop Detected" l
${ElseIf} $R2 == "{17}"
!insertmacro logme ${INSTLOG} "- Chassis Type: Main System Chassis" l
${ElseIf} $R2 == "{18}"
StrCpy $INSTALL_VPN 1
!insertmacro logme ${INSTLOG} "- Chassis Type: Expansion Chassis" l
!insertmacro logme ${INSTLOG} "- Laptop Detected" l
${ElseIf} $R2 == "{19}"
!insertmacro logme ${INSTLOG} "- Chassis Type: Sub Chassis" l
${ElseIf} $R2 == "{20}"
!insertmacro logme ${INSTLOG} "- Chassis Type: Bus Expansion Chassis" l
${ElseIf} $R2 == "{21}"
StrCpy $INSTALL_VPN 1
!insertmacro logme ${INSTLOG} "- Chassis Type: Peripheral Chassis" l
!insertmacro logme ${INSTLOG} "- Laptop Detected" l
${ElseIf} $R2 == "{22}"
!insertmacro logme ${INSTLOG} "- Chassis Type: Storage Chassis" l
${ElseIf} $R2 == "{23}"
!insertmacro logme ${INSTLOG} "- Chassis Type: Rack Mount Chassis" l
${ElseIf} $R2 == "{24}"
!insertmacro logme ${INSTLOG} "- Chassis Type: Sealed-Case PC" l
${EndIf}
_func-end:
FunctionEnd
>
Which means $R2 == "{1}"
But it is not processing the logic for that variable... I am not sure if it is returning some type of ascii that is not making it truly = to {1}. I do see in the WMI.nsh file they are stripping CRLF's...
1
>
This is the next like, I am not sure 110% what it is doing, but almost looks like it is adding back in a new line..
"$\n" "$1"
Any Help would be appreciated...Thanks,
Squirre1