Skip to content

Windows facts

Usage getWinVer(field) → int

if getWinVer("MAJOR") >= 10 then detailPrint("modern") end

Usage getKnownFolderPath(knownFolderId) → string

SetShellVarContext / GetShellVarContext / IfShellVarContextAll

Section titled “SetShellVarContext / GetShellVarContext / IfShellVarContextAll”

Whether $SMPROGRAMS and its relatives mean the current user’s or every user’s.

Usage setShellVarContext("all" | "current" | "lastused") · getShellVarContext() → string · shellVarContextAll() → boolean

setShellVarContext("all")

Which half of the registry a 32-bit installer sees on a 64-bit machine. "32" and "64" are enum members rather than numbers: the argument names a view rather than counting anything.

Usage setRegView("32" | "64" | "default" | "lastused") · getRegView() → string · altRegView() → boolean

setRegView("64")

The conditions of the stock x64.nsh: whether Windows is 64-bit, whether this installer runs under WOW64, and which processor the machine really has.

Usage runningX64() → boolean · wow64() → boolean · nativeMachine("IA32" | "AMD64" | "ARM64") → boolean

if runningX64() then setRegView("64") end
if nativeMachine("ARM64") then detailPrint("ARM64, under emulation") end