Maxim30
20th February 2010 16:04 UTC
To append the predef. install folder at every "Browse" button usage
Hello,
I do not find in the doc the explanation to append the predefined path to the installation folder at install time.
Having to build toghether a setup for 32 and 64 bit I have written this code in my beginning function:
Function MyGUIInit
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${Nome}" "NSIS:InstallDir"
${If} $0 != ""
StrCpy $INSTDIR $0
${ElseIf} ${RunningX64}
StrCpy $INSTDIR "$PROGRAMFILES64\${Nome}"
${Else}
StrCpy $INSTDIR "$PROGRAMFILES32\${Nome}"
${EndIf}
....
FunctionEnd
I do not use the attribute InstallDir in the code.
How can I append my predefined installation folder ${Nome} at every "Browse" button usage at install time ?
Greetings
Maxim30
20th February 2010 19:59 UTC
Ok, but what should I write in the function ?
Is the following right ?
Function .onVerifyInstDir
StrCpy $INSTDIR "$INSTDIR\${Nome}"
FunctionEnd
I would this:
example 1:
if user chooses as install folder the path c:\program files\NNN then Nsis setup will make it becoming c:\program files\NNN\MyFolder where MyFolder is specified inside the variable ${Nome}
example 2:
if user chooses as install folder the path c:\program files\QQQQQQQQQQQQQQ then Nsis setup will make it becoming c:\program files\QQQQQQQQQQQ\MyFolder where MyFolder is specified inside the variable ${Nome}
Does the funcion .onVerifyInstDir make it ?
Maxim30
20th February 2010 20:03 UTC
Resolved
Hello
I have tried so as above and it works :), many thanks.
Maxim30
1st March 2010 18:24 UTC
Hello,
I have fixed better the function within
Function .onVerifyInstDir
StrCpy $INSTDIR "$INSTDIR\${Nome}"
FunctionEnd
by instead
${WordAdd} "$INSTDIR" "\" "+${Nome}" $INSTDIR
Greetings,
Maxim30
26th March 2010 10:21 UTC
Hello,
I have fixed more better :) the function above deleting the "+":
Function .onVerifyInstDir
StrCpy $INSTDIR "$INSTDIR\${Nome}"
FunctionEnd
by instead
${WordAdd} "$INSTDIR" "\" "${Nome}" $INSTDIR
Greetings,