views:

963

answers:

5

My msi installer cannot be installed on a Vista machine without turning UAC off. As my application is going to be distributed to my clients, around 20 machines, and they do not want to turn UAC off, is there a way that I can set some property which would allow my installer to run silent without any user interaction when UAC, which is enabled, pop up shows up

A: 

This should help you out.

EDIT: In response to your request for clarification. You can use the task schedule to schedule running the install that will not prompt, and then you can have the users/system administrators install that scheduler from a script (you can schedule it to run the next time the user logs in, for example).

That is the only way in Vista to avoid the confirmation dialog (short of disabling UAC, which you didn't want to do).

I hope that makes things clear.

Yishai
care to elaborate a bit, so you're answer is not merely a forwarding.
tharkun
+2  A: 

UAC pops up because you are installing to a folder the user doesn't have permission to, like Program Files, maybe try installing to a directory off the users home drive? The home driver in Vista is c:\Users\Username, there is a directory there for local applications, C:\Users\Username\AppData\Local\Apps.

James McMahon
Isn't that breaking all the rules about how to do software installs on Windows?
jakobengblom2
I do not know if it is break any rules, but applications that have the *"install this application for every/install this application for just me"* option use this approach. I see this everywhere so I assumed it was part of the Windows Installer.
James McMahon
For this reason, Google Chrome installs to C:\Users\<<Username>>\AppData\Local
JulianM
A: 

Vista/UAC should be prompting for confirmation to proceed w/ the install, not blocking it entirely. What's the name of your MSI? Like, does it magically work if you rename it to setup.msi?

Garrett
+3  A: 

The best resources I've found to get my head around UAC is is Robert Flamings blog, he's got a series of about 25 posts that explain how Vista, UAC and MSI all interact.

Vista will always prompt once it gets to the InstallExecuteSequence if you're doing a per-machine install (ALLUSERS=1), however if you've got an installer that requires elevation outside this sequence, then the best solution is to use a bootstrapper EXE with a manifest indicating that elevation is required when the EXE is run.

We use a commercial bootstrapper from Indigo Rose (it's a standalone app but it's only sold as part of MSI Factory), but you could get creative with NSIS, use the Visual Studio one and there's also a sample in the Windows Installer SDK

sascha
A: 

You can advertise the installation to your 20 clients. When they trigger the advertised hook (Start menu shortuct, COM interface, file association, etc.) the program will be installed with admin privileges.

Here is an example of how an administrator would advertise a package:

msiexec.exe -jm c:\\mypackage.msi

The MSDN article: http://msdn.microsoft.com/en-us/library/aa367548(VS.85).aspx

William Leara