PDA

View Full Version : Problem with qprocess and Path



pcoliver
16th September 2011, 17:17
Hi all

I am new to Qt. I have a question:

I'm trying to convert a string like this type path C: / Dir1/Dir2/Dir3
in a chain like this C: \ \ Dir1 \ \ dir2 \ \ dir3 as I can tell it to qprocess then that is the path from where I launch the executable

where path has to be of this type C: \ \ Dir1 \ \ dir2 \ \ dir3 and what I get is
C: / Dir1/Dir2/Dir3



processDes.setWorkingDirectory (path);

Process.Start ("msiexec.exe", QStringList () <<"/ qf" <<"/ uninstall" <<"openofficeorg31.msi");

When I launch the process Uninstaller window opens but when I close.

Someone could help me with this?

Thank you.

amleto
16th September 2011, 21:06
When I launch the process Uninstaller window opens but when I close.

What is this I dont even...?



Someone could help me with this?

Sure. What is your problem?

pcoliver
17th September 2011, 21:13
My problem is that when I launch the uninstallation openoffice.msi get to launch msiexec.exe windows but when you close the window and do not get to launch the execution of openoffice.msi. I do not know what could be the problem.

What I need is to uninstall OpenOffice on Windows, given that the path where the msi file to uninstall manager is stored in a route format C: / Temp/dir2. I have read that in order to pass as parameter the path to qprocess must be formatted C: \ \ temp \ \ Dir First need in me to become a function in C: / temp / Dir to C: \ \ temp \ \ Dir launch and achieve with qprocess uninstalling openoffice.

I would appreciate any input or help. Thank you.

amleto
17th September 2011, 21:31
http://doc.qt.nokia.com/latest/qstring.html#replace-8

pcoliver
18th September 2011, 00:15
Thank your for your request.

Now I have to solve the problem I have with qprocess and msiexec.exe to uninstall the application.

This is the code I have but when I run the msiexec.exe msiexec.exe with the parameters, QStringList () <<"/ qf" <<"/ uninstall" <<"openofficeorg31.msi" opens the window but msiexec.exe is closed immediately, and I dont know the solution.

I've tried this but I do not get it to work.

/ / path where is the openoffice31.msi
processDes.setWorkingDirectory ("c: \ \ Temp \ \ sctag \ \ EXPLODE \ \ Oone");

Process.Start ("msiexec.exe", QStringList () <<"/ qf" <<"/ uninstall" <<"openofficeorg31.msi");

I need any help to you for your help and interest.

amleto
18th September 2011, 12:16
if you try to run msiexec from normal console, does it work properly?


The only thing I can suggest is to try QProcess::startDetached(...), as I have found sometimes this works when start(...) does not.