0

As stated here: https://blogs.msdn.microsoft.com/astebner/2006/12/14/some-useful-things-i-have-learned-about-windows-installer-and-uac/

I'm unable to run custom actions with administrative privileges and access to the Session-Data (f.e. to get Registry keys or paths that I need). The only way I can get administrative privileges on my custom-action is by running (Execute-Property of the Action-Call) this action as deferred or on commit instead of immediate.

What I understood by now is this:

Since there is no way to model background-knowledge in the WIX-Install System (like f.e. I want to install a Microsoft Office AddIn) I need to model my background-knowledge by creating procedural C# Code. (Or not?) Why should I not need Administrative privileges then?

Please tell me if I overlooked something. Am I approaching this wrong?

PhilDW
  • 20,260
  • 1
  • 18
  • 28
Ravior
  • 561
  • 2
  • 9
  • 30
  • It may help to be more specific, as Michael says. For example it's straightforward to get HKCU registry items with a registry search. Also, many user paths are available in properties such as AppDataFolder, DesktopFolder. – PhilDW Aug 07 '17 at 18:14

1 Answers1

0

Your question leaves unclear whether you are looking for a way to flow information from unelevated to elevated, or back from elevated to unelevated. The latter is not possible. The former uses CustomActionData.

As a recommendation, however, prefer data-driven to procedural code (it helps reuse in Windows Installer) and prefer built-in to custom. (Can you just set a property, and define registry keys based on that property? If so, Windows Installer will do all the heavy lifting.)

Michael Urman
  • 15,737
  • 2
  • 28
  • 44
  • Yeah sadly I need to put the same file to multiple directories based on if those directories exist (In my specific case, I want to install an addin for microsoft excel. The only way that works (and I've tried all of them manually) is by placing it in a folder called "XLSTART" in the Folder with the Name "OfficeXX.X" where X stands for the installed version. I was unable to find a way doing this with the wix markup. – Ravior Aug 09 '17 at 08:41
  • Sounds like you might be looking for a [SetDirectory](http://wixtoolset.org/documentation/manual/v3/xsd/wix/setdirectory.html) custom action. This overrides the meaning of a given [Directory](http://wixtoolset.org/documentation/manual/v3/xsd/wix/directory.html) at run time. – Michael Urman Aug 09 '17 at 12:15