Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Win32::TieRegistry

by akm2 (Scribe)
on Mar 31, 2001 at 20:27 UTC ( [id://68665]=perlquestion: print w/replies, xml ) Need Help??

akm2 has asked for the wisdom of the Perl Monks concerning the following question:

I' using the following code to read the windows registry and create a startmenu shortcut accordingly.

sub MakeShortcut{ use Config; use Win32::API; use Win32::Shortcut; use Win32::TieRegistry; use strict; use Win32::TieRegisry ( Delimiter=>"/" ); my ($key); if ($configUser || Win32::IsWin95()) { $key = 'CUser/Software/Microsoft/Windows/CurrentVersion/Explor +er/Shell Folders//Programs'; } else { $key = 'LMachine/SOFTWARE/Microsoft/Windows/CurrentVersion/Exp +lorer/Shell Folders//Common Programs'; } my $folderdir = $Registry->{$key}; my $folderpath = "$folderdir\\$shortcutfoldername"; print "Creating shortcut folder $folderpath\n"; mkdir ($folderpath, 0777); print "Making shortcut Tk Solitaire\n"; my $LINK=new Win32::Shortcut(); $LINK->{'Path'}="\\Tk Solitaire\\Tk Solitaire.exe"; $LINK->{'Arguments'}=""; $LINK->{'WorkingDirectory'}=\\Tk Solitaire; $LINK->{'Description'}="Tk Solitaire"; $LINK->{'ShowCmd'}=SW_SHOWNORMAL; $LINK->Save("$folderpath\\Tk Solitaire.lnk"); $LINK->Close(); }

When I try to run the above code on my Windows2000 Advanced Server system using ActiveState ActivePerl version 5.6.0.623 I get the following error.

Can't locate Win32/TieRegisry.pm in @INC (@INC contains: E:/Perl/lib E +:/Perl/sit e/lib .) at link.pl line 8. BEGIN failed--compilation aborted at link.pl line 8.

I thought Win32::TieRegistry was included in the distribution of ActivePerl? What's wrong here?

Replies are listed 'Best First'.
(tye)Re: Win32::TieRegistry
by tye (Sage) on Mar 31, 2001 at 21:56 UTC

    use Win32::TieRegisry ( Delimiter=>"/" );

    Can't locate Win32/TieRegisry.pm in @INC

    It is called a Registry. (:

            - tye (but my friends call me "Tye")
      Ouch, posting a stupid mistake to pm...

      That's why, when on a win32 platform and already dealing with ActiveState, I use Komodo, their IDE. It handles a bunch of stuff, from python to c++ to html, but I only use it for perl. It has, among other things, the ability to automatically check your code as you go (I think what it does is run perl in the background and send stderr to the statusbar or some such equvilient procedure). It's built with Mozilla, and with the constant running of perl to check everything, it gets pretty slow on this ol' 233, but it works. I like it.

      --Psi
      print(pack("h*","e4f64702566756e60236c6f637560247f602265696e676021602075627c602861636b65627e2")."\n");

        This has absolutley nothing to do with the original post, but I thought I'd second the recomendation for Komodo. It has the _potential_ to be one of the best IDE's out there. Once they work out the.. uhm.. features of course. The (half working) features like code folding and immeidate syntax checking are a huge plus. It's like running -w before execution. There's also a "technology preview" for Linux but I haven't looked at it since I don't run X on my linux boxes.
Re: Win32::TieRegistry
by dws (Chancellor) on Apr 02, 2001 at 10:22 UTC
    I'm surprised that   $LINK->{'WorkingDirectory'}=\\Tk Solitaire; didn't generate a warning when you compiled with -w

    Or is "\\Tk Solitaire" quoted in the original?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://68665]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-03-28 10:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found