2014-12-19 57 views
0
**define POSTGRESQL_INSTALLATION_DIRECTORY "C:\Program Files\Postgre SQL\9.3"** 

NSIS變量不允許在下面的聲明變量中使用空格。NSIS變量不允許空格在define變量中

[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] 

它工作正常,如果我定義的變量不一樣的空間:

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

但是我要像

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

聲明的變量之間的空間,所以請讓我知道如何執行此定義變量。

+0

你在問什麼有點不清楚。 –

+0

當我在代碼中添加變量定義POSTGRESQL_INSTALLATION_DIRECTORY「C:\ Program Files \ PostgreSQL \ 9.3」時,我收到編譯失敗消息。請讓我知道如何執行這個變量。 – user3337109

+0

你正在談論一個定義,而不是一個變量... – Anders

回答

0

編譯器告訴你這個問題,DetailPrint指令需要1個參數,並且當帶空格的字符串沒有被正確引用時,它將被解釋爲多個參數。

!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