2011-10-11 75 views
3

這個問題是關於從程序集直接獲取版本。我遵循的指示從this post自動編譯inno安裝程序錯誤

我的腳本看起來如下。

#define MyAppName "Keyboard Trader" 
#define SrcApp "Keyboard Trader.exe" 
#define FileVerStr GetFileVersion(SrcApp) 
#define StripBuild(str VerStr) Copy(VerStr, 1, RPos(".", VerStr)-1) 
#define AppVerStr StripBuild(FileVerStr) 

但是在編譯腳本,它拋出以下錯誤

Compile started: Tuesday, Oct 11 2011 at 01:15 AM 
--- 
Compiling script with Inno Setup 5.4.2 (a) 
--- 
[ISPP] Preprocessing. 
--------------------- 
Compile Error! 
Line: 12 
**Error: [ISPP] Actual parameter VerStr is not of the declared type.** 

我是缺少在這裏?

+0

無論你的腳本摘錄在這裏也沒有對這個問題您鏈接到有上線的基準來VerStr 12.你可以發佈你使用的是完整的腳本接受的答案? – Vicky

回答

5

GetFileVersion()返回空白字符串,因爲它找不到SrcApp路徑。 嘗試指定一個完全合格的路徑或使用:

#define SrcApp AddBackslash(SourcePath) + "Keyboard Trader.exe" 
+0

謝謝。有效。順便問一句,你是怎麼意識到它返回空字符串的? – mchicago

+0

我跑了它,並給它一個有效的文件名來測試,它的工作。刪除路徑導致相同的錯誤。 – Deanna

+0

很抱歉再次打擾您,但您如何調試腳本?我有一個斷點,但我根本無法獲取變量值。因爲當引擎停在斷點處時,評估常量仍然是禁用的。 – mchicago