Search code examples
wixwindows-installerunauthorizedmscorlib

WiX installed program cannot be executed by normal user


I have a .net program that runs on the target machine (by a non admin) when I copy the files in a folder.

However, when I create an installer program (using Wix) install on target machine and try to run it, it gives the following error:

Problem signature:
  Problem Event Name:   CLR20r3
  Problem Signature 01: RN14W3TBEKIWLLFBCD5MLN3WYLZ522KZ
  Problem Signature 02: 1.7.20.0
  Problem Signature 03: 57afb905
  Problem Signature 04: mscorlib
  Problem Signature 05: 4.0.30319.34209
  Problem Signature 06: 53489fcf
  Problem Signature 07: 4524
  Problem Signature 08: 13c
  Problem Signature 09: System.UnauthorizedAccess
  OS Version:   6.1.7601.2.1.0.768.3
  Locale ID:    1033
  Additional Information 1: e3b9
  Additional Information 2: e3b9870467ec4722310fb4741c3dc189
  Additional Information 3: 88d1
  Additional Information 4: 88d10b8987a6d3ce2924300f4efa24bb

I tried the following to solve the problem:

  1. In package command tried with installScope as perMachine and perUser
  2. Added a manifest in the setup.exe and changed the requestedExecutionLevel as asInvoker and requireAdministrator.

By some trial and error this worked about 6 months ago but I do not remember what I did. Any ideas will be appreciated.


Solution

  • The install is mostly irrelevant to what happens when the application actually runs. You can't make the install somehow allow a limited user to run an application that requires elevation. If you want the application to run elevated then that's what requires the elevation manifest, not the setup.exe that does the install.

    The most likely cause is that WiX installs the application to the Program Files folder and the app is trying to create or update files in that location. The Program Files folder has always required elevated privileges to create/update files there. Basically the crash info doesn't help because the issue is going to be that the code is trying to access or update something that requires elevation, so the code needs debugging.

    The basic point here is that the install cannot "bless" the installed application so it can be used by limited users to do things that require elevation. The application needs to be debugged as to what it is doing that requires elevation, and a common issue is trying to update files in locations that limited users can't access, such as Program Files, Common Files folders.