@@ -428,6 +428,12 @@ function BuildSetup()
428
428
# Set innosetup path
429
429
$innobuild = " ${env: ProgramFiles(x86)} \Inno Setup 5\ISCC.exe"
430
430
431
+ if (! (Test-Path $innobuild ))
432
+ {
433
+ Write-Host " `t [SKIPPED] (Inno Setup not installed)" - ForegroundColor Yellow
434
+ return ;
435
+ }
436
+
431
437
# Execute the Inno setup
432
438
if ($global :debug_enabled )
433
439
{
@@ -456,6 +462,12 @@ function BuildSdkZip()
456
462
# Set 7-Zip executable path
457
463
$7zip = " ${env: ProgramFiles} \7-Zip\7z.exe"
458
464
465
+ if (! (Test-Path $7zip ))
466
+ {
467
+ Write-Host " `t [SKIPPED] (7-Zip not installed)" - ForegroundColor Yellow
468
+ return ;
469
+ }
470
+
459
471
# Execute the Inno setup
460
472
if ($global :debug_enabled )
461
473
{
@@ -498,6 +510,12 @@ function BuildZip()
498
510
# Set 7-Zip path
499
511
$7zip = " ${env: ProgramFiles} \7-Zip\7z.exe"
500
512
513
+ if (! (Test-Path $7zip ))
514
+ {
515
+ Write-Host " `t [SKIPPED] (7-Zip not installed)" - ForegroundColor Yellow
516
+ return ;
517
+ }
518
+
501
519
# Execute 7-Zip
502
520
if ($global :debug_enabled )
503
521
{
@@ -533,6 +551,12 @@ function BuildSourceZip()
533
551
# Set git executable path
534
552
$git = " ${env: ProgramFiles} \Git\cmd\git.exe"
535
553
554
+ if (! (Test-Path $git ))
555
+ {
556
+ Write-Host " `t [SKIPPED] (Git not installed)" - ForegroundColor Yellow
557
+ return ;
558
+ }
559
+
536
560
& $git " --git-dir=.git" ,
537
561
" --work-tree=.\" ,
538
562
" archive" ,
@@ -555,15 +579,25 @@ function GenerateHashes()
555
579
# Create Arraylist
556
580
$array = $ ();
557
581
558
- # Append the result of Get-FileHash to the Arraylist
559
- Get-FileHash " ${env: BUILD_OUTPUT_FOLDER} \processhacker-nightly-setup.exe" - Algorithm SHA1 - OutVariable + array | Out-Null
560
- Get-FileHash " ${env: BUILD_OUTPUT_FOLDER} \processhacker-nightly-setup.exe" - Algorithm SHA256 - OutVariable + array | Out-Null
561
- Get-FileHash " ${env: BUILD_OUTPUT_FOLDER} \processhacker-nightly-sdk.zip" - Algorithm SHA1 - OutVariable + array | Out-Null
562
- Get-FileHash " ${env: BUILD_OUTPUT_FOLDER} \processhacker-nightly-sdk.zip" - Algorithm SHA256 - OutVariable + array | Out-Null
563
- Get-FileHash " ${env: BUILD_OUTPUT_FOLDER} \processhacker-nightly-bin.zip" - Algorithm SHA1 - OutVariable + array | Out-Null
564
- Get-FileHash " ${env: BUILD_OUTPUT_FOLDER} \processhacker-nightly-bin.zip" - Algorithm SHA256 - OutVariable + array | Out-Null
565
- Get-FileHash " ${env: BUILD_OUTPUT_FOLDER} \processhacker-nightly-src.zip" - Algorithm SHA1 - OutVariable + array | Out-Null
566
- Get-FileHash " ${env: BUILD_OUTPUT_FOLDER} \processhacker-nightly-src.zip" - Algorithm SHA256 - OutVariable + array | Out-Null
582
+ $file_names =
583
+ " processhacker-nightly-setup.exe" ,
584
+ " processhacker-nightly-sdk.zip" ,
585
+ " processhacker-nightly-bin.zip" ,
586
+ " processhacker-nightly-src.zip" ;
587
+
588
+ foreach ($file in $file_names )
589
+ {
590
+ if (! (Test-Path " ${env: BUILD_OUTPUT_FOLDER} \$file " ))
591
+ {
592
+ if ($global :debug_enabled )
593
+ {
594
+ Write-Host " `t (SKIPPED: $file )" - NoNewline - ForegroundColor Yellow
595
+ }
596
+ continue ;
597
+ }
598
+
599
+ Get-FileHash " ${env: BUILD_OUTPUT_FOLDER} \$file " - Algorithm SHA256 - OutVariable + array | Out-Null
600
+ }
567
601
568
602
# Convert the Arraylist to a string
569
603
$data = $array | Out-String
0 commit comments