1

I am having a problem with the upgrade using the same InstallPrivileges as the Product which is 'limited', InstallScope="perUser". The initial/first install works fine and did not ask for admin privilege. However, when trying to upgrade it requires UAC elevation. How can I have the upgrade use the same access level as the previous installed build --> nonAdmin.

I tried different techniques and read different forums but nothing seems to work. Can you please help out if you encountered the same or you know what is wrong in the code? Thanks

<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<UI>
  <UIRef Id="WixUI_InstallDir" />
  <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
  <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
</UI>

<Upgrade Id="$(var.UpgradeCode)" >
  <UpgradeVersion   Minimum="$(var.ProductVersion)"
                    IncludeMinimum="no"
                    OnlyDetect="yes"
                    Language="1033"
                    Property="NEWPRODUCTFOUND" />
  <UpgradeVersion Minimum="1.0.0.0"
                  IncludeMinimum="yes"
                  Maximum="$(var.ProductVersion)"
                  IncludeMaximum="no"
                  Language="1033"
                  Property="UPGRADEFOUND" />
</Upgrade>

<MajorUpgrade AllowSameVersionUpgrades="yes" AllowDowngrades="no" Schedule="afterInstallInitialize"  DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
Nonna A
  • 11
  • 1
  • If you open the compiled MSI with **`Orca`** and select **`View`** => **`Summary Information`**. Is the check box: **`UAC Compiant`** ticked? Have you added any custom actions? Have you changed anything else - for example the GUI? – Stein Åsmul Jul 12 '19 at 22:41
  • Found some old links: [**Per-User Setup Restrictions**](https://www.advancedinstaller.com/user-guide/single-package.html) - check out the link to *"Single Package Authoring"*. And including [this recent Q/A](https://stackoverflow.com/questions/56400973/why-does-my-msi-prompt-for-administrator-rights). This approach with the GUI has [other challenges](https://stackoverflow.com/q/56877183/129130). – Stein Åsmul Jul 12 '19 at 22:49
  • Hi Stein, the UAC Compliant of the msi is checked. Is that correct if I want to be in nonAdmin mode? Thanks – Nonna A Jul 13 '19 at 02:57
  • 1
    Yes, that would be correct. What have you changed? Have you set **`ALLUSERS`**? For something like this we really need to see the whole source or most of it. Maybe put on [github.com](https://github.com)? (unless someone else has a spontaneous insight). – Stein Åsmul Jul 13 '19 at 09:22
  • Maybe consider putting the source on [github.com](https://www.github.com) for review and help? Leave out business critical custom actions obviously. – Stein Åsmul Jul 13 '19 at 17:36
  • Thanks Stein. I have added the entire code in github: https://github.com/Nonna14/WixProject – Nonna A Jul 14 '19 at 22:23
  • I have set AllUsers but on the upgraded version, not on the initial main product. Could that cause a problem? thanks a lot for your help. – Nonna A Jul 14 '19 at 22:24
  • Stein, I had figured it out-- Finally!! It turned out I missed a very important piece in the program where we check an xml and perform a mandatory upgrade using AutoUpdater.NET.dll. I had missed the line to make the update not run as an admin. [AutoUpdater.RunUpdateAsAdmin = false] The only thing with that is application needs to be installed in User LocalAppData folder. – Nonna A Jul 15 '19 at 22:59
  • Here is the code for reference: public MainWindow() { InitializeComponent(); AutoUpdater.ShowSkipButton = false; AutoUpdater.Mandatory = true; AutoUpdater.UpdateMode = Mode.Forced; AutoUpdater.RunUpdateAsAdmin = false; //<=== missed this line var converted = new System.Uri(@"\\abc.de.com\Release\AutoUpdaterTest.xml").AbsoluteUri; System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); AutoUpdater.Start(converted, assembly);} – Nonna A Jul 15 '19 at 22:59

0 Answers0