Skip to content
⌘ NSIS Forum Archive

Ultra Modern UI modifies shell var context

2 posts

alexmitev#

Ultra Modern UI modifies shell var context

Hello,
I noticed the use of the Ultra Modern UI causes modification of the shell var context that I've set. Minimal reproduce program:

!include UMUI.nsh
OutFile "produce.exe"
RequestExecutionLevel user
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English" 
Function .onInit
    SetShellVarContext all
FunctionEnd
InstType "Typical" 
Section "Core Files (required)" SectionCoreFiles
    SectionIn 1 RO
    !insertmacro UMUI_GETSHELLVARCONTEXT
    Pop $0
    MessageBox MB_OK "$0" ; displays "current"!?
SectionEnd 
I get this also with MUIEx.nsh
With MUIEx.nsh I also get a fantastic "Threat blocked" fatal notification from Avast 🙂 (I cannot attach the png screenshot from Avast here)
SuperPat#
Fixed in github!
You can use, on the other hand, the UMUI_DEFAULT_SHELLVARCONTEXT define:
!include MUIEx.nsh

OutFile "produce.exe"

RequestExecutionLevel user

!define UMUI_DEFAULT_SHELLVARCONTEXT all

!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"

InstType "Typical"

Section "Core Files (required)" SectionCoreFiles
SectionIn 1 RO

!insertmacro UMUI_GETSHELLVARCONTEXT
Pop $0
MessageBox MB_OK "$0" ; displays "current"!?
SectionEnd