@@ -128,7 +128,7 @@ jobs:
128128 # Add additional options to the MSBuild command line here (like platform or verbosity level).
129129 # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
130130 # MSBuild SupportLibs.sln /t:Rebuild /p:Configuration=Release /p:Platform="Win32"
131- run : msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{matrix.platform}} /p:VcpkgEnabled=true /p:VcpkgEnableManifest=true /p:VcpkgTriplet=${{env.VcpkgTriplet}} /p:VcpkgHostTriplet=${{env.VcpkgTriplet}} ${{env.MAPWINGIS_SOLUTION_FILE_PATH}}
131+ run : msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{matrix.platform}} /p:RegisterOutput=false /p: VcpkgEnabled=true /p:VcpkgEnableManifest=true /p:VcpkgTriplet=${{env.VcpkgTriplet}} /p:VcpkgHostTriplet=${{env.VcpkgTriplet}} ${{env.MAPWINGIS_SOLUTION_FILE_PATH}}
132132
133133 # Save artifacts:
134134 - name : Archive production artifacts
@@ -162,11 +162,12 @@ jobs:
162162 name : binaries-${{matrix.platform}}
163163 path : .\src\bin\${{env.BUILD_CONFIGURATION}}\${{matrix.platform}}\
164164
165- - name : Register MapWinGIS.ocx (${{matrix.platform}})
165+ - name : Register MapWinGIS.ocx (Win32)
166+ if : ${{matrix.platform == 'Win32' }}
166167 uses : Azure/powershell@v1
167168 with :
168169 # Specify the Az PowerShell script here.
169- inlineScript : |
170+ inlineScript : |
170171 $ExitCodes = @{
171172 0 = "SUCCESS";
172173 1 = "FAIL_ARGS - Invalid Argument";
@@ -175,19 +176,56 @@ jobs:
175176 4 = "FAIL_ENTRY - GetProcAddress failed";
176177 5 = "FAIL_REG - DllRegisterServer or DllUnregisterServer failed.";
177178 }
178- $regsvrp = Start-Process C:\Windows\SysWOW64\regsvr32.exe -ArgumentList "/s ${{ github.workspace }}\src\bin\${{env.BUILD_CONFIGURATION}}\${{matrix.platform}}\MapWinGIS.ocx" -PassThru
179+ $ocxPath = "${{ github.workspace }}\src\bin\${{env.BUILD_CONFIGURATION}}\Win32\MapWinGIS.ocx"
180+ if (!(Test-Path $ocxPath)) {
181+ Write-Error "MapWinGIS.ocx was not found at $ocxPath"
182+ }
183+ $regsvrp = Start-Process C:\Windows\SysWOW64\regsvr32.exe -ArgumentList "/s $ocxPath" -PassThru
179184
180- $regsvrp.WaitForExit(5000 ) # Wait (up to) 5 seconds
185+ $regsvrp.WaitForExit(15000 ) # Wait (up to) 15 seconds
181186 if($regsvrp.ExitCode -ne 0)
182187 {
183- Write-Host "RegSrv32 for ${{matrix.platform}} failed"
188+ Write-Host "RegSrv32 for Win32 failed"
184189 Write-Error $ExitCodes[$regsvrp.ExitCode]
185190 }
186- # Azure PS version to be used to execute the script, example: 1.8.0, 2.8.0, 3.4.0. To use the latest version, specify "latest" .
191+ # Azure PS version to be used to execute the script .
187192 azPSVersion : " latest"
188- # Select the value of the ErrorActionPreference variable for executing the script. Options: stop, continue, silentlyContinue. Default is Stop .
193+ # Select the value of the ErrorActionPreference variable for executing the script.
189194 errorActionPreference : Stop
190- # If this is true, this task will fail if any errors are written to the error pipeline, or if any data is written to the Standard Error stream.
195+ # If this is true, this task will fail if any errors are written to the error pipeline.
196+ failOnStandardError : true
197+
198+ - name : Register MapWinGIS.ocx (x64)
199+ if : ${{matrix.platform == 'x64' }}
200+ uses : Azure/powershell@v1
201+ with :
202+ # Specify the Az PowerShell script here.
203+ inlineScript : |
204+ $ExitCodes = @{
205+ 0 = "SUCCESS";
206+ 1 = "FAIL_ARGS - Invalid Argument";
207+ 2 = "FAIL_OLE - OleInitialize Failed";
208+ 3 = "FAIL_LOAD - LoadLibrary Failed";
209+ 4 = "FAIL_ENTRY - GetProcAddress failed";
210+ 5 = "FAIL_REG - DllRegisterServer or DllUnregisterServer failed.";
211+ }
212+ $ocxPath = "${{ github.workspace }}\src\bin\${{env.BUILD_CONFIGURATION}}\x64\MapWinGIS.ocx"
213+ if (!(Test-Path $ocxPath)) {
214+ Write-Error "MapWinGIS.ocx was not found at $ocxPath"
215+ }
216+ $regsvrp = Start-Process C:\Windows\System32\regsvr32.exe -ArgumentList "/s $ocxPath" -PassThru
217+
218+ $regsvrp.WaitForExit(15000) # Wait (up to) 15 seconds
219+ if($regsvrp.ExitCode -ne 0)
220+ {
221+ Write-Host "RegSrv32 for x64 failed"
222+ Write-Error $ExitCodes[$regsvrp.ExitCode]
223+ }
224+ # Azure PS version to be used to execute the script.
225+ azPSVersion : " latest"
226+ # Select the value of the ErrorActionPreference variable for executing the script.
227+ errorActionPreference : Stop
228+ # If this is true, this task will fail if any errors are written to the error pipeline.
191229 failOnStandardError : true
192230
193231 # Build test solution
0 commit comments