but it does not seem to provide me with the directory variable it prompts for.!insertmacro MUI_PAGE_DIRECTORY
my only guess is it has something to do with MUI_DIRECTORYPAGE_VARIABLE
but I am unable to access this. I have tried all kinds of ways to initialize it on .onInit and failed (!define, StrCpy)
!define: "MUI_DIRECTORYPAGE_VARIABLE" already defined!
Error in script "setup2.nsi" on line 242 -- aborting creation process
which is the !define in the following .onInit fragment:
${If} ${RunningX64}
StrCpy $Dir_Wanted "$PROGRAMFILES64\${PRODUCT_NAME}"
!define MUI_DIRECTORYPAGE_VARIABLE "${Dir_Wanted}"
${Else}
StrCpy $Dir_Wanted "$PROGRAMFILES\${PRODUCT_NAME}"
!define MUI_DIRECTORYPAGE_VARIABLE "${Dir_Wanted}"
${EndIf}
!define's the only thing that doesn't error out. kinda. but I made this change and things don't work.elsewhere in the top of the install section, I have
${If} ${RunningX64}
StrCpy $INSTDIR "${Dir_Wanted}"
${Else}
StrCpy $INSTDIR "${Dir_Wanted}"
${EndIf}
SetOutPath "$INSTDIR"
I wanted to initialize the mui directory page thing so it has a correct default, but also allow for user input to change that value, so I can get a different directory if the user chooses. but I am not having sucess. I also need to get that dir that came from the user. any pointers?I tried changing the !define to
but it caused!insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_VARIABLE Dir_Wanted
2 warnings:
unknown variable/constant "{Dir_Wanted}" detected, ignoring (setup2.nsi:109)
unknown variable/constant "{Dir_Wanted}" detected, ignoring (setup2.nsi:112)
thanks.