1

I want to change the ALLUSERS property in Wix from 2 to 1. In my wxs file:

<Property Id="ALLUSERS" Secure="yes" Value="2" />

In Electron-wix-msi, my file set the UI property:

ui: {
        chooseDirectory: true,
        template: '<Property Id="ALLUSERS" Secure="yes" Value="1" />'
    },

I get an error though because it is a duplicate property. Is there no way to change the value with electron-wix-msi?

JoeD
  • 85
  • 1
  • 9

1 Answers1

0

Disclaimer: I don't do Electron installers. I can show you how it can be done using regular WiX markup. Please try the below and see how it works for you (resources for learning WiX):


You can remove the hardcoded property from your source and rely on WiX's built in handling of this in the Package element - the attribute: InstallScope="perMachine". Setting this attribute to perMachine will create the ALLUSERS property for you in the MSI with a value of 1.

Quick Sample:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="Test" Language="1033" Version="1.0.0" 
           Manufacturer="N/A" UpgradeCode="PUT-GUID-HERE">

    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

 <..>

</Wix>

Along with other attributes - such as InstallPrivileges - setting InstallScope to perMachine will create a per-machine installer as described by Rob Mensching here. Make your changes and observe the resulting changes in the output MSI by inspecting it with Orca in the usual fashion.

I just remembered that I have this old github sample for per user WiX installations: https://github.com/glytzhkof/WiXPerUserSample


Links:

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • This answer, in addition to this pull request changes, fixed my problem: https://github.com/felixrieseberg/electron-wix-msi/pull/138 – JoeD Nov 16 '21 at 14:47