Problem with environment variables. - 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!

ultrasparc
Posts: 4
Joined: Wed Sep 10, 2008 8:01 am

Problem with environment variables.

I'm using the "Per-machine if user is administrator, per-user otherwise" installation type. My program needs two environment variables.
If I use windowsNT/2000 system variables, I can't install the program as limited user because the limited user has not the privileges to create system variables. If I use user associated environment variables and I install the program as administrator, I can't run the program as simple user. How can I solve this problem? I have to create two copies of every environment variable I need (one system variable and one user variable)?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Problem with environment variables.

Hi,

What you need can be done by using duplicate environment variables (like you mentioned): one has the "Windows NT/2000 system variable" option checked and the other doesn't have this option checked. The system variable can be placed in a component which uses this condition: Privileged. The user variable can be placed into a component which uses this condition: NOT Privileged. You can use any component in the Organization page or you can create new ones by using dummy registry values.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ultrasparc
Posts: 4
Joined: Wed Sep 10, 2008 8:01 am

Re: Problem with environment variables.

All the components in my applications have the Condition field empty in the "Component Properties".
If I try to edit the condition field I can't find the privileged or NOT privileged options. Can you tell me something more?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Problem with environment variables.

Hi,
I can't find the privileged or NOT privileged options.
Please note that Advanced Installer does not have predefined conditions which use the Privileged property. However, you can manually set the "Expression" field to:

Code: Select all

Privileged
or

Code: Select all

NOT Privileged
When the installation runs Windows Installer evaluates the "Privileged" property. If it is set to a value ("Privileged") then the user has Administrator right, otherwise ("NOT Privileged") the user has limited rights.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ultrasparc
Posts: 4
Joined: Wed Sep 10, 2008 8:01 am

Re: Problem with environment variables.

Cosmin thanks for your help and forgive me for my bad english and for my insistence.
The component that use the Privileged property is not installed running the installer as limited user.
The component that use Not privileged property is not installed running the installer as administrator.
I can't use any essential component of my application.
Is it a good solution to create two useless components (one privileged and one not privileged) used only for containing the environment variables?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Problem with environment variables.

Hi,
I can't use any essential component of my application.
Is it a good solution to create two useless components (one privileged and one not privileged) used only for containing the environment variables?
Yes, you can create two dummy components which contain the environment variables. For example, you can create two registry entries in the Registry page, one for each environment variable. When the installation runs only one of these entries will be created (the one which corresponds to the installed environment variable).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ultrasparc
Posts: 4
Joined: Wed Sep 10, 2008 8:01 am

Re: Problem with environment variables.

Is there any problem if I use two dummy files instead of two dummy registry entries?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Problem with environment variables.

Hi,
Is there any problem if I use two dummy files instead of two dummy registry entries?
No, there is no problem. You can use any resource you want as long as it creates a component in the "Organization" page.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”