设置环境变量需要重新启动64位 [英] Setting environment variables requires reboot on 64-bit
问题描述
我正在使用Wix 3.5安装程序,需要设置系统PATH环境变量。
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>
这似乎在32位系统上工作,而不需要重新启动才能识别更改。但是,当我在64位Windows 7上尝试重新启动时,需要重新启动。
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.
这是64位系统上的已知问题吗?
Is this a known issue on 64-bit systems?
可能最好的方法是安排重新启动以覆盖所有基础。
Maybe the best approach would be to schedule a reboot to cover all bases.
谢谢,
Alan
Thanks, Alan
推荐答案
在ServerFault上检查此问题:如何在不重新启动的情况下添加Windows环境变量?
Check this question on ServerFault: How do you add a Windows environment variable without rebooting?
为了将更改传播到环境变量列表,您可以编写一个小程序,广播 WM_SETTINGCHANGE
消息,如知识库文章如何传播环境系统的变量。
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.
这篇关于设置环境变量需要重新启动64位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!