-1

I'm trying to create a setup file (MSI) that runs without admin privileges. for that, I've tried the bellow option.

  1. I've set InstallAlluser property to false as bellow.

enter image description here

  1. Also set InstallAllUsersVisible to false

enter image description here

  1. I've also changed Default location with [AppDataFolder]

enter image description here

After changes above properties It still required Administrator permission to execute MSI file that created using Setup project.

Can you please help me to resolve this issue.

Thanks in Advance.

Hiren Patel
  • 1,071
  • 11
  • 34

1 Answers1

2

When you open your MSI with Orca (or equivalent MSI viewer), do you see the "UAC Compliant" check box checked? Sample screenshot here:

UAC Checkbox

You should really use a more flexible and capable MSI tool than the Visual Studio Installer projects. They are good for a few purposes, but lack flexibility and there are numerous other problems: summary of VS Project problems (short form).

Per-User setups considered harmful: Some words of warning against per user setups. Here is one more answer on that.

A simple per-user folder installation in WiX (insert UPPERCASE GUIDs in locations shown with "PUT-GUID-HERE" (2 occurrences) - you can use this GUID generator):

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="PerUserSample" Language="1033" Version="1.0.0.0" Manufacturer="-" UpgradeCode="PUT-GUID-HERE">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" InstallPrivileges="limited" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes" />
    <UIRef Id="WixUI_Mondo" />

    <Feature Id="ProductFeature" Title="PerUserSample" Level="1" />

    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="AppDataFolder">
        <Directory Id="Something" Name="Something">
          <Component Feature="ProductFeature" Guid="PUT-GUID-HERE">

            <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]\Test"
                           Name="installed" Type="integer" Value="1" KeyPath="yes"/>

            <File Source="C:\Windows\Notepad.exe" />

            <RemoveFolder Id="Something" Directory="Something" On="uninstall" />

          </Component>
        </Directory>
      </Directory>
      
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="PerUserSample" />
      </Directory>

    </Directory>

  </Product>

</Wix>
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164