autoform
Posts: 17
Joined: Fri May 11, 2012 10:41 am

Problems with System environment variables

Hi,

In our product we are setting two system environment variables. However,immediately after installation the new variables are not visible from command line (ie. not available as user variable).
We noticed it takes some time to propagate system variables available from command line, or, when we press 'Ok' from Control Panel\System and Security\System - > Advanced System settings -> Environment variables it gets propagated.
Windows version used is Win7 64 bit.

Do you know, what we need to perform in order to make the system variables available to local user immediately?
Can you help?

regards,
Mahua
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Problems with System environment variables

Hi Mahua,

Having the "System variable" option enabled should ensure this. Also, environment variables cannot be used by the same process which creates them, but they should be available after installation.
Does this behavior persist on several similar clean machines?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
autoform
Posts: 17
Joined: Fri May 11, 2012 10:41 am

Re: Problems with System environment variables

Hi Mihai,

Yes it persists on different machine. We have verified this in 3 different Win7 64 bit machine. And this problem is consistent.

regards,
Mahua
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Problems with System environment variables

Hello Mahua,

I have tested this on a Windows 7 x64 machine and it works as expected:
- when having the "System variable" option enabled, the environment variable is available in the System variable group after install
- with "System variable" disabled, the environment variable is available in the current user variable group after install ("User variables for <current_user>" group)

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
autoform
Posts: 17
Joined: Fri May 11, 2012 10:41 am

Re: Problems with System environment variables

Hi Mihai,

We have 'System' option enabled and our two environment variables are correctly set as 'System variable'. This is ok.

However, immediately after installation these two environment variables are not available to user for use. For example, after installation, if you open command prompt and execute 'set' command these two environment variables will not be available. If we wait some time, or if we press 'Ok' from Control Panel\System and Security\System - > Advanced System settings -> Environment variables then these two variables are available to user again.

My question was, do you know how we make these two system environment variables immediately available to user?

Regards,
Mahua
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Problems with System environment variables

Hello Mahua,

set has effect in local cmd context and once you exit or close the cmd window, you'll lose the environment variable
setx has effect in future cmd context, hence you won't see the environment variable and its value in the current cmd ( available only in a new cmd window )

I tried the following consecutive operations on a Windows 7 x64 machine:
- installed a package with two environment variables
- open cmd shell as admin
- ran following command one after the other:

Code: Select all

set
=> the recently installed environment variable were correctly displayed in the shell

Code: Select all

setx MyVariable "test" /m
=> prompted the command was successfully executed and the environment variable edited from "initial" value to "test" value (verified this from Advanced System Settings -> Environment variables)

Can you please provide an exact step by step test case and underline why it represents a setback for you?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
autoform
Posts: 17
Joined: Fri May 11, 2012 10:41 am

Re: Problems with System environment variables

Hi Mihai,

I understand there is a major misunderstanding here. I am using 'set' not to set environment variables but to list the available environment variables.

So, here are my steps -

1. Run installer and create environment variables (as 'System' )
2. Open cmd prompt, and execute 'set'. It shows up many environment variables but not the two that I have created during installation.

3. At this point, I go to Control Panel\System and Security\System - > Advanced System settings -> Environment variables, press 'Ok'.
4. Opens another cmd prompt and execute 'set'. This time, I can see my environment variables.

My question was, without step 3 how my environment variables can be available?

We have found step3 as a work around to this problem but this is not convenient.

regards,
Mahua
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Problems with System environment variables

Hi Mahua,

Unfortunately we cannot replicate this issue on our test machines. As I mentioned in my previous post, the recently installed environment variables were listed correctly using set right after install without having to navigate in Advanced System Settings.

You can send us your installer package via e-mail or provide the link for an online download location so we can see what you mean. If you're worried on confidentiality matters just isolate the minimal settings on a small test installer and attach it to this thread.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
autoform
Posts: 17
Joined: Fri May 11, 2012 10:41 am

Re: Problems with System environment variables

Hi Mihai,

I send the project file to AI support through email.

regards,
Mahua
autoform
Posts: 17
Joined: Fri May 11, 2012 10:41 am

Re: Problems with System environment variables

Hi Mihai,
I resend the latest project file to support email.

regards,
Mahua
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Problems with System environment variables

Hi,

We made a couple of new tests with projects using similar settings with the one you sent to us and we were able to identify the problem. This is caused by a bug in Advanced Installer for packages that use Enhanced UI, i.e. all custom themes. A fix will be available very soon, thank you for bringing this to our attention.

The only solution for the moment is to disable Enhanced UI from Themes page, set it to "Never" option and use the Classic theme, as this is the only theme that is supported without Enhanced UI.

Please note that when you switch a theme in your project all customized dialogs will be lost, so its better to have a backup copy of the project file, so you can manually recreate any custom dialogs in the new project.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Problems with System environment variables

Hi,

This was fixed in version 10.1 of Advanced Installer released on May 2, 2013.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Problems with System environment variables

Wow good to know as I was using my own Custom Action in C# and firing off a WM_SETTINGCHANGE event.

My current issue has been an MSM setting system variables under UAC and a service not being able to pick-up those variables.
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Problems with System environment variables

I'm finding within an MSM that sets an environment variable within that same MSM (after InstallFinalize) I launch a batch file (with a 'set' in it) and the environment variables aren't seen.

I'm using 10.1, they are defined as "system", this is on Window 7 with UAC on. Also I run the batch file as Administrator.
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Problems with System environment variables

Hello,

I've tested your scenario, but I cannot reproduce the behavior. Can you please try to isolate the behavior in a sample or can you give us a detailed step by step test case scenario which reproduces the behavior?

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

Return to “Common Problems”