If you want to check if the key exists and read the current value, you must use
Pascal Scripting[
^] in the
[Code][
^] section. However, this requires that you become familiar with the Pascal scripting used by Inno Setup.
The function to read a string value from the registry is
RegQueryStringValue[
^]. You can then for example use the
Pos
string function to check if the value contains a specific substring or use
CompareText
/
CompareStr
to compare complete strings.
Untested example:
var
Value, LowerValue: String;
Search: Integer;
begin
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\xxx\yyy', 'KEYNAME', Value) then
begin
LowerValue := Lowercase(Value);
Search := Pos('c:\x\y\z.dll', LowerValue);
if (Search = 0) then
begin
Value := Value + ';C:\x\y\z.dll';
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\xxx\yyy', 'KEYNAME', Value);
end;
else
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\xxx\yyy', 'KEYNAME', 'C:\x\y\z.dll');
end;
end;