【发布时间】:2010-08-06 15:09:25
【问题描述】:
我在 MSBuild 中有一个属性来表示 MSBuildProjectDirectory 上方的目录:
<PropertyGroup>
<BuildDir>$(MSBuildProjectDirectory)\..</PRSBuildDir>
</PropertyGroup>
然后我需要使用此属性,但我需要清理目录字符串以使其不包含..。换句话说,我需要评估..,因此如果当前项目文件在C:\Test\Tom\MyDir 中,那么我需要一个包含字符串C:\Test\Tom 的属性。
我问的原因是因为我试图运行这样的命令:
msiexec /passive /i "D:\Build\2.3.84.40394\Deployment\..\Vendor\LogParser.msi"
但它抱怨到 msi 的路径:This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.
【问题讨论】:
标签: msbuild relative-path absolute-path