Update CI for meterpreter vs2022 - #20483
Conversation
|
Do you have any background that you can provide on these changes? I see the |
|
@zeroSteiner, this change was requested by @AlanFoster, i think (Alan correct me if I am wrong) this is used when we want to test something on |
|
Tested here: rapid7/metasploit-payloads#766 VS2022 build output:
The logs show that the vs components install successfully: But, it looks like the build logs are missing - which would be useful for debugging build failures Based on the last two timestamps it looks like the build took around the time we'd expect it to take, but there's no logs present - it'd be great to fix that 🙌 |
|
@adfoster-r7 any idea how to include them? |
I think the issue is rooted in the change to Powershell and the invocation through I think for this use case, we'd be better off not invoking processes through |
smcintyre-r7
left a comment
There was a problem hiding this comment.
I have not tested the code suggestions I've made but I think they might address the issue where we don't have the output we're looking for.
| $WorkLoads = '--config "D:\a\metasploit-payloads\metasploit-payloads\metasploit-payloads\c\meterpreter\vs-configs\vs2022.vsconfig"' | ||
| $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache') | ||
| $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden | ||
| if ($process.ExitCode -eq 0) { |
There was a problem hiding this comment.
| $WorkLoads = '--config "D:\a\metasploit-payloads\metasploit-payloads\metasploit-payloads\c\meterpreter\vs-configs\vs2022.vsconfig"' | |
| $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache') | |
| $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden | |
| if ($process.ExitCode -eq 0) { | |
| cmd.exe /c vs_installer.exe modify --installPath "$InstallPath" --config "D:\a\metasploit-payloads\metasploit-payloads\metasploit-payloads\c\meterpreter\vs-configs\vs2022.vsconfig" --quiet --norestart --nocache' | |
| if ($LASTEXITCODE -eq 0) { |
| Start-Process -FilePath cmd.exe -ArgumentList ('/c', 'git', 'submodule', 'init', '&&', 'git', 'submodule', 'update') -Wait -PassThru -WindowStyle Hidden | ||
| Start-Process -FilePath cmd.exe -ArgumentList ('/c', '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"', '&&', 'make.bat') -Wait -PassThru -WindowStyle Hidden |
There was a problem hiding this comment.
| Start-Process -FilePath cmd.exe -ArgumentList ('/c', 'git', 'submodule', 'init', '&&', 'git', 'submodule', 'update') -Wait -PassThru -WindowStyle Hidden | |
| Start-Process -FilePath cmd.exe -ArgumentList ('/c', '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"', '&&', 'make.bat') -Wait -PassThru -WindowStyle Hidden | |
| cmd.exe /c git submodule init | |
| cmd.exe /c git submodule update | |
| cmd.exe /c '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" && make.bat' |
Notice the third one uses single quotes so the path can still be in double while both bat files run in the same cmd instance.
There was a problem hiding this comment.
i'll try to tweak the start process to see if i can incude logs.
|
I use the invoke command and looks good. https://github.com/rapid7/metasploit-payloads/actions/runs/17374128806/job/50398691505 @smcintyre-r7 lmk if it's ok, i think Write-Host chop's new line but should be good enough to dump the logs and investigate them somewhere else. |
No description provided.