List all Defined MSBuild Variables - Equivalent to set - msbuild

Is there a way to list all defined variables in an executing MSBuild project?
I'm trying to figure out exactly what paths and variables are set (to pass into WiX), and it's difficult to debug everything. Essentially, I would like something equivelent to running set at the command line. Example:
C:\Users\dsokol>set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\dsokol\AppData\Roaming
asl.log=Destination=file
CLASSPATH=.;C:\Program Files (x86)\QuickTime\QTSystem\QTJava.zip
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
...
Except that I would like it to list out all of the MSBuild variables (such as Target, OutDir?, and all the crap I've defined in the top of the XML file. Ideally:
$(OutDir)="C:\MyOutDir\bin"
$(ProductVersion)="6.1.0"
$(Platform)="Win32"
Does such a thing exist?

Have you tried running msbuild with with /v:diag command line option? This prints out all of the properties which includes the environment variables and the properties that have been set.

I bingoogled everywhere and couldn't find anything about existing code that does it, so I came with my own approach.
First - you build a project with msbuild using the preprocess/pp parameter to put all the linked projects to a single file.
C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /verbosity:detailed /fl /p:Configuration=Debug /p:Platform=x86 MyApp.csproj /pp:flatproject.proj >detailedlog.txt
That already gives you a single project xml file with all properties that were set (perhaps except the environment variables or the ones passed with the /p parameter to msbuild or perhaps some others that might be set otherwise). For me that's over 800 properties. Now if you want to compile a list in alphabetical order - you could do that with a little bit of code - in my case C# and XAML:
<Window x:Class="WpfApplication4.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApplication4"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TextBox
x:Name="tb"
VerticalAlignment="Stretch"
HorizontalScrollBarVisibility="Visible"
VerticalScrollBarVisibility="Visible"/>
</Grid>
</Window>
C# bit:
public partial class MainWindow : Window
{
Dictionary<string,string> properties = new Dictionary<string, string>();
public MainWindow()
{
InitializeComponent();
var xml = new XmlDocument();
xml.LoadXml(File.ReadAllText(#"c:\git\Photos\Photos\AppStubCS\AppStubCS.Windows\x.prop"));
PopulateProperties(xml);
SortAndOutput();
}
private void SortAndOutput()
{
var sb = new StringBuilder();
foreach (var kvp in properties.OrderBy(kvp => kvp.Key))
{
sb.AppendFormat("{0}: {1}\r\n", kvp.Key, kvp.Value);
}
this.tb.Text = sb.ToString();
}
private void PopulateProperties(XmlNode xml)
{
if (xml.Name == "PropertyGroup")
{
foreach (var childNode in xml.ChildNodes.OfType<XmlElement>())
{
var name = childNode.Name;
var val = childNode.InnerText;
if (properties.ContainsKey(name))
{
properties[name] = val;
}
else
{
properties.Add(name, val);
}
}
}
else
{
foreach (var childNode in xml.ChildNodes.OfType<XmlElement>())
{
PopulateProperties(childNode);
}
}
}
}
My list:
_AdjustedPlatform
_AppContainsManagedCodeForInjection
_AppContainsManagedCodeInItsClosure
_AppxBundlePlatformsForNamingIntermediate
_AppxManifestXmlFileName
_AppxMSBuildTaskAssembly
_AppxMSBuildToolsPath
_AppxPackageConfiguration
_AssemblyTimestampAfterCompile
_AssemblyTimestampBeforeCompile
_ContinueOnError
_ConvertedPlatform
_CoreRuntimeMSBuildTaskAssembly
_CoreRuntimePackageId
_CreateAppxBundleFilesDependsOn
_CreateAppxBundlePlatformSpecificArtifactsDependsOn
_CreateAppxPackageDependsOn
_CustomAppxManifestUsed
_DebugSymbolsProduced
_DeploymentApplicationDir
_DeploymentApplicationFolderName
_DeploymentApplicationManifestIdentity
_DeploymentApplicationUrl
_DeploymentBaseManifest
_DeploymentBuiltMinimumRequiredVersion
_DeploymentBuiltUpdateInterval
_DeploymentBuiltUpdateIntervalUnits
_DeploymentComponentsUrl
_DeploymentCopyApplicationManifest
_DeploymentDeployManifestIdentity
_DeploymentFileMappingExtension
_DeploymentManifestType
_DeploymentManifestVersion
_DeploymentPublishableProjectDefault
_DeploymentTargetApplicationManifestFileName
_DeploymentUrl
_DocumentationFileProduced
_EmbedFileResfilePath
_ExtractPlatforms
_FileNameToRemove
_FileToBuild
_FindDependencies
_FrameworkSdkNames
_GatekeeperCmd
_GatekeeperPlatformTarget
_GCTODIKeepDuplicates
_GCTODIKeepMetadata
_GenerateAppxManifestDependsOn
_GenerateAppxPackageBaseDependsOn
_GenerateAppxPackageDependsOn
_GenerateAppxPackageRecipeDependsOn
_GenerateAppxUploadPackageRecipeDependsOn
_GenerateBindingRedirectsIntermediateAppConfig
_GenerateProjectPriFileDependsOn
_GetChildProjectCopyToOutputDirectoryItems
_GetPackagePropertiesDependsOn
_IlcBuildType
_IlcExePath
_IlcExitCode
_IlcExternalReferencePath
_IlcFrameworkDependencies
_IlcInputPath
_IlcIntermediatePath
_IlcInvocationParameters
_IlcKeepIntermediates
_IlcMinBehavioralExitCode
_IlcParameters
_IlcResponseFile
_IlcRootPath
_IlcSharedAssemblyDefinitionFile
_IlcSharedAssemblyRootPath
_IlcSuppressPDBWarnings
_IlcVerbosity
_IntermediateWindowsMetadataPath
_InvalidConfigurationError
_InvalidConfigurationMessageText
_InvalidConfigurationWarning
_LayoutResfilesPath
_MultipleQualifiersPerDimensionFound
_MultipleQualifiersPerDimensionFoundPath
_NetCoreFrameworkInjectionNeeded
_NuGetRuntimeIdentifierPlatformTargetSuffix
_NuGetRuntimeIdentifierWithoutAot
_NuGetTargetFallbackMoniker
_OriginalConfiguration
_OriginalPlatform
_PackagingOutputsIncludesFramework
_PdbOutputRoot
_PlatformTargetForCoreRuntime
_PlatformTargetForIlcVersion
_PriConfigXmlPath
_PriResfilesPath
_ProjectArchitectureOutput
_ProjectArchitecturesFilePath
_ProjectDefaultTargets
_ProjectNPlatformSupported
_ProjectNProjectSupported
_ProjectNToolchainEnabled
_ProjectPriFileName
_ProjectPriFullPathOriginal
_ProjectSpecificProjectJsonFile
_QualifiersPath
_Rebuilding
_ResolveReferenceDependencies
_ResourcesResfilesPath
_ReverseMapProjectPriDirectory
_ReverseMapProjectPriFileName
_ReverseMapProjectPriUploadDirectory
_ReverseMapProjectPriUploadFileName
_SGenDllCreated
_SGenDllName
_SGenGenerateSerializationAssembliesConfig
_ShouldUnsetParentConfigurationAndPlatform
_SolutionConfigurationContentsToUse
_StoreManifestSchemaDir
_SupportEmbedFileResources
_SupportXbfAsEmbedFileResources
_TargetPlatform
_TargetPlatformIsWindowsPhone
_TargetPlatformMetadataPath
_TargetsCoreRuntime
_TargetToBuild
_TransformedAppxManifestXmlFile
_TransformedProjectPriFullPath
_WindowsMetadataOutputPath
_WindowsSDKSignToolPath
_WinMDDebugSymbolsOutputPath
_WinMDDocFileOutputPath
_WireUpCoreRuntimeExitCode
_WireUpCoreRuntimeMsg
_WireUpCoreRuntimeTaskExecuted
_XamlTemporaryAssemblyPath_
AddAppConfigToBuildOutputs
AddBuildInfoToAssembly
AddSyntheticProjectReferencesForSolutionDependencies
AfterBuildLinkTargets
AllOutputGroupsDependsOn
AllowedPlatformsForProjectN
AllowedReferenceAssemblyFileExtensions
AllowedReferenceRelatedFileExtensions
AllowLocalNetworkLoopback
AltPlatformTarget
AlwaysUseNumericalSuffixInItemNames
AppConfig
AppConfigForCompiler
AppDesignerFolder
AppLocalMetadataPath
AppxBundle
AppxBundleAutoResourcePackageQualifiers
AppxBundleDefaultValueUsed
AppxBundleDir
AppxBundleExtension
AppxBundleFolderSuffix
AppxBundleMainPackageFileMapGeneratedFilesListPath
AppxBundleMainPackageFileMapIntermediatePath
AppxBundleMainPackageFileMapIntermediatePrefix
AppxBundleMainPackageFileMapIntermediatePriPath
AppxBundleMainPackageFileMapPath
AppxBundleMainPackageFileMapPrefix
AppxBundleMainPackageFileMapSuffix
AppxBundleManifestVersion
AppxBundleOutput
AppxBundlePlatforms
AppxBundlePlatformsForNaming
AppxBundlePlatformSpecificArtifactsListPath
AppxBundlePlatformSpecificUploadArtifactsListPath
AppxBundlePriConfigXmlForMainPackageFileMapFileName
AppxBundlePriConfigXmlForSplittingFileName
AppxBundleProducingPlatform
AppxBundleResourcePacksProducingPlatform
AppxBundleSplitResourcesGeneratedFilesListPath
AppxBundleSplitResourcesPriPath
AppxBundleSplitResourcesPriPrefix
AppxBundleSplitResourcesQualifiersPath
AppxCopyLocalFilesOutputGroupIncludeXmlFiles
AppxDefaultHashAlgorithmId
AppxDefaultResourceQualifiers
AppxDefaultResourceQualifiers_UAP
AppxDefaultResourceQualifiers_Windows_80
AppxDefaultResourceQualifiers_Windows_81
AppxDefaultResourceQualifiers_Windows_82
AppxDefaultResourceQualifiers_Windows_Phone
AppxFilterOutUnusedLanguagesResourceFileMaps
AppxGeneratePackageRecipeEnabled
AppxGeneratePriEnabled
AppxGeneratePrisForPortableLibrariesEnabled
AppxGetPackagePropertiesEnabled
AppxHarvestWinmdRegistration
AppxHashAlgorithmId
AppxIntermediateExtension
AppxLayoutDir
AppxLayoutFolderName
AppxMainPackageOutput
AppxMSBuildTaskAssembly
AppxMSBuildToolsPath
AppxOSMaxVersionTested
AppxOSMaxVersionTestedReplaceManifestVersion
AppxOSMinVersion
AppxOSMinVersionReplaceManifestVersion
AppxPackage
AppxPackageAllowDebugFrameworkReferencesInManifest
AppxPackageArtifactsDir
AppxPackageDir
AppxPackageDirInProjectDir
AppxPackageDirName
AppxPackageDirWasSpecified
AppxPackageExtension
AppxPackageFileMap
AppxPackageIncludePrivateSymbols
AppxPackageIsForStore
AppxPackageName
AppxPackageNameNeutral
AppxPackageOutput
AppxPackagePipelineVersion
AppxPackageRecipe
AppxPackageSigningEnabled
AppxPackageTestDir
AppxPackageValidationEnabled
AppxPackagingArchitecture
AppxPackagingInfoFile
AppxPPPrefix
AppxPrependPriInitialPath
AppxPriConfigXmlDefaultSnippetPath
AppxPriConfigXmlPackagingSnippetPath
AppxPriInitialPath
AppxResourcePackOutputBase
AppxSkipUnchangedFiles
AppxStoreContainer
AppxStoreContainerExtension
AppxStrictManifestValidationEnabled
AppxSymbolPackageEnabled
AppxSymbolPackageExtension
AppxSymbolPackageOutput
AppxSymbolStrippedDir
AppxTestLayoutEnabled
AppxUploadBundleDir
AppxUploadBundleMainPackageFileMapGeneratedFilesListPath
AppxUploadBundleMainPackageFileMapIntermediatePath
AppxUploadBundleMainPackageFileMapIntermediatePriPath
AppxUploadBundleMainPackageFileMapPath
AppxUploadBundleOutput
AppxUploadBundlePriConfigXmlForMainPackageFileMapFileName
AppxUploadBundlePriConfigXmlForSplittingFileName
AppxUploadBundleSplitResourcesGeneratedFilesListPath
AppxUploadBundleSplitResourcesPriPath
AppxUploadBundleSplitResourcesQualifiersPath
AppxUploadLayoutDir
AppxUploadLayoutFolderName
AppxUploadMainPackageOutput
AppxUploadPackageArtifactsDir
AppxUploadPackageDir
AppxUploadPackageFileMap
AppxUploadPackageOutput
AppxUploadPackageRecipe
AppxUploadPackagingInfoFile
AppxUploadSymbolPackageOutput
AppxUploadSymbolStrippedDir
AppxUseHardlinksIfPossible
AppxUseResourceIndexerApi
AppxValidateAppxManifest
AppxValidateStoreManifest
AssemblyFile
AssemblyFoldersSuffix
AssemblyName
AssemblySearchPaths
AssignTargetPathsDependsOn
AutoIncrementPackageRevision
AutoUnifyAssemblyReferences
AvailablePlatforms
BaseIntermediateOutputPath
BaseNuGetRuntimeIdentifier
BeforeRunGatekeeperTargets
BuildAppxSideloadPackageForUap
BuildAppxUploadPackageForUap
BuildCompileAction
BuildDependsOn
BuildGenerateSourcesAction
BuildId
BuildInfoBinPath
BuildInfoConfigFileName
BuildInfoFileName
BuildInfoPath
BuildInfoResourceFileName
BuildInfoResourceLogicalName
BuildInfoTargets
BuildingInTeamBuild
BuildingProject
BuildInParallel
BuildLabel
BuildLinkAction
BuildProjectReferences
BuildTimestamp
BuiltProjectOutputGroupDependsOn
CAExcludePath
CanUseProjectN
CleanDependsOn
CleanFile
CleanPackageAction
CodeAnalysisApplyLogFileXsl
CodeAnalysisFailOnMissingRules
CodeAnalysisForceOutput
CodeAnalysisGenerateSuccessFile
CodeAnalysisIgnoreGeneratedCode
CodeAnalysisIgnoreInvalidTargets
CodeAnalysisIgnoreMissingIndirectReferences
CodeAnalysisInputAssembly
CodeAnalysisLogFile
CodeAnalysisModuleSuppressionsFile
CodeAnalysisOutputToConsole
CodeAnalysisOverrideRuleVisibilities
CodeAnalysisPath
CodeAnalysisQuiet
CodeAnalysisRuleDirectories
CodeAnalysisRuleSet
CodeAnalysisRuleSetDirectories
CodeAnalysisSaveMessagesToReport
CodeAnalysisSearchGlobalAssemblyCache
CodeAnalysisStaticAnalysisDirectory
CodeAnalysisSucceededFile
CodeAnalysisSummary
CodeAnalysisTargets
CodeAnalysisTimeout
CodeAnalysisTLogFile
CodeAnalysisTreatWarningsAsErrors
CodeAnalysisUpdateProject
CodeAnalysisUseTypeNameInSuppression
CodeAnalysisVerbose
CodeAnalysisVSSku
ComFilesOutputGroupDependsOn
CommonTargetsPath
CommonXamlResourcesDirectory
CompileDependsOn
CompileLicxFilesDependsOn
CompileTargetNameForTemporaryAssembly
ComputeIntermediateSatelliteAssembliesDependsOn
ComReferenceExecuteAsTool
ComReferenceNoClassMembers
Configuration
ConfigurationName
ConsiderPlatformAsProcessorArchitecture
ContentFilesProjectOutputGroupDependsOn
ContinueOnError
CopyBuildOutputToOutputDirectory
CopyLocalFilesOutputGroupDependsOn
CopyNuGetImplementations
CopyOutputSymbolsToOutputDirectory
CopyWinmdArtifactsOutputGroupDependsOn
CoreBuildDependsOn
CoreCleanDependsOn
CoreCompileDependsOn
CoreResGenDependsOn
CoreRuntimeSDKLocation
CoreRuntimeSDKName
CreateCustomManifestResourceNamesDependsOn
CreateHardLinksForCopyAdditionalFilesIfPossible
CreateHardLinksForCopyFilesToOutputDirectoryIfPossible
CreateHardLinksForCopyLocalIfPossible
CreateHardLinksForPublishFilesIfPossible
CreateManifestResourceNamesDependsOn
CreateSatelliteAssembliesDependsOn
CscToolPath
CSharpCoreTargetsPath
CSharpTargetsPath
CURRENTVSINSTALLDIR
CustomAfterMicrosoftCommonProps
CustomAfterMicrosoftCommonTargets
CustomAfterMicrosoftCSharpTargets
CustomBeforeMicrosoftCommonProps
CustomBeforeMicrosoftCommonTargets
CustomBeforeMicrosoftCSharpTargets
CustomVersionNumber_Build
CustomVersionNumber_Build2
CustomVersionNumber_FullVersion
CustomVersionNumber_Major
CustomVersionNumber_Minor
CustomVersionNumber_Revision
CVN_Len
DebugSymbols
DebugSymbolsProjectOutputGroupDependsOn
DebugType
DefaultLanguage
DefaultLanguageSourceExtension
DeferredValidationErrorsFileName
DefineCommonCapabilities
DefineCommonItemSchemas
DefineCommonReferenceSchemas
DefineConstants
DelaySign
DesignTimeAssemblySearchPaths
DesignTimeAutoUnify
DesignTimeFindDependencies
DesignTimeFindRelatedFiles
DesignTimeFindSatellites
DesignTimeFindSerializationAssemblies
DesignTimeIgnoreVersionForFrameworkReferences
DesignTimeIntermediateOutputPath
DesignTimeResolveAssemblyReferencesDependsOn
DesignTimeResolveAssemblyReferencesStateFile
DesignTimeSilentResolution
DevEnvDir
DisableXbfGeneration
DocumentationProjectOutputGroupDependsOn
DotNetNativeRuntimeSDKMoniker
DotNetNativeSharedAssemblySDKMoniker
DotNetNativeTargetConfiguration
DotNetNativeVCLibsDependencySDKMoniker
DTARUseReferencesFromProject
EmbeddedWin32Manifest
EnableAppLocalFXWorkaround
EnableDotNetNativeCompatibleProfile
EnableFavorites
EnableNDE
EnableSigningChecks
ErrorEndLocation
ErrorReport
ExpandSDKAllowedReferenceExtensions
ExpandSDKReferencesDependsOn
ExportWinMDFile
ExtensionsToDeleteOnClean
ExtPackagesRoot
FacadeWinmdPath
FaceNextSdkRoot
FaceSdk_Bin_Path
FaceSdk_Inc_Path
FaceSdkWrapperRoot
FakesBinPath
FakesCommandLineArguments
FakesCompilationProperties
FakesContinueOnError
FakesGenerateBeforeBuildDependsOn
FakesImported
FakesIntermediatePath
FakesMSBuildPath
FakesOutputPath
FakesResolveAssemblyReferencesStateFile
FakesTargets
FakesTasks
FakesToolsPath
FakesVerbosity
FallbackCulture
FileAlignment
FinalAppxManifestName
FinalAppxPackageRecipe
FinalAppxUploadManifestName
FinalAppxUploadPackageRecipe
FinalDefineConstants
FindInvalidProjectReferences
FindInvalidProjectReferencesDependsOn
Framework20Dir
Framework30Dir
Framework35Dir
Framework40Dir
FrameworkDir
FrameworkInjectionLockFile
FrameworkInjectionPackagesDirectory
FrameworkPathOverride
FrameworkRegistryBase
FrameworkSDKDir
FullReferenceAssemblyNames
GenerateAdditionalSources
GenerateAppxPackageOnBuild
GenerateBindingRedirectsOutputType
GenerateBuildInfoConfigFile
GenerateClickOnceManifests
GenerateCompiledExpressionsTempFilePathForEditing
GenerateCompiledExpressionsTempFilePathForTypeInfer
GenerateCompiledExpressionsTempFilePathForValidation
GenerateManifestsDependsOn
GenerateResourceMSBuildArchitecture
GenerateResourceMSBuildRuntime
GenerateTargetFrameworkAttribute
GetCopyToOutputDirectoryItemsDependsOn
GetFrameworkPathsDependsOn
GetPackagingOutputsDependsOn
GetTargetPathDependsOn
GetTargetPathWithTargetPlatformMonikerDependsOn
HasSharedItems
HighEntropyVA
IlcIntermediateRootPath
IlcOutputPath
IlcParameters
ILCPDBDir
IlcTargetPlatformSdkLibPath
ImplicitlyExpandTargetFramework
ImplicitlyExpandTargetFrameworkDependsOn
ImplicitlyExpandTargetPlatform
Import_RootNamespace
ImportXamlTargets
IncludeBuiltProjectOutputGroup
IncludeComFilesOutputGroup
IncludeContentFilesProjectOutputGroup
IncludeCopyLocalFilesOutputGroup
IncludeCopyWinmdArtifactsOutputGroup
IncludeCustomOutputGroupForPackaging
IncludeDebugSymbolsProjectOutputGroup
IncludeDocumentationProjectOutputGroup
IncludeFrameworkReferencesFromNuGet
IncludeGetResolvedSDKReferences
IncludePriFilesOutputGroup
IncludeProjectPriFile
IncludeSatelliteDllsProjectOutputGroup
IncludeSDKRedistOutputGroup
IncludeServerNameInBuildInfo
IncludeSGenFilesOutputGroup
IncludeSourceFilesProjectOutputGroup
InProcessMakePriExtensionPath
InsertReverseMap
IntermediateOutputPath
IntermediateUploadOutputPath
InternalBuildOutDir
InternalBuildOutputPath
InteropOutputPath
Language
LayoutDir
LCMSBuildArchitecture
LoadTimeSensitiveProperties
LoadTimeSensitiveTargets
LocalAssembly
LocalEspcPath
LumiaPlatform
MakeAppxExeFullPath
MakePriExeFullPath
MakePriExtensionPath
MakePriExtensionPath_x64
ManagedWinmdInprocImplementation
MarkupCompilePass1DependsOn
MarkupCompilePass2DependsOn
MaxTargetPath
MergedOutputCodeAnalysisFile
MergeInputCodeAnalysisFiles
MetadataNamespaceUri
MicrosoftCommonPropsHasBeenImported
MinimumVisualStudioVersion
MrmSupportLibraryArchitecture
MsAppxPackageTargets
MSBuildAllProjects
MSBuildExtensionsPath64Exists
MsTestToolsTargets
NativeCodeAnalysisTLogFile
NetfxCoreRuntimeSettingsTargets
NetfxCoreRuntimeTargets
NoCompilerStandardLib
NonExistentFile
NoStdLib
NoWarn
NoWin32Manifest
NuGetProps
NuGetRuntimeIdentifier
NuGetTargetFrameworkMonikerToInject
NuGetTargetMoniker
NuGetTargetMonikerToInject
NuGetTargets
OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration
OnXamlPreCompileErrorTarget
Optimize
OsVersion
OutDir
OutDirWasSpecified
OutOfProcessMakePriExtensionPath
OutputPath
OutputType
OverwriteReadOnlyFiles
PackageAction
PackageCertificateKeyFile
PackagingDirectoryWritesLogPath
PackagingFileWritesLogPath
PdbCopyExeFullPath
PdbFile
PdbOutputDir
Platform
PlatformName
PlatformSpecificBundleArtifactsListDir
PlatformSpecificBundleArtifactsListDirInProjectDir
PlatformSpecificBundleArtifactsListDirName
PlatformSpecificBundleArtifactsListDirWasSpecified
PlatformSpecificUploadBundleArtifactsListDir
PlatformSpecificUploadBundleArtifactsListDirInProjectDir
PlatformTarget
PlatformTargetAsMSBuildArchitecture
PlatformTargetAsMSBuildArchitectureExplicitlySet
PostBuildEventDependsOn
PreBuildEventDependsOn
Prefer32Bit
PreferredUILang
Prep_ComputeProcessXamlFilesDependsOn
PrepareForBuildDependsOn
PrepareForRunDependsOn
PrepareLayoutDependsOn
PrepareLibraryLayoutDependsOn
PrepareResourceNamesDependsOn
PrepareResourcesDependsOn
PrevWarningLevel
PriIndexName
ProcessorArchitecture
ProcessorArchitectureAsPlatform
ProduceAppxBundle
ProgFiles32
ProjectDesignTimeAssemblyResolutionSearchPaths
ProjectDir
ProjectExt
ProjectFileName
ProjectFlavor
ProjectGuid
ProjectLockFile
ProjectName
ProjectNProfileEnabled
ProjectNSettingsTargets
ProjectNTargets
ProjectPath
ProjectPriFileName
ProjectPriFullPath
ProjectPriIndexName
ProjectPriUploadFullPath
ProjectTypeGuids
PublishableProject
PublishBuildDependsOn
PublishDependsOn
PublishDir
PublishOnlyDependsOn
PublishPipelineCollectFilesCore
RebuildDependsOn
RebuildPackageAction
RedirectionTarget
RegisterAssemblyMSBuildArchitecture
RegisterAssemblyMSBuildRuntime
RemoveAssemblyFoldersIfNoTargetFramework
ReportingServicesTargets
ResGenDependsOn
ResGenExecuteAsTool
ResgenToolPath
ResolveAssemblyReferencesDependsOn
ResolveAssemblyReferencesSilent
ResolveAssemblyReferencesStateFile
ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch
ResolveComReferenceMSBuildArchitecture
ResolveComReferenceSilent
ResolveComReferenceToolPath
ResolveNuGetPackageAssetsDependsOn
ResolveNuGetPackages
ResolveReferencesDependsOn
ResolveSDKReferencesDependsOn
RootNamespace
RunCodeAnalysisDependsOn
RunCodeAnalysisInputs
RunCodeAnalysisOnThisProject
RunDependsOn
RunMergeNativeCodeAnalysisDependsOn
RunNativeCodeAnalysisInputs
SafeIntDir
SatelliteDllsProjectOutputGroupDependsOn
SDKExtensionDirectoryRoot
SDKIdentifier
SDKRedistOutputGroupDependsOn
SDKReferenceDirectoryRoot
SDKReferenceRegistryRoot
SDKReferenceWarnOnMissingMaxPlatformVersion
SDKRefVersionToUse
SDKVersion
SDKVersionToUse
SGenFilesOutputGroupDependsOn
SGenMSBuildArchitecture
SGenShouldGenerateSerializer
SGenUseKeep
SGenUseProxyTypes
SharedGUID
ShouldMarkCertainSDKReferencesAsRuntimeOnly
ShouldUnsetParentConfigurationAndPlatform
SignAppxPackageExeFullPath
SignToolPath
SkipCopyUnchangedFiles
SkipILCompilation
SkipIntermediatePriGenerationForResourceFiles
SkipMergingFrameworkResources
SolutionDir
SolutionDirNoTrailingBackspace
SolutionExt
SolutionFileName
SolutionName
SolutionPath
SourceFilesProjectOutputGroupDependsOn
StandardBuildPipeline
StoreManifestName
StripPrivateSymbols
SubsystemVersion
SupportWindows81SDKs
SupportWindowsPhone81SDKs
SuppressWarningsInPass1
SyncLibsForDotNetNativeSharedFrameworkPackage
SynthesizeLinkMetadata
TargetCulture
TargetDeployManifestFileName
TargetDir
TargetedFrameworkDir
TargetedSDKArchitecture
TargetedSDKConfiguration
TargetExt
TargetFileName
TargetFrameworkAsMSBuildRuntime
TargetFrameworkDirectory
TargetFrameworkIdentifier
TargetFrameworkMoniker
TargetFrameworkMonikerAssemblyAttributesFileClean
TargetFrameworkMonikerAssemblyAttributesPath
TargetFrameworkMonikerAssemblyAttributeText
TargetFrameworkProfile
TargetFrameworkVersion
TargetName
TargetPath
TargetPlatformDisplayName
TargetPlatformIdentifier
TargetPlatformIdentifierWindows81
TargetPlatformIdentifierWindowsPhone81
TargetPlatformMinVersion
TargetPlatformMoniker
TargetPlatformRegistryBase
TargetPlatformResourceVersion
TargetPlatformSdkMetadataLocation
TargetPlatformSdkPath
TargetPlatformSdkRootOverride
TargetPlatformVersion
TargetPlatformVersionWindows81
TargetPlatformVersionWindowsPhone81
TargetPlatformWinMDLocation
TargetRuntime
TargetsPC
TargetsPhone
TaskKeyToken
TaskVersion
TreatWarningsAsErrors
UapAppxPackageBuildModeCI
UapAppxPackageBuildModeSideloadOnly
UapAppxPackageBuildModeStoreUpload
UapBuildPipeline
UapDefaultAssetScale
UnmanagedRegistrationDependsOn
UnmanagedUnregistrationDependsOn
UnregisterAssemblyMSBuildArchitecture
UnregisterAssemblyMSBuildRuntime
UseCommonOutputDirectory
UseDotNetNativeSharedAssemblyFrameworkPackage
UseDotNetNativeToolchain
UseHostCompilerIfAvailable
UseIncrementalAppxRegistration
UseNetNativeCustomFramework
UseOSWinMdReferences
UseRTMSdk
UseSharedCompilation
UseSourcePath
UseSubFolderForOutputDirDuringMultiPlatformBuild
UseTargetPlatformAsNuGetTargetMoniker
UseVSHostingProcess
Utf8Output
ValidatePresenceOfAppxManifestItemsDependsOn
VCInstallDir
VCLibs14SDKName
VCLibsTargetConfiguration
VersionIntDir
VisualStudioVersion
WarningLevel
WebReference_EnableLegacyEventingModel
WebReference_EnableProperties
WebReference_EnableSQLTypes
Win32Manifest
Windows8SDKInstallationFolder
WindowsAppContainer
WindowsSdkPath
WinMDExpOutputPdb
WinMDExpOutputWindowsMetadataFilename
WinMdExpToolPath
WinMdExpUTF8Ouput
WinMDOutputDocumentationFile
WireUpCoreRuntimeGates
WireUpCoreRuntimeOutputPath
WMSJSProject
WMSJSProjectDirectory
WorkflowBuildExtensionAssemblyName
WorkflowBuildExtensionKeyToken
WorkflowBuildExtensionVersion
XamlBuildTaskAssemblyName
XamlBuildTaskLocation
XamlBuildTaskPath
XAMLCompilerVersion
XAMLFingerprint
XAMLFingerprintIgnorePaths
XamlGenCodeFileNames
XamlGeneratedOutputPath
XamlGenMarkupFileNames
XamlPackagingRootFolder
XamlPass2FlagFile
XamlRequiresCompilationPass2
XamlRootsLog
XamlSavedStateFileName
XamlSavedStateFilePath
XamlTemporaryAssemblyName
XsdCodeGenCollectionTypes
XsdCodeGenEnableDataBinding
XsdCodeGenGenerateDataTypesOnly
XsdCodeGenGenerateInternalTypes
XsdCodeGenGenerateSerializableTypes
XsdCodeGenImportXmlTypes
XsdCodeGenNamespaceMappings
XsdCodeGenPreCondition
XsdCodeGenReuseTypesFlag
XsdCodeGenReuseTypesMode
XsdCodeGenSerializerMode
XsdCodeGenSupportFx35DataTypes
YieldDuringToolExecution

For some reason, /v:diagnostic did not dump the environment variables for me.
I tried some stuff, and then the sort-of obvious simple thing worked. Try:
<Exec Command='set' />

You might want to try Debugging MSBuild script with VisualStudio. I haven't tried it, but it seems like it could allow you to step through a script and also list variables.

I know this question is a little old and I'm not sure if there's actually a way to enumerate all defined property names in MSBuild parlance (I'm not aware of one), but I would recommend using the /bl (/binlog[:filename]) switch and loading the resulting binary log in the MSBuild Binary and Structured Log Viewer which will not only tell you every property defined and its value, but also show what the values were as each target or task is called throughout the build. This tool has been incredibly useful for learning the inner workings and finding appropriate extension points when customizing MSBuild and can even take you to the line of MSBuild xml that was being executed when you double click on events in the log. There's also a Visual Studio extension mentioned on the site linked that can be used to troubleshoot design time builds (when VS calls MSBuild for things like XAML previews, etc.)

Related

MSXML3 and MSXML6 / What Object/Functtion is internally used?

I have to maintanance a old Software that officially uses MSXML3. When I look for the Exports of a Project Library (with dumpbin) I find a Function named GetNodeText:
560 22F 0003CA40
?GetNodeText#CBgsXML##SA?AVCString##V?$_com_ptr_t#V?$_com_IIID#UIXMLDOMNode#MSXML2##$1?_GUID_2933bf80_7b36_11d2_b20e_00c04f983e60##3U__s_GUID##A####PBD#Z
When I have a look to the registered COM-Interfaces and search for "{2933bf80-7b36-11d2-b20e-00c04f983e60}" (from Export) I find the following Entry:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Interface\{2933BF80-7B36-11D2-B20E-00C04F983E60}]
#="IXMLDOMNode"
[HKEY_CLASSES_ROOT\Interface\{2933BF80-7B36-11D2-B20E-00C04F983E60}\ProxyStubClsid]
#="{00020424-0000-0000-C000-000000000046}"
[HKEY_CLASSES_ROOT\Interface\{2933BF80-7B36-11D2-B20E-00C04F983E60}\ProxyStubClsid32]
#="{00020424-0000-0000-C000-000000000046}"
[HKEY_CLASSES_ROOT\Interface\{2933BF80-7B36-11D2-B20E-00C04F983E60}\TypeLib]
"Version"="6.0"
#="{F5078F18-C551-11D3-89B9-0000F81FE221}"
If I look for the registered Typelib from IXMLNode I find this Entry:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}]
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\3.0]
#="Microsoft XML, v3.0"
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\3.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\3.0\0\win32]
#="C:\\Windows\\system32\msxml3.dll"
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\3.0\FLAGS]
#="0"
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\4.0]
#="Microsoft XML, v4.0"
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\4.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\4.0\0\win32]
#="C:\\Windows\\system32\\msxml4.dll"
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\4.0\FLAGS]
#="0"
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\4.0\HELPDIR]
#=""
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\6.0]
#="Microsoft XML, v6.0"
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\6.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\6.0\0\win32]
#="C:\\Windows\\system32\\msxml6.dll"
[HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\6.0\FLAGS]
#="0"
The Function Looks like this:
CString ClassA::GetNodeText( IXMLDOMNodePtr spNode, LPCTSTR pszXPath )
{
ASSERT( ::AfxIsValidString( pszXPath ) );
if( spNode )
spNode = spNode->selectSingleNode( pszXPath );
return ( spNode != NULL ) ? (LPCWSTR) spNode->text : NULL;
}
It seems that the Function selectSingleNode (function of msxml3.dll) wrapped internally the same COM-Object (IXMLDOMNode) like selectSingleNode (function of msxml6.dll).
Isn't it so? Or I'am wrong? How does it work with the Functions?

