Set Enviornment doesn't refresh Enviornment

Got a problem you cannot solve? Try here.
Post Reply
ckaware
Posts: 125
Joined: Thu Mar 17, 2011 11:43 am

Set Enviornment doesn't refresh Enviornment

Post by ckaware »

I'm coming off of InstallAnywhere where you can issue a "RefreshEnviornment" Action after setting Env. variables.
InstallAware doesn't seem to fully refresh the system environment after setting variables.

Can this be fixed?

Thanks,

Chris
ckaware
Posts: 125
Joined: Thu Mar 17, 2011 11:43 am

Re: Set Enviornment doesn't refresh Enviornment

Post by ckaware »

I'm using IA12.
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Set Enviornment doesn't refresh Enviornment

Post by giaviv »

Chris,

Can you please further elaborate about this - what exactly are you trying to do, and how are you observing the wrong behavior?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
ckaware
Posts: 125
Joined: Thu Mar 17, 2011 11:43 am

Re: Set Enviornment doesn't refresh Enviornment

Post by ckaware »

Essentially, the installer sets a bunch of Environment variables and correctly sets the HKLM\SYSTEM\CURRENTCONTROLSET\SESSION MANAGER\ENVIRONMENT keys; however, when opening a command prompt or running an application after the fact, the environment isn't refreshed/ updated.
Shouldn't InstallAware call:

SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,
(LPARAM) "Environment", SMTO_ABORTIFHUNG,
5000, &dwReturnValue);

To correctly refresh the System Environment?

Thanks,

Chris
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Set Enviornment doesn't refresh Enviornment

Post by giaviv »

Chris,

You can use the Call DLL Function MSIcode command to achieve this - just pass along the parameters you specific above and that should work!
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
ckaware
Posts: 125
Joined: Thu Mar 17, 2011 11:43 am

Re: Set Enviornment doesn't refresh Enviornment

Post by ckaware »

I figured it was doable, but was just wondering why there isn't any built in functionality :). If a developer "Sets Env. Var" I'm sure 99.9% of the time they'd want the system env. refreshed.

Also, What DLL would you target here, my assumption is user32.dll
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Set Enviornment doesn't refresh Enviornment

Post by giaviv »

Yes its indeed user32.dll.

Actually, when you set environment variable in cmd, they dont refresh automatically either..
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
ckaware
Posts: 125
Joined: Thu Mar 17, 2011 11:43 am

Re: Set Enviornment doesn't refresh Enviornment

Post by ckaware »

Is there any chance InstallAware will have this call built in in an updated version? Your competition (InstallShield/ InstallAnywhere) both provide "Refresh Environment" calls.

I'm still having problems calling this in user32.dll.

The following post was never answered by another user with a similar issue:

http://www.installaware.com/forum/viewt ... f=2&t=2754

Just curious :).

Chris
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Set Enviornment doesn't refresh Enviornment

Post by giaviv »

Chris,

Thank you for your input. We will do out best to support this in the future.

What problem are you having with calling user32.dll?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
ckaware
Posts: 125
Joined: Thu Mar 17, 2011 11:43 am

Re: Set Enviornment doesn't refresh Enviornment

Post by ckaware »

The problem is passing in arguments to the SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,(LPARAM) "Environment", SMTO_ABORTIFHUNG, 5000, &dwReturnValue); using the Call DLL function and User32.dll.

Do you know how these would be passed in?

Not matter what I try, it's not working. I've posted a link to someone with similar problems back in 2007...

Chris
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Set Enviornment doesn't refresh Enviornment

Post by giaviv »

Hey Chris,

This should. As a workaround, you can create your own dll than calls this function from user32.dll, and invoke this dll using the Call DLL Function command.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply