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

Greetings, fellow Monks!

I'm writing a Perl script that will be run as a Service on a Windows machine. This service should be able to install programs on demand and for a specific user. To be able to have the installation program install itself in the right part of the registry and in the right user-directories, I need to run the Windows API-call's LogonAsUser, LoadUserProfile and CreateProcessAsUser.

To LogonAsUser and CreateProcessAsUser, I use the Win32::AdminMisc module, but I also need the LoadUserProfile function.

I want to know if there is any module that provide this functionality "easily", or do I have to do it the hard way using Win32::API?

Thanks for taking the time reading my question.

Replies are listed 'Best First'.
Re: LoadUserProfile API-call?
by MZSanford (Curate) on Sep 29, 2003 at 12:43 UTC
    If you check out the source for Win32::NetAdmin at roth.net you can see that the function call for LoadUserProfile has been commented out (see adminmisc.cpp, line 1094). There is also a copy of the function itself. You may want to download the source and try to uncomment/recompile. If that does not work (assuming it is commented for a reason), then i would say Win32::API is the next stop.

    from the frivolous to the serious
      Thanks for your advice!

      Allthough I can't find what your're referring to in the sourcecode I'm thinking of following your second advice and go for the Win32::API. Since changing the C-code would be mean more trouble for me, I guess using the Win32::API would be the "easier" way. ;-)

Re: LoadUserProfile API-call?
by tachyon (Chancellor) on Sep 29, 2003 at 12:45 UTC

    Check out Dave Roth's Perl Win32 Widgets. You will find lots of goodies there....

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      Thanks for your advice!

      I haven't found anything I feel will help me completely (yet), I'll look around some more.

      Possibly I can be helped by the Win32::API::Prototype module I found at the link you provided if I decide to go for the Win32::API-way.