Skip to content

Commit 68c6c56

Browse files
committed
Finding aximp.exe has been improved
1 parent aceb0fe commit 68c6c56

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

Scripts/PreBuildEventCommandLine.ps1

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if(-not($OutPath.StartsWith('"')))
1616
# Test if files are already there...
1717
if((Test-Path -Path "$OutPath\MSTSCLib.dll") -and (Test-Path -Path "$OutPath\AxMSTSCLib.dll"))
1818
{
19-
Write-Host "MSTSCLib.dll and AxMSTSCLib.dll already created!"
19+
Write-Host "MSTSCLib.dll and AxMSTSCLib.dll already there!"
2020
return
2121
}
2222

@@ -29,18 +29,22 @@ if([String]::IsNullOrEmpty($ProgramFiles_Path))
2929
}
3030

3131
# Get aximp from sdk
32-
$files = (Get-ChildItem -Path "$ProgramFiles_Path\Microsoft SDKs\Windows" -Recurse -Filter "aximp.exe" -File)
32+
$AximpPath = ((Get-ChildItem -Path "$ProgramFiles_Path\Microsoft SDKs\Windows" -Recurse -Filter "aximp.exe" -File) | Sort-Object FullName | Select-Object -First 1).FullName
3333

34-
if($files.Count -eq 0)
34+
if([String]::IsNullOrEmpty($AximpPath))
3535
{
3636
Write-Host "Aximp.exe not found on this system!"
37-
exit 2
37+
return
38+
}
39+
else
40+
{
41+
Write-Host "Using aximp.exe form: $AximpPath"
3842
}
3943

4044
# Change location
4145
Write-Host "Change location to: $OutPath"
4246
Set-Location -Path $OutPath
4347

4448
# Create MSTSCLib.dll and AxMSTSCLib.dll
45-
Write-Host "Creating MSTSCLib.dll and AxMSTSCLib.dll ..."
46-
Start-Process -FilePath $files[$files.Length -1].FullName -ArgumentList "$($Env:windir)\system32\mstscax.dll" -Wait -NoNewWindow
49+
Write-Host "Build MSTSCLib.dll and AxMSTSCLib.dll ..."
50+
Start-Process -FilePath $AximpPath -ArgumentList "$($Env:windir)\system32\mstscax.dll" -Wait -NoNewWindow

0 commit comments

Comments
 (0)