How to have MSBuild quiet output but with error/warning summary

I'm simply trying to get no output from a build except the error/warning summary at the end. Not exactly a demanding task.
The command line:
msbuild.exe /nologo /verbosity:quiet /consoleloggerparameters:summary project.sln
As described here: http://msdn.microsoft.com/en-us/library/ms164311.aspx
It appears MSBuild isn't working as it should - there is no output at all. with /verbosity:normal there is tonnes of output and a useful error/warning summary at the end, is there any way of just not seeing the noise?
MSBuild reports version 12.0.21005.1 as distributed with Studio Express 2013.
late to the party, but MSBuild has the option /verbosity:quiet now and it doesn't print out anything beside error and warnings.
You can specify the following verbosity levels:
q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]
Documentation source: https://msdn.microsoft.com/en-us/library/ms164311.aspx
Use /consoleloggerparameters:ErrorsOnly or clp:ErrorsOnly to solve your problem.
I don't think there is a set of options thet matches what you want exactly. But since you're on the commandline anyway, using findstr/grep/tail and the likes is always a good option. Here's an example using powershell to display the summary and what comes after it
powershell -Command "msbuild.exe /nologo project.sln |
Select-String 'Build succeeded|failed' -Context 0, 100"
Another possibility is to use a custom logger, which is not hard as it sounds at first and there are tons of examples on the net. Plus it has the benefit you can get any custom output you want. Here's code to replicate the summary:
using System;
using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;
public class CustomLogger : Logger
{
private int warnings = 0;
private int errors = 0;
public override void Initialize( IEventSource eventSource )
{
eventSource.WarningRaised += ( s, e ) => ++warnings;
eventSource.ErrorRaised += ( s, e ) => ++errors;
eventSource.BuildFinished += ( s, e ) =>
{
Console.WriteLine( errors == 0 ? "Build succeeded." : "Build failed." );
Console.WriteLine( String.Format( " {0} Warning(s)", warnings ) );
Console.WriteLine( String.Format( " {0} Error(s)", errors ) );
};
}
}
Put this in a file CustomLogger.cs and compile it:
csc /t:library CustomLogger.cs /reference:Microsoft.Build.Utilities.v4.0.dll;Microsoft.Build.Framework.dll
which creates a CustomLogger dll file. Now use it like this:
msbuild /nologo /logger:CustomLogger.dll /noconsolelogger project.sln
Use /verbosity:minimal instead. This prints much less, but not nothing.

