Force to install as 'Everyone' - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

DrEight
Posts: 6
Joined: Tue Jan 11, 2011 3:44 pm

Force to install as 'Everyone'

Hello,
I have an installer with the InstallTypeDlg removed and with the 'Installation Type' set to 'Per User Only'
Is there any way to force via command line to install 'Per machine' and for Everyone?

Thank you
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Force to install as 'Everyone'

Hello,

In order to achieve this you can easily set the AI_InstallPerUser property to 0 when launching the setup from command line. When "AI_InstallPerUser" is set to 0 a per-machine installation will be done or when it is set to 1 a per-user installation will be performed.

Also if you skip the "InstallTypeDlg" dialog or install without full UI, then you should manually call the "AI_AuthorSinglePackage" custom action in the "Install Execution Stage". This custom actions evaluates the value of the "AI_InstallPerUser" property and set the installation mode and redirects the installation paths accordingly. Just go to "Custom Actions" page and add a "Call Function From Attached Native DLL" custom action with sequence, scheduled after "Install Execution Stage -> Searches" action group, like this:
  • Attached DLL: C:\Program Files (x86)\Caphyon\Advanced Installer <version>\custact\x86\aicustact.dll
    Function: AI_AuthorSinglePackage
If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
DrEight
Posts: 6
Joined: Tue Jan 11, 2011 3:44 pm

Re: Force to install as 'Everyone'

Hello,
I tried the procedure, but the setup fails with the message: ' you do not have sufficient privileges to complete this installation for all users of the machine'
I tried also to create an empty setup with only the custom action, but it fails with the same message. ( attached )
What am I doing wrong?

Thank you
Attachments
TestSetup.aip
(23.67 KiB) Downloaded 226 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Force to install as 'Everyone'

Hello,

Firstly I want to apologize for my previous reply. When reading your first post I missed your note that you use the 'Installation Type' set to 'Per User Only'. The only way to use the workaround I previously described is to use a "Per-machine if user is administrator, per-user otherwise" installation type.

When building the setup with a "Per-user only" installation type set, you cannot change the installation mode to per machine at install time unless the setup process is launched elevated from the beginning. So, when the "Per-user only" install type is used in order to perform a per-machine installation type you should proceed like this:
1. launch the installation process elevated (e.g. launch the CMD.EXE window with "Run as administrator" option)
2. set from command line the ALLUSERS property to 1

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
DrEight
Posts: 6
Joined: Tue Jan 11, 2011 3:44 pm

Re: Force to install as 'Everyone'

Thank you, for the answer. The second email may solve the problem
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Force to install as 'Everyone'

You're always welcome.

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

Return to “Building Installers”