File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ param (
2+ [Parameter (
3+ Position = 0 ,
4+ Mandatory = $true )]
5+ [String ]$OutPath
6+ )
7+
8+ # Test if files are already there...
9+ if ((Test-Path - Path " $OutPath \MSTSCLib.dll" ) -and (Test-Path - Path " $OutPath \AxMSTSCLib.dll" ))
10+ {
11+ Write-Host " MSTSCLib.dll and AxMSTSCLib.dll already created!"
12+
13+ exit 0
14+ }
15+
16+ # x86 or x64
17+ $ProgramFiles_Path = ${Env: ProgramFiles(x86)}
18+
19+ if ([String ]::IsNullOrEmpty($ProgramFiles_Path ))
20+ {
21+ $ProgramFiles_Path = $Env: ProgramFiles
22+ }
23+
24+ # Get aximp from sdk
25+ $files = (Get-ChildItem - Path " $ProgramFiles_Path \Microsoft SDKs\Windows" - Recurse - Filter " aximp.exe" - File)
26+
27+ if ($files.Count -eq 0 )
28+ {
29+ Write-Host " Aximp.exe not found on this system!"
30+ exit 2
31+ }
32+
33+ # Change location
34+ Write-Host " Change location to: $OutPath "
35+ Set-Location - Path $OutPath
36+
37+ # Create MSTSCLib.dll and AxMSTSCLib.dll
38+ Write-Host " Creating MSTSCLib.dll and AxMSTSCLib.dll ..."
39+ Start-Process - FilePath $files [$files.Length -1 ].FullName - ArgumentList " $ ( $Env: windir ) \system32\mstscax.dll" - Wait - NoNewWindow
Original file line number Diff line number Diff line change 9090 <Reference Include =" WindowsBase" />
9191 <Reference Include =" PresentationCore" />
9292 <Reference Include =" PresentationFramework" />
93+ <Reference Include =" WindowsFormsIntegration" />
9394 </ItemGroup >
9495 <ItemGroup >
9596 <ApplicationDefinition Include =" App.xaml" >
698699 </None >
699700 </ItemGroup >
700701 <Import Project =" $(MSBuildToolsPath)\Microsoft.CSharp.targets" />
702+ <PropertyGroup >
703+ <PreBuildEvent >PowerShell.exe -ExecutionPolicy Bypass -NoProfile -File $(ProjectDir)..\..\Scripts\PreBuildEventCommandLine.ps1 $(TargetDir)</PreBuildEvent >
704+ </PropertyGroup >
701705 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
702706 Other similar extension points exist, see Microsoft.Common.targets.
703707 <Target Name="BeforeBuild">
You can’t perform that action at this time.
0 commit comments