0

Well, i have a QProcess that works as my program updater, but on Windows you CAN'T modify exe files when they're running, but if you close the program that created the Updater process i suppose that the Updater closes too. It's possible to make the Updater process independent?

Then, on Windows Vista (and later) it's impossible to run my updater because it returns that i need to elevate my level to administrator, It is possible to elevate the permissions for the process?

user000001
  • 32,226
  • 12
  • 81
  • 108
Blastcore
  • 360
  • 7
  • 19

1 Answers1

1

First of all, in opposite to Linux, Windows processes are independent from their parents by default and would not be closed after parent process closes.

Right way to solve your problem would be making your updater a Windows service. Then, it wouldn't be launched by application and it will have privileges to write to system folders etc. (see here)

Here is library for services support in Qt (and it actually works).

If you want simpler solution, you can use ShellExecute to escalate privileges to launch your updater.

Lol4t0
  • 12,444
  • 4
  • 29
  • 65
  • It's possible to use those Libraries along with QProcess? (I need inter-process communications) – Blastcore Jul 06 '12 at 21:19
  • 1
    @Blastcore, If you want to communicate with service, you can use sort of sockets, or you can send simple command to service (see `sendCommand` function). But you will be **unable** to communicate directly (through pipe)with process, started with privilages escalated _anyway_. – Lol4t0 Jul 06 '12 at 22:00