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)

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Toni UranjekConsultant/TrainerCommented:
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 "


Toni UranjekConsultant/TrainerCommented:
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"

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

as here

using the registry

waiting for your reply
Introducing the "443 Security Simplified" Podcast

This new podcast puts you inside the minds of leading white-hat hackers and security researchers. Hosts Marc Laliberte and Corey Nachreiner turn complex security concepts into easily understood and actionable insights on the latest cyber security headlines and trends.

to run a program in another user credidentals

waiting for your reply

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.

Just in case, here is a good tutorial on Delphi services..

You'll notice the registry writing when the service is installed. In Vista, you need admin, elevated, privileges.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JonasUrthAuthor Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
OS Security

From novice to tech pro — start learning today.