How to require administrator privileges - Advanced Installer Community
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

How to require administrator privileges

Hi, Advanced Installer team,

I wan't to allow each user install local version of product and possibly one local-machine installation, so I've made installer with InstallationType: "Per-machine if admin, per-user otherwise". Elevation of priveleges is required only for ALLUSERS installation.

Then I've added installation of system service in my package. But it fails to install during per-user installation because MSI didn't ask for priveleges elevation.

There is the "Run as administrator" checkbox in installation options, but it switches my project to .EXE configuration while I wish to distribute .msi packages.

How to add request for priveleges elevation for per-user installation type?

Best regards,
Andrey.
Attachments
InstallOptions.png
InstallOptions.png (14.08 KiB) Viewed 10787 times
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to require administrator privileges

Hello Andrey,

We have the How do I install a service for a custom user? user guide article to help. Let us know how it turns out.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: How to require administrator privileges

Hello, Mihai,
Thanks for your reply!

This article discovers how to install separate service for every user. Is it possible to install only one common system service (run as LocalServer32) for any installation type, both for per-user and per-machine? Because I don't like that user have to type his login and password in my installer.

Second question, How can I force the installer to ask for elevation in case of PER-USER installation?

Regards,
Andrey
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to require administrator privileges

Hello Andrey,
Is it possible to install only one common system service (run as LocalServer32) for any installation type, both for per-user and per-machine? Because I don't like that user have to type his login and password in my installer.
If you want a service for all users you should install it per-machine. That's the intended functionality built into the OS.
How can I force the installer to ask for elevation in case of PER-USER installation?
Installing the resource in a per-machine location will always trigger the UAC. However this defeats the purpose of the per-user installation, why would you need this?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: How to require administrator privileges

However this defeats the purpose of the per-user installation, why would you need this?
Main requirement: if user installs product PER-USER he should have his own data-storage in his AppData\Local folder. And for every per-user installation there should be the system update service which syncronizes data-storage in background (when system is idle).
May be there could be better soultuion...

Thanks,
Andrey
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to require administrator privileges

Hello Andrey,

The best solution I can think of is to install the service as a MSI prerequisite. Also, it's much simpler for you to choose either per-user or per-machine.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”