perlnewbie2000 has asked for the wisdom of the Perl Monks concerning the following question:
Now I have to make sure that there is none of the entries that have the value "C:\Tool\Lint\Bin\Lint.exe", but I can't figure out how to put it in an IF sentence. I was thinking of something like:use Win32::Registry; my $NumTools; $p = "Software\\Microsoft\\DevStudio\\6.0\\Tools"; $main::HKEY_CURRENT_USER->Open($p, $Tools) || die "Open: $!"; $Tools->GetValues(\%vals); foreach $k (keys %vals) { $key = $vals{$k}; IF ($$key[0] eq "NumTools") { $NumTools = $$key[2]; } }
And then the code below.IF ($$key[2] eq "C:\\Tool\\Lint\\Bin\\Lint.exe") { print "PC-Lint is already installed"; } ELSE {
But somehow it allways comes with the error$Tools->SetValueEx("AskArgument#$NumTools", 0, REG_DWORD, "0"); $Tools->SetValueEx("CloseWindow#$NumTools", 0, REG_DWORD, "0"); $Tools->SetValueEx("DefaultArguments#$NumTools", 0, REG_SZ, ""); $Tools->SetValueEx("GUITool#$NumTools", 0, REG_DWORD, "0"); $Tools->SetValueEx("InitialDirectory#$NumTools", 0, REG_SZ, "C:\\Tool\ +\Lint\\Bin"); $Tools->SetValueEx("MenuName#$NumTools", 0, REG_SZ, "PCLint"); $Tools->SetValueEx("OutputRedirect#$NumTools", 0, REG_DWORD, "0"); $Tools->SetValueEx("PathName#$NumTools", 0, REG_SZ, "C:\\Tool\\Lint\\B +in\\Lint.exe"); $Tools->SetValueEx("ReloadNoPrompt#$NumTools", 0, REG_DWORD, "0"); $Tools->SetValueEx("UseSearchPath#$NumTools", 0, REG_DWORD, "0"); $Tools->SetValueEx("VisibleOnMenu#$NumTools", 0, REG_DWORD, "0"); $NumTools++; $Tools->SetValueEx("NumTools", 0, REG_DWORD, "$NumTools"); }
Can anyone help me figure out what is wrong? Please?IF ($$key[0] eq "NumTools") { $NumTools = $$key[2]; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: registry problems
by holli (Abbot) on Jan 07, 2005 at 08:53 UTC | |
|
Re: registry problems
by eyepopslikeamosquito (Archbishop) on Jan 07, 2005 at 09:32 UTC |