0
votes

I'm new in WIX. I neet to set Installscope to perUser if current user is in local admin groups (not runAsAdmin) or perMachine otherwise I know about ALLUSERS="2" and MSIINSTALLPERUSER="1|{}", but I can't to set them dynamically BEFORE wix decide how it will be runned - as perUser or perMachine I used CustomAction to detect if current user is in Administrators group and to set ALLUSERS and MSIINSTALLPERUSER, put in in InstallExecuteSequence, but this action always runs AFTER wix decision How can I implement dynamically set this properties of InstallScope depend by current user and admin group? My sample WIX

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="rrr" UpgradeCode="3664d946-e6b5-468f-8154-0506308d85ab">
    <Package InstallerVersion="200" Compressed="yes"  >
    </Package>

    <Binary Id="CustomActionBinary" SourceFile="$(var.CustomAction1.TargetDir)$(var.CustomAction1.TargetName).CA.dll"/>
    <CustomAction Id="SampleAction" BinaryKey="CustomActionBinary" DllEntry="CustomAction1" Execute="immediate" Return="check"/>

    <InstallExecuteSequence>
      <Custom Action='SampleAction' Before='SetProps'/>
    </InstallExecuteSequence>

    </Product>
</Wix>

Inside SetProps ALLUSERS and MSIINSTALLPERUSER are set to 2 and 1 But installer is run with UAC call (due to perMachine)

1

1 Answers

0
votes

The question is closed. I use Custom Action in InstallUISequence.