Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX installer should always run as administrator

I developed a custom installer with WiX for a .NET WPF application. It works fine if I right-click and run as administrator, however when running without, some components fail to install due to insufficient privileges.

The components include SQL Server Express 2008 R2, FoxIt Reader, an ActiveX component and some others. It also requires that some SQL scripts are ran on the newly installed database - anyway, they all require administrator privileges.


I tried adding the InstallScope="perMachine" and InstallPrivileges="elevated" attributes to the Package node, but this didn't seem to make a difference.

I'm sure it's something silly, but I couldn't find anything in the reference or online.

like image 204
rumblefx0 Avatar asked May 25 '11 09:05

rumblefx0


People also ask

How do I run as administrator in WiX Installer?

Setup tab > Run after execution input: your msi file name. Advanced tab > Mark Request Administrative access option checkbox.

What is WiX Installer used for?

Windows Installer XML Toolset (WiX, pronounced "wicks"), is a free software toolset that builds Windows Installer packages from XML. It consists of a command-line environment that developers may integrate into their build processes to build MSI and MSM packages.


1 Answers

I think if you just add

<Property Id="MSIUSEREALADMINDETECTION" Value="1" />

it should solve the problem. Let me know if not and I can do some more checking.

like image 155
Christopher B. Adkins Avatar answered Sep 22 '22 06:09

Christopher B. Adkins