[Qt-interest] QProcess and Vista

Scott Aron Bloom Scott.Bloom at sabgroup.com
Sat Feb 21 01:04:33 CET 2009


Here is how I have solved it in the past...

If you step all the way into the bowels of QProcess, you will find it
calls a win32 called CreateProcess (its in qprocess_win.cpp)

Spend the time to try and get that working outside of QT.. All QProcess
does it formulate the correct parameters to CreateProcess, so create
them yourself.

If you can get it working, which you should be able to do (assuming its
not a Vista Security issue, which it might be), figure out what it takes
to get QProcess to create those parameters.

Scott

> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-
> bounces at trolltech.com] On Behalf Of Willy P
> Sent: Friday, February 20, 2009 3:44 PM
> To: Qt Interest
> Subject: Re: [Qt-interest] QProcess and Vista
> 
> Also,
> Here's my QProcess setup:
> 
> _ffmpeg.setProcessChannelMode(QProcess::MergedChannels);
> _ffmpeg.setEnvironment( QProcess::systemEnvironment() += "." );
> 
> Thanks in advance...
> 
> -Willy
> 
> 
> On Fri, Feb 20, 2009 at 3:38 PM, Willy P <willy.lists at gmail.com>
wrote:
> > I am desperate.  I have been at this for D-A-Y-S.
> >
> > I have a QProcess that kicks off ffmpeg w/ a bunch of parameters.
The
> > code works fine on Linux, OS X and XP and it fails on Vista.  If I
> > print the input to QProcess::start and then paste it onto cmd.exe it
> > works.  So there is something wrong in the space between QProcess
and
> > ffmpeg.  QProcess has the correct working directory.  If anyone
could
> > tell me what I might be missing that would be great.
> >
> > #ifdef Q_OS_WIN32
> >        args.push_front( "ffmpeg" );
> >        args.push_front( "/C" );
> >        qDebug() << "cmd.exe " + args.join( " " );
> >        ErrorLog::write( "cmd.exe " + args.join( " " ) );
> >        _ffmpeg.start( "cmd.exe", args );
> > #else
> >
> > Thanks so much...
> >
> > -Willy
> >
> >
> >
> > On Sat, Feb 14, 2009 at 3:35 PM, Willy P <willy.lists at gmail.com>
wrote:
> >> Path is fine.  Permissions are fine.  I did my best to un-vista
vista
> >> (by that I mean I took steps to cut down on the warnings.)  Any
more
> >> specific advice on environment or security protocols?
> >>
> >>
> >> On Sat, Feb 14, 2009 at 9:15 AM, Scott Aron Bloom
> >> <Scott.Bloom at sabgroup.com> wrote:
> >>> I have an application that is distrusted on Vista as well as XP...
> >>>
> >>> The same QProcess call, using QStringList works fine...
> >>>
> >>> Check your path, your environment, and your security protocols.
> >>>
> >>> Scott
> >>>
> >>>> -----Original Message-----
> >>>> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-
> >>>> bounces at trolltech.com] On Behalf Of Willy P
> >>>> Sent: Saturday, February 14, 2009 2:05 AM
> >>>> To: Qt Interest
> >>>> Subject: Re: [Qt-interest] QProcess and Vista
> >>>>
> >>>> Ok, I've made some progress.  It seems the problem is the args
> >>>> QStringList does not work on Vista.
> >>>>
> >>>> If I run:
> >>>>
> >>>> QProcess p;
> >>>> p.execute( "cmd.exe /C Notepad.exe" );
> >>>>
> >>>> It works fine on Vista.  Strikes me as a bug no?  Anyone else
having
> >>> this
> >>>> issue?
> >>>>
> >>>> -Willy
> >>>>
> >>>>
> >>>>
> >>>> On Fri, Feb 13, 2009 at 5:05 PM, Willy P <willy.lists at gmail.com>
> >>> wrote:
> >>>> > Hey,
> >>>> > Is there something special I have to do to get QProcess to run
on
> >>> Vista?
> >>>> >
> >>>> > QStringList args() << "/C" << "Notepad.exe";
> >>>> > QProcess p;
> >>>> > p.start( "cmd.exe", args );
> >>>> >
> >>>> > On XP this launches notepad, on Vista it gives me QProcess
ErrorCode
> >>> 0.
> >>>> >
> >>>> > -Using Qt 4.4.3 commercial
> >>>> > -App is being built with visual studio 2005 on an XP machine
> >>>> > -App is being installed on an up to date Vista Ultimate
machine.
> >>>> >
> >>>> > Thanks in advance for any advice.
> >>>> >
> >>>> > -Willy
> >>>> >
> >>>> _______________________________________________
> >>>> Qt-interest mailing list
> >>>> Qt-interest at trolltech.com
> >>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
> >>>
> >>> _______________________________________________
> >>> Qt-interest mailing list
> >>> Qt-interest at trolltech.com
> >>> http://lists.trolltech.com/mailman/listinfo/qt-interest
> >>>
> >>
> >
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list