Link to home
Start Free TrialLog in
Avatar of JonasUrth
JonasUrth

asked on

How to make a liveupdate application under Windows Vista

Hi Experts

I have a written a application in Delphi for updating our software automatically over FTP (Liveupdate). It works fine under Win XP. But our customers are starting to move to Vista and here is the problem. Because of the higher level of security in Vista our Liveupdate program will not overwrite files in the "Program Files" folder. Do anyone know how to make the Liveupdate program run with administrator rights under a normal user account. I was thinking about running it as a service. But don't know if this will give it the rights to update files in the Program Files folder. Does any one have a link for how to write a service for windows? So I can try this. Or any other ideas for writing a Liveupdate under Vista will be much appreciated. (I also like to be able to update dlls in the GAC)

Thanks
Jonas
Avatar of Toni Uranjek
Toni Uranjek
Flag of Slovenia image

Hi JonasUrth,

First question, does your application work if Vista' UAC is disabled? Disabling UAC in bad idea in general, but if UAC is preventing your application to work you might tak a look and the following KB article:

"How to disable the User Account Control Prompt for certain application "
http://support.microsoft.com/kb/946932

HTH

Toni
Another approach is to try to run your application "virtualized". Find your application's process in Task manager, right click and enable virtualizatio. Does it work if it runs virtualized?

Actually with this feature only file and registry write failures are resolved.

More info:
"Common file and registry virtualization issues in Windows Vista"
http://support.microsoft.com/kb/927387
http://www.petri.co.il/disable_uac_in_windows_vista.htm

i think you can disable the user account control using the registry

as here

http://www.petri.co.il/disable_uac_in_windows_vista.htm

using the registry

waiting for your reply
to run a program in another user credidentals

http://support.microsoft.com/kb/922708/en-us

waiting for your reply
Jonas,

This Q would be best asked, (maybe) in the Delphi programming area of EE.

If you search that area for Vista manifest and Vista UAC you will find out a bunch of stuff regarding Delphi programming and its UAC.

UAC is enforced by Vista unless you disable it as mentioned above. A proper Vista Manifest will allow proper user access and ellivation, but there simply is no way around it... unless you disable it. If you write a service application, you must still compile in a proper manifest and it must be installed and started with ellivated privledges.

In one of my most recent Delphi apps, I had to do a seperate "helper app" to start and stop a service through my application since I did not want my application to always be run with ellivated privledges. Only when it has to do such tasks as read/write certain places in the Registry, install and start and stop my service.

As far as writing to its own Program Files directory, if you create a good setup program using Inno setup or similar, you can set the directory and file permissions for everyone, and your app can at least read/write in its own directory. You coulod also do that manually. A setup application, if it has setup or install in its exe name, will, without asking, run in ellivated mode (administrator) and you can set file and directory permissions.

So.... that is the scoop on Vista and its UAC for Delphi programmers in a nutshell.

Again, search EE Delphi area.

John
ASKER CERTIFIED SOLUTION
Avatar of Johnjces
Johnjces
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JonasUrth
JonasUrth

ASKER

Okay, here is how i solved it:
I build my Liveupdate as a windows NT service. The service is running under the system account. To comunicate with the service i made a Client application that uses Named Pipes (the service running as a Pipe server). At first i was trying to use Messages to comunicate with the service but VISTA do not allow messeges between applications if you are not both applications as administrator (ellivated). Points go to John for the link on how to write nt service.

Thanks all
Jonas