Merge pull request #2529 from xRushG/v1.77.3-dev

Pre-build event powershell code update #2524
This commit is contained in:
Dimitrij
2023-12-04 17:47:04 +00:00
committed by GitHub

View File

@@ -490,7 +490,7 @@
</None>
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="echo $(ConfigurationName) &gt; buildenv.tmp&#xD;&#xA;powershell.exe -WindowStyle Hidden -NonInteractive -ExecutionPolicy Bypass -Command &quot;&amp; { $Env:DevEnvDir = ($(SolutionDir)Tools/find_vstool.ps1 devenv.exe); $Env:DevEnvDir = ($Env:DevEnvDir.Replace('devenv.exe','')).replace('`',''); $Env:DevEnvDir; if ($Env:APPVEYOR) {&amp;'$(DevEnvDir)TextTransform.exe' -a !!BuildConfiguration!'$(Configuration)' '$(ProjectDir)Properties\AssemblyInfo.tt'} }&quot;" />
<Exec Command="echo $(ConfigurationName) &gt; buildenv.tmp&#xD;&#xA;powershell.exe -WindowStyle Hidden -NonInteractive -ExecutionPolicy Bypass -Command &quot;$InfoText='[Pre-Build-Event-Info]';'{0} PowerShell Version: {1}' -f $InfoText,$PSVersionTable.PSVersion.toString(); $VSToolsDir=(. '$(SolutionDir)Tools\find_vstool.ps1' -FileName 'devenv.exe'); $Env:DevEnvDir = Split-Path -Path $VSToolsDir -Parent; '{0} VS tools dir found: {1}' -f $InfoText,$Env:DevEnvDir;if ($Env:APPVEYOR) {'{0} AppVeyor (cloud based CI/CD) environment detected' -f $InfoText; &amp;'$(DevEnvDir)TextTransform.exe' -a !!BuildConfiguration!'$(Configuration)' '$(ProjectDir)Properties\AssemblyInfo.tt'} else {'{0} None AppVeyor (cloud based CI/CD) environment detected, continue' -f $InfoText;}&quot;" />
</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command=":: When passing paths to powershell scripts, check if the path ends with a backslash &quot;\&quot;&#xD;&#xA;:: If it does, then the backslash may be interpreted as an escape character. Add another backslash to cancel the first one.&#xD;&#xA;&#xD;&#xA;powershell -noprofile -command &quot;sleep 2&quot;&#xD;&#xA;&#xD;&#xA;set /p buildenv=&lt;buildenv.tmp&#xD;&#xA;&#xD;&#xA;:: Manual builds, set the cert password and uncomment below.&#xD;&#xA;:: IF &quot;%25APPVEYOR_BUILD_FOLDER&quot;==&quot;&quot; ( set cert_pwd= )&#xD;&#xA;&#xD;&#xA;:: Call the post build powershell script&#xD;&#xA;powershell.exe -ExecutionPolicy Bypass -File &quot;$(SolutionDir)Tools\postbuild.ps1&quot; -SolutionDir &quot;$(SolutionDir)\&quot; -TargetDir &quot;$(TargetDir)\&quot; -TargetFileName &quot;mRemoteNG.exe&quot; -ConfigurationName &quot;%25buildenv%25&quot; -CertificatePath &quot;$(CertPath)&quot; -CertificatePassword &quot;$(CertPassword)&quot; -ExcludeFromSigning &quot;PuTTYNG.exe&quot;" />