using addRef with CRUD

I'm trying to learn how to use addRef.
I think I need a way to tell addRef which field should link with 'id' in Master?
To test, I have a 'master' table:
<?php
class Model_TestMaster extends Model_Table {
public $table='testmaster';
function init(){
parent::init();
$this->addField('Description');
$this->hasMany('testslave');
}
}
and a 'slave' table:
<?php
class Model_TestSlave extends Model_Table {
public $table='testslave';
function init(){
parent::init();
$this->addField('MastersID');
$this->addField('SubDescription');
}
}
and then I set up the 'page' like this:
<?php
class page_test extends Page {
function init(){
parent::init();
$page=$this;
$tabs = $this->add('Tabs');
$crud = $tabs->addTab('Master')->add('CRUD');
$crud->setModel('testmaster');
if (! $crud->isEditing()) {
// add subCRUD
$sub_crud = $crud->addRef('testslave', array(
'extra_fields' => array('MastersID','SubDescription')));
}
}
I think I need a way to tell addRef which field should link with 'id' in Master?
It displays Ok, but when I press the button to expand the slave I get:
Application Error: Child element not found
BaseException, code: 0
Additional information:
Raised by object: Object Model_TestSlave(51cf4a73__ter_testslave_model_testslave)
element: testmaster_id
:
Stack trace:
File Object Name Stack Trace
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/BaseException.php :63 BaseException BaseException->collectBasicData(Null)
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/AbstractObject.php :545 BaseException BaseException->__construct("Child element not found", Null)
/ : 51cf4a73__ter_testslave_model_testslave Model_TestSlave->exception("Child element not found")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib\SQL/Model.php :107 Loggercall_user_func_array(Array(2), Array(1))
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/AbstractObject.php :331 51cf4a73__ter_testslave_model_testslave Model_TestSlave->exception("Child element not found")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib\SQL/Model.php :275 51cf4a73__ter_testslave_model_testslave Model_TestSlave->getElement("testmaster_id")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib\SQL/Many.php :79 51cf4a73__ter_testslave_model_testslave Model_TestSlave->addCondition("testmaster_id", "0000000001")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib\SQL/Model.php :248 51cf4a73__ter_testslave SQL_Many->ref(Null)
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib\View/CRUD.php :316 asol_Test_tabs_view_htmlelement_crud_model_testmaster Model_TestMaster->ref("testslave")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\page/test.php :15 asol_Test_tabs_view_htmlelement_crud CRUD->addRef("testslave", Array(1))
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/AbstractObject.php :306 asol_Test page_test->init()
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/ApiFrontend.php :130 asol Admin->add("page_Test", "Test", "Content")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/ApiWeb.php :428 asol Admin->layout_Content()
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/ApiFrontend.php :39 asol Admin->addLayout("Content")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/ApiWeb.php :275 asol Admin->initLayout()
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb/index.php :15 asol Admin->main()
Thank you,
Mark
Should be $this->hasMany('TestSlave'); not testslave. Otherwise there will be problems on Linux.
Don't use $this->addField('MastersID'); Instead use $this->hasOne('TestMaster');
Should be $crud->setModel('TestMaster'); not testmaster. Otherwise there will be problems on Linux.
Instead
$sub_crud = $crud->addRef('testslave', array(
'extra_fields' => array('MastersID','SubDescription')));
use
$sub_crud = $crud->addRef('TestSlave', array(
'extra_fields' => array('testmaster_id','SubDescription')));
Also you can use field "testmaster" in extra_fields. That'll be title field of TestMaster model.
Idea here is that when you put hasOne('ModelName') in your model, then 2 fields are created in model.
First one will have name "modelname_id" and will consist of ID of related model.
Second will have name "modelname" and will consist of title field of related model.

Adobe AIR NativeProcess fails with spaces in arguments?

I have a problem running the NativeProcess if I put spaces in the arguments
if (Capabilities.os.toLowerCase().indexOf("win") > -1)
{
fPath = "C:\\Windows\\System32\\cmd.exe";
args.push("/c");
args.push(scriptDir.resolvePath("helloworld.bat").nativePath);
}
file = new File(fPath);
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
args.push("blah");
nativeProcessStartupInfo.arguments = args;
process = new NativeProcess();
process.start(nativeProcessStartupInfo);
in the above code, if I use
args.push("blah") everything works fine
if I use
args.push("blah blah") the program breaks as if the file wasn't found.
Seems like I'm not the only one:
http://tech.groups.yahoo.com/group/flexcoders/message/159521
As one of the users their pointed out, it really seems like an awful limitation by a cutting edge SDK of 21st century. Even Alex Harui didn't have the answer there and he's known to workaround every Adobe bug:)
Any ideas?
I am using AIR 2.6 SDK in JavaScript like this, and it is working fine even for spaces.
please check your code with this one.
var file = air.File.applicationDirectory;
file = file.resolvePath("apps");
if (air.Capabilities.os.toLowerCase().indexOf("win") > -1)
{
file = file.resolvePath(appFile);
}
var nativeProcessStartupInfo = new air.NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
var args =new air.Vector["<String>"]();
for(i=0; i<arguments.length; i++)
args.push(arguments[i]);
nativeProcessStartupInfo.arguments = args;
process = new air.NativeProcess();
process.addEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.addEventListener(air.ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);
process.start(nativeProcessStartupInfo);
To expand on this: The reason that this works (see post above):
var args =new air.Vector["<String>"]();
for(i=0; i<arguments.length; i++)
args.push(arguments[i]);
nativeProcessStartupInfo.arguments = args;
is that air expects that the arguments being passed to the nativeProcess are delimited by spaces. It chokes if you pass "C:\folder with spaces\myfile.doc" (and BTW for AIR a file path for windows needs to be "C:\\folder with spaces\\myfile.doc") you would need to do this:
args.push("C:\\folder");
args.push("with");
args.push("spaces\\myfile.doc");
Hence, something like this works:
var processArgs = new air.Vector["<String>"]();
var path = "C:\\folder with spaces\\myfile.doc"
var args = path.split(" ")
for (var i=0; i<args.length; i++) {
processArgs.push(args[i]);
};
UPDATE - SOLUTION
The string generated by the File object by either nativePath or resolvePath uses "\" for the path. Replace "\" with "/" and it works.
I'm having the same problem trying to call 7za.exe using NativeProcess. If you try to access various windows directories the whole thing fails horribly. Even trying to run command.exe and calling a batch file fails because you still have to try to pass a path with spaces through "arguments" on the NativeProcessStartupInfo object.
I've spent the better part of a day trying to get this to work and it will not work. Whatever happens to spaces in "arguments" totally destroys the path.
Example 7za.exe from command line:
7za.exe a MyZip.7z "D:\docs\My Games\Some Game Title\Maps\The Map.map"
This works fine. Now try that with Native Process in AIR. The AIR arguments sanitizer is FUBAR.
I have tried countless ways to put in arguments and it just fails. Interesting I can get it to spit out a zip file but with no content in the zip. I figure this is due to the first argument set finally working but then failing for the path argument.
For example:
processArgs[0] = 'a';
processArgs[1] = 'D:\apps\flash builder 4.5\project1\bin-debug\MyZip.7z';
processArgs[2] = 'D:\docs\My Games\Some Game Title\Maps\The Map.map';
For some reason this spits out a zip file named: bin-debugMyZip.7z But the zip is empty.
Whatever AIR is doing it is fraking up path strings. I've tried adding quotes around those paths in various ways. Nothing works.
I thought I could fall back on calling a batch file from this example:
http://technodesk.wordpress.com/2010/04/15/air-2-0-native-process-batch-file/
But it fails as well because it still requires the path to be passed through arguments.
Anyone have any luck calling 7z or dealing with full paths in the NativeProcess? All these little happy tutorials don't deal with real windows folder structure.
Solution that works for me - set path_with_space as "nativeProcessStartupInfo.workingDirectory" property. See example below:
public function openPdf(pathToPdf:String):void
}
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var file:File = File.applicationDirectory.resolvePath("C:\\Windows\\System32\\cmd.exe");
nativeProcessStartupInfo.executable = file;
if (Capabilities.os.toLowerCase().indexOf("win") > -1)
{
nativeProcessStartupInfo.workingDirectory = File.applicationDirectory.resolvePath(pathToPdf).parent;
var processArgs:Vector.<String> = new Vector.<String>();
processArgs[0] = "/k";
processArgs[1] = "start";
processArgs[2] = "test.pdf";
nativeProcessStartupInfo.arguments = processArgs;
process = new NativeProcess();
process.start(nativeProcessStartupInfo);
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
}
args.push( '"blah blah"' );
Command line after all supports spaces if they are nested whithin "".
So if lets say you have a file argument :
'test/folder with space/blah'
Convert it to the following
'test/"folder with space"/blah'
Optionally use a filter:
I once had a problem like this in AIR, i just simply filter the text before i push it into the array. My refrence use CASA lib though
import org.casalib.util.ArrayUtil;
http://casalib.org/
/**
* Filters a string input for 'safe handling', and returns it
**/
public function stringFilter(inString:String, addPermitArr:Array = null, permitedArr:Array = null):String {
var sourceArr:Array = inString.split(''); //Splits the string input up
var outArr:Array = new Array();
if(permitedArr == null) {
permitedArr = ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" as String).split('');
}
if( addPermitArr != null ) {
permitedArr = permitedArr.concat( addPermitArr );
}
for(var i:int = 0; i < sourceArr.length; i++) {
if( ArrayUtil.contains( permitedArr, sourceArr[i] ) != 0 ) { //it is allowed
outArr.push( sourceArr[i] );
}
}
return (outArr.join('') as String);
}
And just filter it via
args.push( stringFilter( 'blah blah', new Array('.') ) );
Besides, it is really bad practice to use spaces in file names / arguments, use '_' instead. This seems to be originating from linux though. (The question of spaces in file names)
This works for me on Windws7:
var Xargs:Array = String("/C#echo#a trully hacky way to do this :)#>#C:\\Users\\Benjo\\AppData\\Roaming\\com.eblagajna.eBlagajna.POS\\Local Store\\a.a").split("#");
var args:Vector.<String> = new Vector.<String>();
for (var i:int=0; i<Xargs.length; i++) {
trace("Pushing: "+Xargs[i]);
args.push(Xargs[i]);
};
NPI.arguments = args;
If your application path or parameter contains spaces, make sure to wrap it in quotes. For example path of the application has spaces C:\Program Files (x86)\Camera\Camera.exe use quotes like:
"C:\Program Files (x86)\Camera\Camera.exe"

