English 中文(简体)
在[Registry]部分找到一个档案版本。
原标题:Getting a file version number in the [Registry] section

我正在安装一个视频演播室项目安装器,使用无装置。 我正在犯错误。

"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: "MyCompanyProduct"; ValueType: DWORD ; ValueName: "Version" ;     ValueData: GetVersion({#MyAppVersion}); Flags: uninsdeletekey;

我的版本就是“1.0.0.3, 1.0.0.4,等等”。 因此,这项方案删除了......,并召集了所有方案组成一个编号,并应当转回登记处。 因此,我可以检查这一登记价值,不停或更新前版本。 我听到有人说,诺言会自动升级,但我用字号制作漫画。 提前感谢。

最佳回答

The problem you are seeing is because to call a function as a parameter in the main sections of InnoSetup, you need to use the {code:} construct.
Here s an example that worked for me:

[Registry]
Root: HKCU; Subkey: "SoftwareMyCompanyProduct"; ValueType: DWORD ; ValueName: "Version" ;     ValueData: {code:GetVersion|{#MyAppVersion}}; Flags: uninsdeletekey;
问题回答

As @Ken White said, your constant is "broken" which makes the entire string literal invalid. Even then, you ValueData is still just GetVersion(WhateverMyAppVersionIs) instead if the result of that function. For that, use a {code:} constant to call GetVersion.





相关问题
Is CLSID in registry for windows operating system is constant

I am developing a windows mobile application where i need to get a registry value of notification settings ,that is stored with CLSID as a key .Can i depend on the CLSID for retrieving the value of a ...

登记许可问题

vs2008, c. First time myhons# , it needs to establish a LM LMSoftware. 湿租赁

Reading registry values with cmake

On a Windows 7 machine I cannot read any registry values that contain a semicolon. For example if you have 7-zip, running the following SET(MYPATH [HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip;Path]) ...

How to check visible resolution of system

I am not entirely sure how to word this questions so I am just going to explain my problem. My VB 6 program saves the location of the screen in the registry so that when it loads up again it can have ...

How to read and write to registry using VB.NET

How do I read, write and delete a registry using VB 2005/2008? Please give your explanation to your answer. I am really a registry noob... Thanks. I can t read any programming language other than vb.

Installing a Windows Service as a user

I m currently in the process of creating a Windows service application which will monitor changes to certain keys made in the HKEY_USERS registry. The way I do this is by collecting the SID of the ...

热门标签