I create installer file by NSIS.I want get installation directory by commandline. I used syntax such as /D=E:\ or /D=E: but installation directory any changed.
Use /D
(It must be the last token on the commandline and it must be a unquoted absolute path):
MySetup.exe /S /D=C:\Program Files\Foo Bar\Baz
If you want to allow installs to the root of a volume you need to put AllowRootDirInstall true
in your script.