2
votes
 **define POSTGRESQL_INSTALLATION_DIRECTORY "C:\Program Files\Postgre SQL\9.3"**

NSIS varible not allowed space in below declared variable.

[INFO] [MAKENSIS] DetailPrint expects 1 parameters, got 2.
[INFO] [MAKENSIS] Usage: DetailPrint message
[ERROR] Failed to execute goal org.codehaus.mojo:nsis-maven-plugin:1.0-SNAPSHOT:compile (64bit_REACH) on project dsr.installer: Execution of makensis compiler failed. See output above for details. -> [Help 1]

It works fine if i define variable without space like:

 `**define POSTGRESQL_INSTALLATION_DIRECTORY "C:\ProgramFiles\PostgreSQL\9.3"**`

But i want space between the declared variable like

`**define POSTGRESQL_INSTALLATION_DIRECTORY "C:\Program Files\Postgre SQL\9.3"**` 

So please let me know how to execute this defined variable.

1
What you are asking is somewhat unclear. - Mike H-R
When i added the variable in code define POSTGRESQL_INSTALLATION_DIRECTORY "C:\Program Files\PostgreSQL\9.3" then i got the compilation failure message. Please let me know how to execute this variable. - user3337109
You are talking about a define, not a variable... - Anders
You should use "$ProgramFiles\..." and not hardcode "C:\Program Files\..." - Anders

1 Answers

1
votes

The compiler is telling you the problem, the DetailPrint instruction takes 1 parameter and when a string with spaces is not quoted correctly it will be interpreted as multiple parameters.

!define POSTGRESQL_INSTALLATION_DIRECTORY "C:\Program Files\PostgreSQL\9.3"

Section
;DetailPrint ${POSTGRESQL_INSTALLATION_DIRECTORY} ; This will not work because the string is not quoted
DetailPrint "${POSTGRESQL_INSTALLATION_DIRECTORY}"
DetailPrint '${POSTGRESQL_INSTALLATION_DIRECTORY}'
DetailPrint "Hello ${POSTGRESQL_INSTALLATION_DIRECTORY} World"
DetailPrint 'Hello "${POSTGRESQL_INSTALLATION_DIRECTORY}" World'
DetailPrint "Hello $\"${POSTGRESQL_INSTALLATION_DIRECTORY}$\" World"
SectionEnd