更改自定义生成步骤的路径

时间:2022-12-02 16:32:49

I have inherited a visual studio 2003 project which uses some custom build steps. I'm having some trouble with the path to the tool. Where does visual studio get its PATH? I've echoed out %PATH% in the custom build step and it has no resemblance to the system path. I did find a value in the registry

我继承了一个visual studio 2003项目,该项目使用了一些自定义构建步骤。我在使用该工具的路径时遇到了一些麻烦。 visual studio在哪里获得PATH?我在自定义构建步骤中回显了%PATH%,它与系统路径没有相似之处。我确实在注册表中找到了一个值

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories

Path Dirs which looked like it might be the path used by visual C but chaning it doesn't seem to alter the path in VC. Any ideas?

路径Dirs看起来可能是视觉C使用的路径但是chaning它似乎并没有改变VC中的路径。有任何想法吗?

1 个解决方案

#1


0  

Visual Studio has the annoying habit of 'playing' with your path, which leads to the effect you've seen.

Visual Studio有一种令人烦恼的习惯,就是“玩”你的路径,这会产生你所看到的效果。

The easiest way to work around it if you're willing to change the environment inside VS (which will change it for all your projects) would be to go to Tools > Options > Projects > VC++ Directories and add the required directories to the appropriate setting - in your case that should be 'Executable files'.

如果您愿意更改VS中的环境(将为所有项目更改它),解决此问题的最简单方法是转到工具>选项>项目> VC ++目录,并将所需目录添加到适当的设置 - 在你的情况下应该是'可执行文件'。

Another method I am using if I don't want to change the overall environment is to create a batch file that first calls vsvars32.bat for the appropriate compiler version, then manipulate the PATH variable and finally starts 'devenv'. I actually prefer this approach but it means your disk is littered with small batch files that you'll only use to kick off Visual Studio...

如果我不想改变整体环境,我正在使用的另一种方法是创建一个批处理文件,首先调用vsvars32.bat以获取相应的编译器版本,然后操作PATH变量并最终启动'devenv'。我实际上更喜欢这种方法,但这意味着你的磁盘上堆满了小批量文件,你只能用来开启Visual Studio ......

#1


0  

Visual Studio has the annoying habit of 'playing' with your path, which leads to the effect you've seen.

Visual Studio有一种令人烦恼的习惯,就是“玩”你的路径,这会产生你所看到的效果。

The easiest way to work around it if you're willing to change the environment inside VS (which will change it for all your projects) would be to go to Tools > Options > Projects > VC++ Directories and add the required directories to the appropriate setting - in your case that should be 'Executable files'.

如果您愿意更改VS中的环境(将为所有项目更改它),解决此问题的最简单方法是转到工具>选项>项目> VC ++目录,并将所需目录添加到适当的设置 - 在你的情况下应该是'可执行文件'。

Another method I am using if I don't want to change the overall environment is to create a batch file that first calls vsvars32.bat for the appropriate compiler version, then manipulate the PATH variable and finally starts 'devenv'. I actually prefer this approach but it means your disk is littered with small batch files that you'll only use to kick off Visual Studio...

如果我不想改变整体环境,我正在使用的另一种方法是创建一个批处理文件,首先调用vsvars32.bat以获取相应的编译器版本,然后操作PATH变量并最终启动'devenv'。我实际上更喜欢这种方法,但这意味着你的磁盘上堆满了小批量文件,你只能用来开启Visual Studio ......