knowledge-database (beta)

Current group: jrsoftware.innosetup

Keys in the registry that already exist

Keys in the registry that already exist  
Phil
 Re: Keys in the registry that already exist  
Jonny Kwekkeboom
 Re: Keys in the registry that already exist  
Ath
From:Phil
Subject:Keys in the registry that already exist
Date:Mon, 20 Dec 2004 09:04:08 +0000 (UTC)
Hi all,

I want to add a key in the registry like this:
[Registry]
Root: HKCU; Subkey: "Software\Microsoft\Office\8.0\Excel\Microsoft Excel";
ValueType: string; ValueName: "OPEN"; ValueData: "{app}\dummy.xla";
Flags: uninsdeletekey

It's supposed to add a new Macro in EXCEL.
It works well.

But if an OPEN ValueName already exists, it will be owerwritten.

How can I do to automatically create OPEN1, OPEN2 ... ValueNames.
It means that if OPEN,OPEN1 and OPEN2 already exist, setup should create
the OPEN3 ValueName

Thanks a lot for your help
From:Jonny Kwekkeboom
Subject:Re: Keys in the registry that already exist
Date:Mon, 20 Dec 2004 12:22:21 +0100
Hi,


> [Registry]
> Root: HKCU; Subkey: "Software\Microsoft\Office\8.0\Excel\Microsoft Excel";
> ValueType: string; ValueName: "OPEN"; ValueData: "{app}\dummy.xla"; Flags:
> uninsdeletekey

Perhaps this do the trick (not tested)

Root: HKCU; Subkey: "Software\Microsoft\Office\8.0\Excel\Microsoft Excel";
ValueType: string; ValueName: {code:GetRegValueName}; ValueData:
"{app}\dummy.xla";
Flags: uninsdeletekey

[Code]

function GetRegValueName(Param: String): String;
var I: Integer; RegResult: String;
begin
I:=0;
Result:='OPEN';
RegQueryStringValue(HKCU,'Software\Microsoft\Office\8.0\Excel\Microsoft
Excel','OPEN',RegResult);
while length(RegResult)>0
Inc(i);
RegQueryStringValue(HKCU,'Software\Microsoft\Office\8.0\Excel\Microsoft
Excel','OPEN'+IntToStr(i),RegResult);
Result:='OPEN'+IntToStr(i);
end;
end;


cu
Jonny
From:Ath
Subject:Re: Keys in the registry that already exist
Date:Mon, 20 Dec 2004 22:49:52 +0100

"Phil" schreef in bericht
news:fdb9942581dfd5ce6012ee24328a707b$1@news.jrsoftware.org...
> Hi all,
>
> I want to add a key in the registry like this:
> [Registry]
> Root: HKCU; Subkey: "Software\Microsoft\Office\8.0\Excel\Microsoft Excel";
> ValueType: string; ValueName: "OPEN"; ValueData: "{app}\dummy.xla";
> Flags: uninsdeletekey

Why would you want to delete this key on uninstall?

TIA
Ath
   

Copyright © 2006 knowledge-database   -   All rights reserved