InstallTypeDlg doesn't change the AI_InstallPerUser property - Advanced Installer Community
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

InstallTypeDlg doesn't change the AI_InstallPerUser property

Hi!
I've added InstallTypeDlg to my project, and would like to change my custom properties(with data path) by 2 custom actions (Set Installer Property). First action set data path if AI_InstallPerUser = "1" and second one if AI_InstallPerUser = "0". Also I have added data_path value in Registry. The problem is that i always see data_path in Registry as if user selected Install per User.

Here is the project in attachment, which shows message box with value of AI_InstallPerUser property. It is always 1, no matter which radiobutton is selected in InstallTypeDlg.

Selection of AppDir works correctly. What is the proper way to set data folder according AI_InstallPerUser property?

Thanks,
Andrey
Attachments
AI_InstallTypeSample.aip
(11.32 KiB) Downloaded 476 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: InstallTypeDlg doesn't change the AI_InstallPerUser prop

Hello Andrey,

I'm not sure why you encountered this behavior.
I have tested your attached sample and it worked as expected, using the InstallTypeDlg the AI_InstallPerUser property is set with the following values:
  • AI_InstallPerUser = 1 when a Per-User installation is made
  • AI_InstallPerUser = 0 when a Per-Machine installation is made
In order to have a better view about this, can you please attach a verbose log of the installation process when a Per-Machine installation is made so we can investigate it?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: InstallTypeDlg doesn't change the AI_InstallPerUser prop

Log in attachment

Code: Select all

msiexec.exe /i "C:\Documents and Settings\Andrey\Desktop\Your Application-SetupFiles\Your Application.msi" /L*V log.txt
Attachments
registry.png
registry.png (8.43 KiB) Viewed 7769 times
log.txt
(207.55 KiB) Downloaded 475 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: InstallTypeDlg doesn't change the AI_InstallPerUser prop

Hello,

This is happening because the AI_InstallPerUser property is a private property (contain lower-case letters in their name).
Please note that Windows Installer properties are global variables that Windows Installer uses during an installation.
There are two main types of Windows Installer properties:
  • •Private Properties (contain lower-case letters in their name, example: My_Prop)
    •Public Properties (contain only upper-case letters in their name, example: MY_PROP)
The difference between Public and Private properties consists in the way their values are being passed on. Only the value of a Public Property is passed on from the Wizard Dialogs Stage (in which the dialogs are showed) to the Install Execution Stage (in which the system is modified).

Therefore, make sure that you use a Public Property for an UI control (Editbox, Combobox etc) if you want its value to be available in the InstallExecute Sequence (for instance, if the value of this Property is written in the registry, .ini file), otherwise you will get the default value assigned to this property.

Please take a look on the Windows Installer Properties article with more information.

If there is anything else I can help you with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: InstallTypeDlg doesn't change the AI_InstallPerUser prop

Thanks for quick response!
Can I check that user have selected PerMachine installation type by checking that ALLUSERS property is equal "1"?
And otherwise its empty.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: InstallTypeDlg doesn't change the AI_InstallPerUser prop

You're welcome Andrey,

Indeed, the value of the ALLUSERS property, at installation time, determines the installation context:
  • An ALLUSERS property value of 1 specifies the per-machine installation context.
  • An ALLUSERS property value of an empty string ("") specifies the per-user installation context.
If there is anything else I can help you with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: InstallTypeDlg doesn't change the AI_InstallPerUser prop

Thanks Dan, now everything works fine!

Best regards,
Andrey
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: InstallTypeDlg doesn't change the AI_InstallPerUser prop

You're welcome Andrey,

If there is anything else I can help you with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”