logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: grr, vista issues: msg#00022

Subject: Re: grr, vista issues
To reply to my own post :-)

"cmd.exe /C my.exe" would work fine, but you don't get the output of my.exe, 
for the reasons Toby pointed out regarding ShellExecute.

Mark Dootson wrote:
> Ah, I missed the elevated permissions bit.
> 
> If you had an executable, 'my.exe' with an application manifest marked for 
> elevated permissions, wouldn't a command line of
> 
> "cmd.exe /C my.exe"
> 
> get you an elevated permissions request?
> 
> 
> Mark
> 
> 
> 
> Ovod-Everett, Toby wrote:
>> His problem (seen from earlier in the thread) is that anything that
>> starts the process via CreateProcess doesn't work properly with elevated
>> permissions.  He has to start the process via ShellExecute to get the
>> elevated permissions to work properly, but he still needs to capture the
>> output.  Thus my proposal to write a custom app using PerlApp that is
>> marked as requiring elevated permissions and is started via ShellExecute
>> and that in turn starts the C installer app using CreateProcess (or
>> system() or open(), which both use CreateProcess), but hopefully the C
>> installer app will thus inherit the elevated permissions attached to the
>> small wrapper PerlApp.  The wrapper PerlApp can grab the output and use
>> a file, named pipes, TCP/IP connection on localhost, or whatever to send
>> data back to the parent process (it can't use STDOUT since it was
>> started via ShellExecute).
>>
>> --Toby Ovod-Everett
>>
>>
>> -----Original Message-----
>> From: Mark Dootson [mailto:mark.dootson@xxxxxxxx] 
>> Sent: Tuesday, July 03, 2007 2:24 PM
>> To: wxperl-users@xxxxxxxx
>> Cc: Ovod-Everett, Toby; Ed W
>> Subject: Re: [wxperl-users] grr, vista issues
>>
>> If buffering isn't your issue, you could take a look at
>> Wx::Perl::ProcessStream on CPAN. It may do what you want.
>>
>> Regards
>>
>> Mark
>>
>> Ovod-Everett, Toby wrote:
>>> Totally missed this reply for some reason . ..
>>>
>>> -----Original Message-----
>>> From: Ed W [mailto:lists@xxxxxxxxxxxxxx] 
>>> Sent: Saturday, June 16, 2007 11:54 AM
>>> To: Ovod-Everett, Toby
>>> Cc: wxperl-users
>>> Subject: Re: [wxperl-users] grr, vista issues
>>>
>>>> No, I wrote the app, so I don't think it buffers its output (or if it
>>>> does then it can be changed)
>>> If it's using STDIO, it buffers by default as soon as STDIO discovers
>>> that the output device isn't a console but is a file or STDIN of
>> another
>>> program.  Thus $| in Perl (which should be set to 1 for handles where
>>> you want to ensure that they do not buffer).  Thus the common idiom:
>>>
>>>     select((select(MYHDL), $|=1)[0]);
>>>
>>>
>>>> I had considered running the program via shellexecute, spooling the 
>>>> output to a file and reading in the file.  Seemed quite ugly
>> though...
>>>> I hadn't really given it much more thought, but why would I need a 
>>>> wrapper around the shellexecute?  Does it turn out to be difficult to
>>>> start that up with output redirected to a file?
>>> Capturing output is a weird business, having to do with all sorts of
>>> weird plumbing stuff in NT that I don't completely understand.  I
>> don't
>>> think ShellExecute lets you specify STDIO handles - that's a Microsoft
>>> decision.  See http://msdn2.microsoft.com/en-us/library/ms647732.aspx
>>> and http://msdn2.microsoft.com/en-us/library/ms682425.aspx and see if
>>> you can find the equivalent of the STARTUPINFO structure (one of the
>>> options to CreateProcess) for ShellExecute - I don't see it.  The
>>> STARTUPINFO structure includes hStdInput, hStdOutput, and hStdError,
>>> which is, I presume, how Perl goes about capturing output (by creating
>> a
>>> handle and passing it in STARTUPINFO).
>>>
>>> Given all of that, I think you're going to have to use some program to
>>> capture the output.  Whether that program is $ENV{COMSPEC} using ">"
>> to
>>> redirect it to a file or whether it's a custom Perl program that uses
>>> named pipes or something like that to communicate back to its "host",
>> I
>>> think that's the route you're going to have to follow.
>>>
>>> --Toby Ovod-Everett
>>>
>>> -----Original Message-----
>>> From: Ed W [mailto:lists@xxxxxxxxxxxxxx] 
>>> Sent: Saturday, June 16, 2007 11:54 AM
>>> To: Ovod-Everett, Toby
>>> Cc: wxperl-users
>>> Subject: Re: [wxperl-users] grr, vista issues
>>>
>>> Hi
>>>
>>>> Does the "small C based installer app" use buffering on its pipes or
>>>> not?  If not, is there a way to write another small C (or
>>> PerlApp-based)
>>>> wrapper that is also marked as needing elevated permissions that will
>>>> then start the installer app and redirect its output to a temp file
>>> that
>>>> can then be read by the Wx app?
>>>>   
>>> No, I wrote the app, so I don't think it buffers its output (or if it 
>>> does then it can be changed)
>>>
>>> I had considered running the program via shellexecute, spooling the 
>>> output to a file and reading in the file.  Seemed quite ugly though...
>>> I hadn't really given it much more thought, but why would I need a 
>>> wrapper around the shellexecute?  Does it turn out to be difficult to 
>>> start that up with output redirected to a file?
>>>
>>> Cheers
>>>
>>> Ed W
>>>
>>
> 
> 





Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.firebase.por...    text.xml.xalan....    qnx.openqnx.dev...    user-groups.zar...    internationaliz...    kde.devel.konve...    finance.e-gold....    emacs.latex.pre...    gis.therion/200...    web.webmin.gene...    yellowdog.gener...    vserver/2003-08...    redhat.release....    sysutils.tivoli...    xfree86.expert/...    mail.becky.user...    hardware.netapp...    netbsd.ports.xe...    python.distutil...    boot-loaders.gr...    culture.interne...    java.springfram...    activedir/2006-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe