running your process. The Windows Installer documentation says that its
like your solution is fine.
"Saurabh" <Saurabh@discussions.microsoft.com> wrote in message
news:6D39A619-DEA2-4FFE-8822-92F42973AAA5@microsoft.com...
> Phil,
> I am using s Custom action(a Console Application) to create the desired
> System variable (I mean the registry entry in
> 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session
> Manager\Environment' key), but after the custom actions are done and the
> installation is over the Environment variable is not getting loaded ...
> but
> now I am explicitly sending that message and its working fine....
>
> Tell me if my approach is right one.....
>
> thanz again,
> Saurabh
>
> "Phil Wilson" wrote:
>
>> If your custom actions are in Visual Studio setup projects, I think the
>> broadcast setting change is after them. I think it happens right at the
>> end,
>> which is after your custom actions.
>> --
>> Phil Wilson
>> [Microsoft MVP-Windows Installer]
>> "Saurabh" <Saurabh@discussions.microsoft.com> wrote in message
>> news:20E8C9F8-AB85-4DC6-ADA8-C2FC61AF1CCE@microsoft.com...
>> > Hi Phil,
>> >
>> > I finally got the solution .... :)
>> > I am boradcasting 'WM_SETTINGCHANGE' message by invoking
>> > SendMessageTimeout
>> > method (of user32.dll) by PInvoke. It is able to refresh the System
>> > Variables.
>> >
>> > BTW I think that either the MSI Installer process is not broadcasting
>> > the
>> > 'WM_SETTINGCHANGE' message, or if at all it is, it's getting so before
>> > my
>> > custom actions are closing. [I am using a custom action to create the
>> > System
>> > variable].
>> >
>> > What do you say?
>> >
>> > thanks again,
>> > Saurabh
>> >
>> >
>> > "Phil Wilson" wrote:
>> >
>> >> If this application is a Service, there's no way to cause it to
>> >> refresh
>> >> without a system restart that I'm aware of.
>> >>
>> >> The WM_SETTINGCHANGED message is what broadcasts these changes IIRC,
>> >> but
>> >> I
>> >> thought an MSI install broadcast one at the end of an install. When
>> >> are
>> >> you
>> >> starting the process?
>> >> --
>> >> Phil Wilson
>> >> [Microsoft MVP-Windows Installer]
>> >> Definitive Guide to Windows Installer
>> >>
http://apress.com/book/bookDisplay.html?bID=280 >> >>
>> >> "Saurabh Bhatnagar" <Saurabh Bhatnagar@discussions.microsoft.com>
>> >> wrote
>> >> in
>> >> message news:B750CE3F-4E02-4F81-9334-80F3123AE714@microsoft.com...
>> >> > Hi People,
>> >> >
>> >> > I am installing a couple of .NET and non-.NET applications, using a
>> >> > Setup
>> >> > and Deployment Project.
>> >> > I need to create an Environment variable, (System Variable, of
>> >> > System/Global
>> >> > scope is system and not the current process), at the installation
>> >> > time.
>> >> > One
>> >> > of the .NET Application will require that Environment Variable to be
>> >> > passed
>> >> > to it at the time of execution.
>> >> >
>> >> > System.Environment class doesn't provide any way to Create a new
>> >> > Environment
>> >> > variable, but the wayaround suggested by MS is to PInvoke
>> >> > 'SetEnvironmentVariable()' method of Kernel32.dll.
>> >> > It creates an Environment variable but only for the current
>> >> > process.....
>> >> > But
>> >> > I need to create one for the System level scope.
>> >> >
>> >> > I tried creating a string value under the
>> >> > HKeyLocalMachine\SYSTEM\CurrentControlSet\Control\Session
>> >> > Manager\Environment, which though creates the Environment variable
>> >> > but
>> >> > doesn't loads it into the memory, untill the system restarts....
>> >> > which
>> >> > I
>> >> > don't want..
>> >> >
>> >> > Can anyone tell me a way to somehow Inject this newly created
>> >> > Enviromnet
>> >> > Variable in memory... or an Win32 API which can be used to create
>> >> > and
>> >> > simultaneously load the created system variable in memory, so that
>> >> > it
>> >> > can
>> >> > be
>> >> > used by the specific application, with out restarting the system.
>> >> >
>> >> > thanx in advance,
>> >> > Saurabh
>> >> >
>> >>
>> >>
>> >>
>>
>>
>>