1+ # Visual Studio pre build event:
2+ # PowerShell.exe -ExecutionPolicy Bypass -NoProfile -File "$(ProjectDir)..\..\Scripts\PreBuildEventCommandLine.ps1" "$(TargetDir)"
3+
14param (
25 [Parameter (
36 Position = 0 ,
47 Mandatory = $true )]
58 [String ]$OutPath
69)
710
8- # VS prebuild event call: PowerShell.exe -ExecutionPolicy Bypass -NoProfile -File "$(ProjectDir)..\..\Scripts\PreBuildEventCommandLine.ps1" "$(TargetDir)"
9-
10- # Fix wrong path
11- # Quotation marks are required if a blank is in the path... If there is no blank space in the path, a quote will be add to the end...
11+ # Fix wrong path (if there is no blank in the path, a quote will be added to the end...)
1212if (-not ($OutPath.StartsWith (' "' )))
1313{
1414 $OutPath = $OutPath.TrimEnd (' "' )
1515}
1616
17+ # NetBeauty will move all dependencies to the lib folder
18+ $OutPath = $OutPath + " \lib"
19+
20+ # Create folder
21+ New-Item - ItemType Directory - Path $OutPath
22+
1723# ###############################################
1824# ## Generate MSTSCLib.dll and AxMSTSCLib.dll ###
1925# ###############################################
@@ -25,14 +31,6 @@ if((Test-Path -Path "$OutPath\MSTSCLib.dll") -and (Test-Path -Path "$OutPath\AxM
2531 return
2632}
2733
28- # Test if files are in the lib folder (NetBeauty) and copy them from there because this is faster than re-creating them...
29- if ((Test-Path - Path " $OutPath \lib\MSTSCLib.dll" ) -and (Test-Path - Path " $OutPath \lib\AxMSTSCLib.dll" )) {
30- Write-Host " MSTSCLib.dll and AxMSTSCLib.dll exist in lib folder! Copy them..."
31- Copy-Item - Path " $OutPath \lib\MSTSCLib.dll" - Destination " $OutPath \MSTSCLib.dll" - Force
32- Copy-Item - Path " $OutPath \lib\AxMSTSCLib.dll" - Destination " $OutPath \AxMSTSCLib.dll" - Force
33- return
34- }
35-
3634# Detect x86 or x64
3735$ProgramFiles_Path = ${Env: ProgramFiles(x86)}
3836
@@ -48,7 +46,7 @@ $IlasmPath = ((Get-ChildItem -Path "$($Env:windir)\Microsoft.NET\Framework\" -Re
4846
4947if ([String ]::IsNullOrEmpty($AximpPath ) -or [String ]::IsNullOrEmpty($IldasmPath ) -or [String ]::IsNullOrEmpty($IlasmPath ))
5048{
51- Write-Host " Could not find sdk tools:`n aximp.exe`t $AximpPath `n ildasm.exe`t $IldasmPath `n ilasm.exe`t $IlasmPath "
49+ Write-Host " Could not find sdk tools:`n aximp.exe`t => `t $AximpPath `n ildasm.exe`t => `t $IldasmPath `n ilasm.exe`t => `t $IlasmPath "
5250 return
5351}
5452
@@ -78,5 +76,6 @@ Write-Host "Replace ""[in] int32& plKeyData"" with ""[in] int32[] marshal([+0])
7876
7977Start-Process - FilePath $IlasmPath - ArgumentList " /dll "" $MSTSCLibILPath "" /output:"" $MSTSCLibDllPath "" " - Wait - NoNewWindow
8078
79+ Write-Host " Remove temporary files..."
8180Remove-Item - Path " $MSTSCLibILPath "
8281Remove-Item - Path " $OutPath \MSTSCLib.res"
0 commit comments