我正在使用inno setup爲Visual Studio項目創建安裝程序。我正在一個錯誤獲取[註冊表]部分中的文件版本號
"Parameter ValueData has invalid value"
此代碼:
[Code]
function GetVersion(AppVersion: String): String;
var
Version: String;
CharIndex: integer;
c: char;
begin
for CharIndex := 1 to Length(AppVersion) do begin
c := AppVersion[CharIndex];
if (c <> '.') then
Version := Version + c;
end;
Result := Version;
end;
[Registry]
Root: HKCU; Subkey: "MyCompany\Product"; ValueType: DWORD ; ValueName: "Version" ; ValueData: GetVersion({#MyAppVersion}); Flags: uninsdeletekey;
我的版本是這樣 「1.0.0.3,1.0.0.4,等等」。所以這個程序刪除。並將它們連接起來形成一個數字,然後回傳給註冊表。所以,我可以檢查此註冊表值並卸載或更新以前的版本。我聽到有人說inno會自動升級,但我用他們的名字創建了帶有版本號的圖標。提前致謝。
的'{#MyAppVersion]'可能是問題,但你沒有提供它。 (默認是'AppVersion',不帶'My'前綴。) –