Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am working on an installer using Wix 3.5 that needs to set the system PATH environment variable.

This is how I am setting the environment variable:

<Directory Id="DirectoryName">
    <Component Id="ComponentID" Guid="{BE20AF67-5943-4AF4-BE66-226E2D4B844F}">
        <Environment Id="EnvironmentID" Name="PATH" Action="set" Value="the path" Part="last" Separator=";" System="yes" />
    </Component>
</Directory>

This seems to be working on 32-bit systems without requiring a reboot for the changes to be recognized. However, when I try it on 64-bit Windows 7 a reboot is required.

Is this a known issue on 64-bit systems?

Maybe the best approach would be to schedule a reboot to cover all bases.

Thanks, Alan

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
845 views
Welcome To Ask or Share your Answers For Others

1 Answer

Check this question on ServerFault: How do you add a Windows environment variable without rebooting?

So to propagate the change to the list of environment variables, you can write a small program which broadcasts WM_SETTINGCHANGE message as described in KB article How to propagate environment variables to the system.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...