Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
A request came in this week from a customer who was seeking help with adding to the System Environment Variable PATH in an XPe runtime from a component with their own defined path. Well - considering this is something I've never done before and something that I needed to do for a test component I have been working on lately I decided to figure this question out. It turns out this is very simple. Here are the steps.
- Open Component Designer and create a new component or open your existing component in Component Designer
- Click on the Registry Data node
- Right click in the Right pane, select Add, and then select Registry Data
- Click the browse button
- Browse to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environmentthen select "Path" then click OK. - Change the Value to be ";(Your Path)". The semi-colon is required for correct formatting of the variable. Just add one to the begining of what you are adding. Ensure that there is NO SPACE between the semi-colon and the begining of your path.
- Click the Advanced Button
- Click the "Write Options" drop down and select "Always Edit this Value" then click OK. Setting this value will make it so that your component will edit the value that already exists instead of removing what is already there which was added by the Session Manager component. It's good to play nice. *grin*
- Click on the "Build Order Dependency" node in your component
- Right click in the Right pane, select Add, and then select Component Build Order Dependency
- Locate in the component list the "Session Manager (Windows subsystem)" component. In my case the revision (or "RNNNN" value) is 2890. Just utilize the highest valued one you have there.
- Ensure that "Before my component" is selected in the "Build selected component..." pane then click OK. Repeat this step and the previous two steps to add another dependency upon the "WMI Core" component.
- Right click in the Right pane, select Add, and then select Group Build Order Dependency
- Locate in the group list the "Computers dependency group" group.
- Ensure that "Before building my component" is selected in the "Build all components of the selected group..." pane then click OK.
- Save your SLD component file.
That is all you should have to do. I cannot stress enough that you need to ensure that your path addition is properly formatted. For more information on the PATH environment variable please see this page. It is a page on how to use the path command with a command window; however, does describe how the PATH environment variable is used and can be manipulated. I've also created an example component which would modify the path in a runtime. You can download that SLD from here.
Oh - and please note. The UI *IS* from Windows Vista; however, I am using the Windows XP Embedded toolset and nothing more. The UI is simply provided by the OS. For more information on Vista please visit the Windows Vista Home Page. To see more screenshots of the UI from a well known reviewer please visit WinSuperSite.com.
Cheers!
Update 2006.08.03
It has been discovered by a fellow named Trevor that there are two other build dependencies required that can prevent your addition from being built into your runtime similarly to the Session Manager above. In that step - I have updated the instructions to include another component build order dependency on WMI Core as well as a group build order dependency upon the Computers Dependency Group. The example SLD has also been updated above.
Thanks much Trevor!
- Nick
Comments
- Anonymous
July 11, 2007
The comment has been removed