Hello,
I need to know whether the user chose a custom directory using the command line parameter.
I wanted to use GetParameters, only to know it doesn't return the /D= parameter.
Any alternatives?
GetParameters and /D=
6 posts
I'll hazard a guess:
Function .onInit
${If} $INSTDIR != "YourDefaultDirectory"
MessageBox MB_OK "Custom folder."
${EndIf}
FunctionEnd
Function .onInit
${If} $INSTDIR != "YourDefaultDirectory"
MessageBox MB_OK "Custom folder."
${EndIf}
FunctionEnd
What Msg suggests will probably work 99% of the time (The last percent is for short names and junctions etc)
...but why do you care?
...but why do you care?
GetOptions is used for thatOriginally Posted by stopasking View PostI wanted to use GetParameters, only to know it doesn't return the /D= parameter.
@MSG: That's what I did, looks a bit dirty though.
Instead you can just omit InstallDir and therefore $INSTDIR will be empty in .onInit unless /D= was passed (with a value). If $INSTDIR is empty, just set a $INSTDIR value with StrCpy.
@Yathosho: /D= isn't included in $CMDLINE (manual states this).
Stu
@Yathosho: /D= isn't included in $CMDLINE (manual states this).
Stu