Archive: APPDATA do not change with SetShellVarContext all in InstallDir


APPDATA do not change with SetShellVarContext all in InstallDir
Hello, I am trying to make a little installation file with NSIS.

I need to install all files under ALL user ProgramData folder but even I use the flag "SetShellVarContext all" in my section the installer always show me the programData user folder...

It show me always for example under my Windows 7 (64)

C:\Users\fmorales\AppData\Roaming
and not
c:\ProgramData ....

I copy here my code ... any help would be very apreciate.

Thanks a lot

; *********************************************************
; ********* E X T E R N A L V A L U E S *********
; *********************************************************
RequestExecutionLevel admin
!include ExternalValues.nsi

; *********************************************************
!define TEST_PLATFORM_NAME_VER "${TEST_PLATFORM_NAME} ${TEST_PLATFORM_VER}"

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "${DELIVERY_NAME}"
!define PRODUCT_VERSION "${DELIVERY_VERSION}"
!define PRODUCT_NAME_VERSION "${DELIVERY_NAME} ${DELIVERY_VERSION}"
!define PRODUCT_PUBLISHER "XXXXXXXX,ICN."
!define PRODUCT_WEB_SITE "http://www.xxxxxxx.com"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME_VERSION}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_BRAND "xxxxx"
!define TEST_PLATFORM_REGKEY "SOFTWARE\xxxxxxx\TestPlatforms"
!define PRODUCT_RAPTOR_REGKEY "Software\xxxxxxxx\Raptor"

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_IMAGES_PATH "Graphics"
!define MUI_ABORTWARNING
!define MUI_ICON "${MUI_IMAGES_PATH}\installer.ico"
!define MUI_UNICON "${MUI_IMAGES_PATH}\uninstaller.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_RIGHT
!define MUI_HEADERIMAGE_BITMAP "${MUI_IMAGES_PATH}\header-logo.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${MUI_IMAGES_PATH}\wizard.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${MUI_IMAGES_PATH}\wizard-un.bmp"


; Welcome page
!insertmacro MUI_PAGE_WELCOME

; License page
;!define MUI_LICENSEPAGE_CHECKBOX
!define MUI_LICENSEPAGE_RADIOBUTTONS
!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT "Agree"
!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE "Do not agree"
!insertmacro MUI_PAGE_LICENSE "License.rtf"

; Directory page (Test Platform directory)
!insertmacro MUI_PAGE_DIRECTORY

; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH

; Language files
!insertmacro MUI_LANGUAGE "English"


Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "${TARGET_FILE}"
InstallDir "$APPDATA\${PRODUCT_BRAND}\Test Platforms\${TEST_PLATFORM_NAME}\${TEST_PLATFORM_VER}"

; MAIN SECTION
;========================================================================
Section "Main" SEC01
SetShellVarContext all
SetOutPath $INSTDIR
SetOverwrite on
SectionEnd



; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Main application files"
!insertmacro MUI_FUNCTION_DESCRIPTION_END



Function .onInit
SetShellVarContext all
StrCpy $InstDir "$APPDATA\${PRODUCT_BRAND}\Test Platforms\${TEST_PLATFORM_NAME}\${TEST_PLATFORM_VER}"
FunctionEnd


Thanks !!

---
Francisco Morales