seandr
Posts: 11
Joined: Tue May 29, 2012 4:59 am

Per machine if admin, per-user otherwise not working for non-admins

Hello,

I've got a fairly simple installer with Installation Type set to "Per-machine if user is administrator, per-user otherwise." Works great when I install as an admin - the app is correctly installed per machine for all users.

When I try to install from a normal user account (Windows 7, no UAC), the install fails telling me that I need Administrator privileges to install the package. I've checked the log, and it shows the following line:

PROPERTY CHANGE: Modifying ALLUSERS property. Its current value is '2'. Its new value: '1'.

For non-admins, when the value is 2, it should be switched to an empty string for per-user install. Instead, it's switched to 1 for a machine install.

Note, if I change the Installation Type to "Per-user only", the installer works fine on a normal user account. So the problem seems to be in the detection/decision of whether to do a per-user or per-machine. Any ideas why it's getting this wrong and trying to do a per-machine install for a normal user?

Thanks,
Sean
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Per machine if admin, per-user otherwise not working for non-admins

Hello Sean,

I'm not sure why this happens. Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can further investigate this behavior?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
seandr
Posts: 11
Joined: Tue May 29, 2012 4:59 am

Re: Per machine if admin, per-user otherwise not working for non-admins

Project file and log attached.

Thanks,
Sean
Attachments
MSI5226f.LOG
(135.09 KiB) Downloaded 309 times
IQPlayerSetupx64.aip
(23.5 KiB) Downloaded 350 times
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Per machine if admin, per-user otherwise not working for non-admins

Hello Sean,

Please note that when using the "Per-machine if user is administrator, per-user otherwise." installation type it is mandatory to add the "InstallTypeDlg" dialog to your first time install dialog chain. Please take a look on our "Make the package install per-user or per-machine" article for more details.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
seandr
Posts: 11
Joined: Tue May 29, 2012 4:59 am

Re: Per machine if admin, per-user otherwise not working for non-admins

Thanks for the explanation, Daniel.

Is this constraint imposed by Windows Installer, or by Advance Installer? Is there a way around this?

We really want an installer that automatically selects per-user or per-machine depending on the user's account privileges. We don't want the end user to be faced with this decision.

Alternatively, is it possible to build an installer that defaults to per-user but can be overridden by an admin using a command line switch?

Thanks,
Sean
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Per machine if admin, per-user otherwise not working for non-admins

Hello Sean,
Is this constraint imposed by Windows Installer, or by Advance Installer? Is there a way around this?
Yes, this constraint is imposed by Advanced Installer.
We really want an installer that automatically selects per-user or per-machine depending on the user's account privileges. We don't want the end user to be faced with this decision.
I've added your request in our todo list and maybe this improvement will be available in a future version of Advanced Installer.
Alternatively, is it possible to build an installer that defaults to per-user but can be overridden by an admin using a command line switch?
I'm afraid this is not possible.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: Per machine if admin, per-user otherwise not working for non-admins

Does this mean that a silent installation is incapable of using this installation method? Currently have an issue where an admin trying to install to their local app data folder is defaulting to a per machine installation (which is ridiculous not only because of the destination type, but because it's a non-elevated silent installation).
MSI (s) (64:6C) [15:52:22:723]: Command Line: LOG_FILE_PATH=C:\Users\Alan.QA\AppData\Local\Temp APPDIR=C:\Users\Alan.QA\AppData\Local\ApplicationName\Application CURRENTDIRECTORY=C:\Users\Alan.QA\Desktop CLIENTUILEVEL=3 MSICLIENTUSESEXTERNALUI=1 CLIENTPROCESSID=3952
MSI (s) (64:6C) [15:52:22:725]: PROPERTY CHANGE: Adding PackageCode property. Its value is '{3CBF802C-AA92-4690-8A4A-0640F50AC034}'.
MSI (s) (64:6C) [15:52:22:728]: Product Code passed to Engine.Initialize: ''
MSI (s) (64:6C) [15:52:22:729]: Product Code from property table before transforms: '{2473C65E-F418-46F6-A9D0-DA42875B97BE}'
MSI (s) (64:6C) [15:52:22:730]: Product Code from property table after transforms: '{2473C65E-F418-46F6-A9D0-DA42875B97BE}'
MSI (s) (64:6C) [15:52:22:732]: Product not registered: beginning first-time install
MSI (s) (64:6C) [15:52:22:733]: PROPERTY CHANGE: Modifying ALLUSERS property. Its current value is '2'. Its new value: '1'.
MSI (s) (64:6C) [15:52:22:735]: Product {2473C65E-F418-46F6-A9D0-DA42875B97BE} is not managed.
MSI (s) (64:6C) [15:52:22:736]: Machine policy value 'AlwaysInstallElevated' is 0
MSI (s) (64:6C) [15:52:22:738]: User policy value 'AlwaysInstallElevated' is 0
MSI (s) (64:6C) [15:52:22:739]: MSI_LUA: Installation UI level is silent, no credential elevation is possible
MSI (s) (64:6C) [15:52:22:741]: PROPERTY CHANGE: Adding ProductState property. Its value is '-1'.
This worked fine with our old MSI (built using a different provider's MSI authoring suite) and would change to a per-user installation.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Per machine if admin, per-user otherwise not working for non-admins

Hello and I apologize for my delayed reply,

Yes, I'm afraid we don't have predefined integration with silent installations for our "Per-machine if user is administrator, per-user otherwise" installation type option. During a silent installation it will be always performed a per-machine installation type. Thank you for your understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: Per machine if admin, per-user otherwise not working for non-admins

That implies that every single bootstrapped installer must run per machine, which makes no sense as the built-in bootstrapper offers this as an option. Is the option invalid or is there a way to make it work (setting AI_InstallPerUser and running AI_AuthorSinglePackage manually, for instance)?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Per machine if admin, per-user otherwise not working for non-admins

Hello,

Yes, setting the "AI_InstallPerUser" property and then calling the "AI_AuthorSinglePackage" action should work during a silent installation too. So, you can try to call the "AI_AuthorSinglePackage" custom action during the "Install Execution Stage" only on a silent installation.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”