ClearCase : list the content of a directory (ls) using CAL

In ClearCase, you can list the content of a directory using "cleartool ls".
My question is how can I do the same thing using CAL (ClearCase Automation Layer). The reason I prefer the COM API is because I won't have to parse the output of "ls".
So far, I am able to get the VOB and the View successfully, but I didn't find any method for listing the content.
My code so far:
IClearCase cc = new ApplicationClass();
CCVOB vob = cc.get_VOB("\\VOB-name");
CCView view = cc.get_View("ViewTag");
Thank you for your help.
I wrote VonC's answer in C# for those interrested.
string[] files = Directory.GetFiles("View path here", "*.*", SearchOption.AllDirectories);
foreach (string file in files)
{
try
{
CCVersion ver = cc.get_Version(file);
Console.WriteLine(ver.Path);
}
catch(Exception) {/*the file is not versioned*/}
}
May be this is a good start:
Set CC = Wscript.CreateObject("ClearCase.Application")
Set DirVer = CC.Version(".")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folder = FSO.GetFolder(DirVer.Path)
Wscript.Echo "Files under source control: "
For Each File in Folder.Files
On Error Resume Next
Set Ver = CC.Version(File.Name)
If Err.Number = 0 Then
Wscript.Echo Ver.ExtendedPath
End If
Next
The idea being to use ICCVersion methods to try accessing the version of a file. If it does not return an error, it is indeed a versioned file.
Now I know the file is versioned, how can I remove it (rmname).
Do not use RemoveVersion():
Removes irretrievably the version (equivalent to cleartool rmver)
WARNING! This is a potentially destructive operation. Because CAL does not prompt the user for input under any circumstances, there is no confirmation step when RemoveVersion is invoked. Invoking RemoveVersion is equivalent to running cleartool rmver with the -force option.
Instead use the RemoveName from the ICCElement interface.