Archive: How can I query SetShellVarContext?


How can I query SetShellVarContext?
I want to find out what context the installer is in, but I can't figure out how to get the value of SetShellVarContext. Can someone point me in the right direction?

Russ...


There doesn't seem to be a built-in function to do this. So it would probably take a plugin or perhaps a DLL call using the system plugin.

But, I have to ask what the point would be? What's wrong with just calling SetShellVarContext to set the install appropriately as needed?


Yes it is possible,

we can do like this:

;Get the current ShellVarContext
StrCpy $R0 "$SMPROGRAMS"
SetShellVarContext current
StrCmp $R0 "$SMPROGRAMS" 0 +3
StrCpy $R0 "current"
Goto +3
StrCpy $R0 "all"
SetShellVarContext all


$R0 contain "current" or "all"

Enjoy ;)

Hey SuperPat,
Clever function! :up:


Thanks SuperPat, that's perfect.

Russ...