Set Enviornment doesn't refresh Enviornment

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

Set Enviornment doesn't refresh Enviornment

Postby ckaware » Wed Aug 31, 2011 7:27 am

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

Postby ckaware » Wed Aug 31, 2011 7:28 am

I'm using IA12.

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

Re: Set Enviornment doesn't refresh Enviornment

Postby giaviv » Wed Aug 31, 2011 9:18 am

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

Postby ckaware » Wed Aug 31, 2011 9:44 am

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

Postby giaviv » Wed Aug 31, 2011 3:57 pm

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

Postby ckaware » Thu Sep 01, 2011 5:54 am

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

Postby giaviv » Thu Sep 01, 2011 11:52 am

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

Postby ckaware » Tue Sep 13, 2011 6:13 pm

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/viewtopic.php?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

Postby giaviv » Wed Sep 14, 2011 9:51 am

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

Postby ckaware » Wed Sep 14, 2011 10:15 am

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

Postby giaviv » Wed Sep 14, 2011 5:29 pm

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


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 134 guests